##// END OF EJS Templates
narrow: move remaining narrow-limited dirstate walks to core...
Martin von Zweigbergk -
r40123:1d09ba0d default
parent child Browse files
Show More
@@ -14,3 +14,11 b' server-specified narrowspec format.'
14
14
15 narrowrepo.setnarrowpats() or narrowspec.save() need to make sure
15 narrowrepo.setnarrowpats() or narrowspec.save() need to make sure
16 they're holding the wlock.
16 they're holding the wlock.
17
18 The follinwg places do an unrestricted dirstate walk (including files outside the
19 narrowspec). Some of them should perhaps not do that.
20
21 * debugfileset
22 * perfwalk
23 * sparse (but restricted to sparse config)
24 * largefiles
@@ -26,13 +26,6 b' def wrapdirstate(repo, dirstate):'
26 return _wrapper
26 return _wrapper
27
27
28 class narrowdirstate(dirstate.__class__):
28 class narrowdirstate(dirstate.__class__):
29 def walk(self, match, subrepos, unknown, ignored, full=True,
30 narrowonly=True):
31 if narrowonly:
32 match = repo.narrowmatch(match, includeexact=True)
33 return super(narrowdirstate, self).walk(match, subrepos, unknown,
34 ignored, full)
35
36 # Prevent adding/editing/copying/deleting files that are outside the
29 # Prevent adding/editing/copying/deleting files that are outside the
37 # sparse checkout
30 # sparse checkout
38 @_editfunc
31 @_editfunc
@@ -2044,6 +2044,7 b' def add(ui, repo, match, prefix, explici'
2044 if abort or warn:
2044 if abort or warn:
2045 cca = scmutil.casecollisionauditor(ui, abort, repo.dirstate)
2045 cca = scmutil.casecollisionauditor(ui, abort, repo.dirstate)
2046
2046
2047 match = repo.narrowmatch(match, includeexact=True)
2047 badmatch = matchmod.badmatch(match, badfn)
2048 badmatch = matchmod.badmatch(match, badfn)
2048 dirstate = repo.dirstate
2049 dirstate = repo.dirstate
2049 # We don't want to just call wctx.walk here, since it would return a lot of
2050 # We don't want to just call wctx.walk here, since it would return a lot of
@@ -1098,6 +1098,7 b' def _interestingfiles(repo, matcher):'
1098
1098
1099 ctx = repo[None]
1099 ctx = repo[None]
1100 dirstate = repo.dirstate
1100 dirstate = repo.dirstate
1101 matcher = repo.narrowmatch(matcher, includeexact=True)
1101 walkresults = dirstate.walk(matcher, subrepos=sorted(ctx.substate),
1102 walkresults = dirstate.walk(matcher, subrepos=sorted(ctx.substate),
1102 unknown=True, ignored=False, full=False)
1103 unknown=True, ignored=False, full=False)
1103 for abs, st in walkresults.iteritems():
1104 for abs, st in walkresults.iteritems():
General Comments 0
You need to be logged in to leave comments. Login now