Mercurial > public > mercurial-scm > hg
comparison mercurial/sparse.py @ 45372:77b8588dd84e
requirements: introduce new requirements related module
It was not clear where all requirements should and related APIs should be, this
patch introduces a requirements module which will have all exitsing requirements
and related APIs.
Differential Revision: https://phab.mercurial-scm.org/D8917
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 08 Aug 2020 16:24:12 +0530 |
parents | a1f51c7dce0f |
children | 14b3dbfa4eeb |
comparison
equal
deleted
inserted
replaced
45371:e58e234096de | 45372:77b8588dd84e |
---|---|
19 match as matchmod, | 19 match as matchmod, |
20 merge as mergemod, | 20 merge as mergemod, |
21 mergestate as mergestatemod, | 21 mergestate as mergestatemod, |
22 pathutil, | 22 pathutil, |
23 pycompat, | 23 pycompat, |
24 requirements, | |
24 scmutil, | 25 scmutil, |
25 util, | 26 util, |
26 ) | 27 ) |
27 from .interfaces import repository | |
28 from .utils import hashutil | 28 from .utils import hashutil |
29 | 29 |
30 | 30 |
31 # Whether sparse features are enabled. This variable is intended to be | 31 # Whether sparse features are enabled. This variable is intended to be |
32 # temporary to facilitate porting sparse to core. It should eventually be | 32 # temporary to facilitate porting sparse to core. It should eventually be |
606 # re-read. We ideally want to update the cached matcher on the | 606 # re-read. We ideally want to update the cached matcher on the |
607 # repo instance then flush the new config to disk once wdir is | 607 # repo instance then flush the new config to disk once wdir is |
608 # updated. But this requires massive rework to matcher() and its | 608 # updated. But this requires massive rework to matcher() and its |
609 # consumers. | 609 # consumers. |
610 | 610 |
611 if repository.SPARSE_REQUIREMENT in oldrequires and removing: | 611 if requirements.SPARSE_REQUIREMENT in oldrequires and removing: |
612 repo.requirements.discard(repository.SPARSE_REQUIREMENT) | 612 repo.requirements.discard(requirements.SPARSE_REQUIREMENT) |
613 scmutil.writereporequirements(repo) | 613 scmutil.writereporequirements(repo) |
614 elif repository.SPARSE_REQUIREMENT not in oldrequires: | 614 elif requirements.SPARSE_REQUIREMENT not in oldrequires: |
615 repo.requirements.add(repository.SPARSE_REQUIREMENT) | 615 repo.requirements.add(requirements.SPARSE_REQUIREMENT) |
616 scmutil.writereporequirements(repo) | 616 scmutil.writereporequirements(repo) |
617 | 617 |
618 try: | 618 try: |
619 writeconfig(repo, includes, excludes, profiles) | 619 writeconfig(repo, includes, excludes, profiles) |
620 return refreshwdir(repo, oldstatus, oldmatch, force=force) | 620 return refreshwdir(repo, oldstatus, oldmatch, force=force) |