##// END OF EJS Templates
repository: introduce constant for sparse repo requirement and use it...
Pulkit Goyal -
r45914:a1f51c7d default
parent child Browse files
Show More
@@ -15,6 +15,9 b' from . import util as interfaceutil'
15 15 # we should move this to just "narrow" or similar.
16 16 NARROW_REQUIREMENT = b'narrowhg-experimental'
17 17
18 # Enables sparse working directory usage
19 SPARSE_REQUIREMENT = b'exp-sparse'
20
18 21 # Local repository feature string.
19 22
20 23 # Revlogs are being used for file storage.
@@ -816,7 +816,7 b' def ensurerequirementscompatible(ui, req'
816 816
817 817 ``error.RepoError`` should be raised on failure.
818 818 """
819 if b'exp-sparse' in requirements and not sparse.enabled:
819 if repository.SPARSE_REQUIREMENT in requirements and not sparse.enabled:
820 820 raise error.RepoError(
821 821 _(
822 822 b'repository is using sparse feature but '
@@ -1067,7 +1067,7 b' class localrepository(object):'
1067 1067 b'shared',
1068 1068 b'relshared',
1069 1069 b'dotencode',
1070 b'exp-sparse',
1070 repository.SPARSE_REQUIREMENT,
1071 1071 b'internal-phase',
1072 1072 }
1073 1073
@@ -24,8 +24,10 b' from . import ('
24 24 scmutil,
25 25 util,
26 26 )
27 from .interfaces import repository
27 28 from .utils import hashutil
28 29
30
29 31 # Whether sparse features are enabled. This variable is intended to be
30 32 # temporary to facilitate porting sparse to core. It should eventually be
31 33 # a per-repo option, possibly a repo requirement.
@@ -606,11 +608,11 b' def _updateconfigandrefreshwdir('
606 608 # updated. But this requires massive rework to matcher() and its
607 609 # consumers.
608 610
609 if b'exp-sparse' in oldrequires and removing:
610 repo.requirements.discard(b'exp-sparse')
611 if repository.SPARSE_REQUIREMENT in oldrequires and removing:
612 repo.requirements.discard(repository.SPARSE_REQUIREMENT)
611 613 scmutil.writereporequirements(repo)
612 elif b'exp-sparse' not in oldrequires:
613 repo.requirements.add(b'exp-sparse')
614 elif repository.SPARSE_REQUIREMENT not in oldrequires:
615 repo.requirements.add(repository.SPARSE_REQUIREMENT)
614 616 scmutil.writereporequirements(repo)
615 617
616 618 try:
General Comments 0
You need to be logged in to leave comments. Login now