mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
sparse: skip checking files outside sparse for absorb's case
Summary: The logic was added by D2594568 and is intentional for "repairing" dirstate. It's O(working copy). That makes absorb super slow. Therefore let's use the new "exact" flag to skip the slow path. Reviewed By: mitrandir77 Differential Revision: D7818728 fbshipit-source-id: a3a7d6074bd0240b9e1919e18d3e0b95daf74a64
This commit is contained in:
parent
0fb4933a1e
commit
841114e210
@ -445,6 +445,12 @@ def _setupdirstate(ui):
|
||||
|
||||
# dirstate.rebuild should not add non-matching files
|
||||
def _rebuild(orig, self, parent, allfiles, changedfiles=None, exact=False):
|
||||
if exact:
|
||||
# If exact=True, files outside "changedfiles" are assumed unchanged.
|
||||
# In this case, do not check files outside sparse profile. This
|
||||
# skips O(working copy) scans, and affect absorb perf.
|
||||
return orig(self, parent, allfiles, changedfiles, exact=exact)
|
||||
|
||||
if util.safehasattr(self.repo, 'sparsematch'):
|
||||
matcher = self.repo.sparsematch()
|
||||
allfiles = allfiles.matches(matcher)
|
||||
@ -454,6 +460,7 @@ def _setupdirstate(ui):
|
||||
if changedfiles is not None:
|
||||
# In _rebuild, these files will be deleted from the dirstate
|
||||
# when they are not found to be in allfiles
|
||||
# This is O(working copy) and is expensive.
|
||||
dirstatefilestoremove = set(f for f in self if not matcher(f))
|
||||
changedfiles = dirstatefilestoremove.union(changedfiles)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user