hgext/sparse.py
changeset 49357 5b7a10ddb42f
parent 49356 a87443d4aec0
child 49358 05da1f1612db
--- a/hgext/sparse.py	Sat Jun 11 00:58:41 2022 +0200
+++ b/hgext/sparse.py	Sat Jun 11 00:59:11 2022 +0200
@@ -212,24 +212,6 @@
     and to prevent modifications to files outside the checkout.
     """
 
-    # dirstate.rebuild should not add non-matching files
-    def _rebuild(orig, self, parent, allfiles, changedfiles=None):
-        matcher = self._sparsematcher
-        if matcher is not None and not matcher.always():
-            allfiles = [f for f in allfiles if matcher(f)]
-            if changedfiles:
-                changedfiles = [f for f in changedfiles if matcher(f)]
-
-            if changedfiles is not None:
-                # In _rebuild, these files will be deleted from the dirstate
-                # when they are not found to be in allfiles
-                dirstatefilestoremove = {f for f in self if not matcher(f)}
-                changedfiles = dirstatefilestoremove.union(changedfiles)
-
-        return orig(self, parent, allfiles, changedfiles)
-
-    extensions.wrapfunction(dirstate.dirstate, b'rebuild', _rebuild)
-
     # Prevent adding files that are outside the sparse checkout
     editfuncs = [
         b'set_tracked',