hgext/sparse.py
changeset 36238 deb851914fd7
parent 35927 572f36e9a780
child 38145 d7cecea0b254
--- a/hgext/sparse.py	Sun Jan 21 17:04:42 2018 +0900
+++ b/hgext/sparse.py	Fri Jan 26 19:48:39 2018 +0900
@@ -194,7 +194,11 @@
     """
 
     def walk(orig, self, match, subrepos, unknown, ignored, full=True):
-        match = matchmod.intersectmatchers(match, self._sparsematcher)
+        # hack to not exclude explicitly-specified paths so that they can
+        # be warned later on e.g. dirstate.add()
+        em = matchmod.exact(match._root, match._cwd, match.files())
+        sm = matchmod.unionmatcher([self._sparsematcher, em])
+        match = matchmod.intersectmatchers(match, sm)
         return orig(self, match, subrepos, unknown, ignored, full)
 
     extensions.wrapfunction(dirstate.dirstate, 'walk', walk)