Mercurial > public > mercurial-scm > hg
comparison mercurial/sparse.py @ 33299:41448fc51510
sparse: variable to track if sparse is enabled
Currently, the sparse extension sniffs repo instances for
attributes defined by the sparse extension to determine if
sparse is enabled. As we move code away from repo instances,
these checks will be a bit more brittle.
We introduce a module-level variable to track whether sparse is
enabled as a temporary workaround.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 06 Jul 2017 12:06:37 -0700 |
parents | f41a99c45956 |
children | f7a106b3f089 |
comparison
equal
deleted
inserted
replaced
33298:f41a99c45956 | 33299:41448fc51510 |
---|---|
9 | 9 |
10 from .i18n import _ | 10 from .i18n import _ |
11 from . import ( | 11 from . import ( |
12 error, | 12 error, |
13 ) | 13 ) |
14 | |
15 # Whether sparse features are enabled. This variable is intended to be | |
16 # temporary to facilitate porting sparse to core. It should eventually be | |
17 # a per-repo option, possibly a repo requirement. | |
18 enabled = False | |
14 | 19 |
15 def parseconfig(ui, raw): | 20 def parseconfig(ui, raw): |
16 """Parse sparse config file content. | 21 """Parse sparse config file content. |
17 | 22 |
18 Returns a tuple of includes, excludes, and profiles. | 23 Returns a tuple of includes, excludes, and profiles. |