mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
sparse: kill SparseConfig.isroot flag
Summary: This was always set to True except in the empty-profile case, where it didn't make any difference. Reviewed By: quark-zju Differential Revision: D49928292 fbshipit-source-id: 46e4d3ca86b409e3b034f5734f4148bf767386f7
This commit is contained in:
parent
028b0d86ec
commit
efc1bf339e
@ -798,7 +798,6 @@ class SparseConfig:
|
||||
mainrules = attr.ib(convert=list)
|
||||
profiles = attr.ib(convert=tuple)
|
||||
metadata = attr.ib(default=attr.Factory(dict))
|
||||
isroot = attr.ib(default=False)
|
||||
ruleorigins = attr.ib(default=attr.Factory(list))
|
||||
|
||||
def toincludeexclude(self):
|
||||
@ -1130,19 +1129,14 @@ def computesparsematcher(
|
||||
# mainrules above.
|
||||
version = debugversion or profile.version()
|
||||
if version != "1":
|
||||
# Only union the profiles if we are the root level .hg/sparse profile.
|
||||
if config.isroot:
|
||||
matchers.append(
|
||||
matchmod.rulesmatch(
|
||||
repo.root,
|
||||
"",
|
||||
profile.rules,
|
||||
ruledetails=profile.ruleorigins,
|
||||
)
|
||||
matchers.append(
|
||||
matchmod.rulesmatch(
|
||||
repo.root,
|
||||
"",
|
||||
profile.rules,
|
||||
ruledetails=profile.ruleorigins,
|
||||
)
|
||||
else:
|
||||
matchrules.extend(profile.rules)
|
||||
ruleorigins.extend(profile.ruleorigins)
|
||||
)
|
||||
|
||||
if matchrules:
|
||||
matchers.append(
|
||||
@ -1264,7 +1258,6 @@ def getsparsepatterns(
|
||||
rules,
|
||||
profiles,
|
||||
rawconfig.metadata,
|
||||
True, # isroot
|
||||
ruleorigins,
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user