Show More
@@ -34,7 +34,7 b' def parseconfig(ui, raw):' | |||
|
34 | 34 | includes = set() |
|
35 | 35 | excludes = set() |
|
36 | 36 | current = includes |
|
37 |
profiles = |
|
|
37 | profiles = set() | |
|
38 | 38 | for line in raw.split('\n'): |
|
39 | 39 | line = line.strip() |
|
40 | 40 | if not line or line.startswith('#'): |
@@ -43,7 +43,7 b' def parseconfig(ui, raw):' | |||
|
43 | 43 | elif line.startswith('%include '): |
|
44 | 44 | line = line[9:].strip() |
|
45 | 45 | if line: |
|
46 |
profiles.a |
|
|
46 | profiles.add(line) | |
|
47 | 47 | elif line == '[include]': |
|
48 | 48 | if current != includes: |
|
49 | 49 | # TODO pass filename into this API so we can report it. |
@@ -76,11 +76,11 b' def patternsforrev(repo, rev):' | |||
|
76 | 76 | """ |
|
77 | 77 | # Feature isn't enabled. No-op. |
|
78 | 78 | if not enabled: |
|
79 |
return set(), set(), |
|
|
79 | return set(), set(), set() | |
|
80 | 80 | |
|
81 | 81 | raw = repo.vfs.tryread('sparse') |
|
82 | 82 | if not raw: |
|
83 |
return set(), set(), |
|
|
83 | return set(), set(), set() | |
|
84 | 84 | |
|
85 | 85 | if rev is None: |
|
86 | 86 | raise error.Abort(_('cannot parse sparse patterns from working ' |
@@ -115,8 +115,7 b' def patternsforrev(repo, rev):' | |||
|
115 | 115 | pincludes, pexcludes, subprofs = parseconfig(repo.ui, raw) |
|
116 | 116 | includes.update(pincludes) |
|
117 | 117 | excludes.update(pexcludes) |
|
118 |
|
|
|
119 | profiles.append(subprofile) | |
|
118 | profiles.update(subprofs) | |
|
120 | 119 | |
|
121 | 120 | profiles = visited |
|
122 | 121 | |
@@ -142,7 +141,7 b' def activeconfig(repo):' | |||
|
142 | 141 | includes, excludes, profiles = patternsforrev(repo, rev) |
|
143 | 142 | allincludes |= includes |
|
144 | 143 | allexcludes |= excludes |
|
145 |
allprofiles |= |
|
|
144 | allprofiles |= profiles | |
|
146 | 145 | |
|
147 | 146 | return allincludes, allexcludes, allprofiles |
|
148 | 147 | |
@@ -504,7 +503,7 b' def aftercommit(repo, node):' | |||
|
504 | 503 | profiles = patternsforrev(repo, ctx.rev())[2] |
|
505 | 504 | |
|
506 | 505 | # profiles will only have data if sparse is enabled. |
|
507 |
if |
|
|
506 | if profiles & set(ctx.files()): | |
|
508 | 507 | origstatus = repo.status() |
|
509 | 508 | origsparsematch = matcher(repo) |
|
510 | 509 | refreshwdir(repo, origstatus, origsparsematch, force=True) |
@@ -555,7 +554,7 b' def importfromfiles(repo, opts, paths, f' | |||
|
555 | 554 | oldsize = len(includes) + len(excludes) + len(profiles) |
|
556 | 555 | includes.update(iincludes - aincludes) |
|
557 | 556 | excludes.update(iexcludes - aexcludes) |
|
558 |
profiles.update( |
|
|
557 | profiles.update(iprofiles - aprofiles) | |
|
559 | 558 | if len(includes) + len(excludes) + len(profiles) > oldsize: |
|
560 | 559 | changed = True |
|
561 | 560 | |
@@ -604,7 +603,6 b' def updateconfig(repo, pats, opts, inclu' | |||
|
604 | 603 | |
|
605 | 604 | raw = repo.vfs.tryread('sparse') |
|
606 | 605 | oldinclude, oldexclude, oldprofiles = parseconfig(repo.ui, raw) |
|
607 | oldprofiles = set(oldprofiles) | |
|
608 | 606 | |
|
609 | 607 | if reset: |
|
610 | 608 | newinclude = set() |
General Comments 0
You need to be logged in to leave comments.
Login now