mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
dirstate: add an "exact" parameter to "rebuild"
Summary: This is a hint for performing certain fast paths. Reviewed By: mitrandir77 Differential Revision: D7818730 fbshipit-source-id: 4adcf8724b462d8d652e8e580d6a36eebc46a0f8
This commit is contained in:
parent
77638ffcc0
commit
1b475a874d
@ -444,7 +444,7 @@ def _setupdirstate(ui):
|
||||
replacefilecache(dirstate.dirstate, '_ignore', ignorewrapper)
|
||||
|
||||
# dirstate.rebuild should not add non-matching files
|
||||
def _rebuild(orig, self, parent, allfiles, changedfiles=None):
|
||||
def _rebuild(orig, self, parent, allfiles, changedfiles=None, exact=False):
|
||||
if util.safehasattr(self.repo, 'sparsematch'):
|
||||
matcher = self.repo.sparsematch()
|
||||
allfiles = allfiles.matches(matcher)
|
||||
|
@ -583,8 +583,13 @@ class dirstate(object):
|
||||
self._updatedfiles.clear()
|
||||
self._dirty = True
|
||||
|
||||
def rebuild(self, parent, allfiles, changedfiles=None):
|
||||
def rebuild(self, parent, allfiles, changedfiles=None, exact=False):
|
||||
# If exact is True, then assume only changedfiles can be changed, and
|
||||
# other files cannot be possibly changed. This is used by "absorb" as
|
||||
# a hint to perform a fast path for fsmonitor and sparse.
|
||||
if changedfiles is None:
|
||||
if exact:
|
||||
raise error.ProgrammingError('exact requires changedfiles')
|
||||
# Rebuild entire dirstate
|
||||
changedfiles = allfiles
|
||||
lastnormaltime = self._lastnormaltime
|
||||
|
Loading…
Reference in New Issue
Block a user