hgext/narrow/narrowdirstate.py
changeset 36200 deb851914fd7
parent 36160 9fd8c2a3db5a
child 38128 1cba497491be
--- a/hgext/narrow/narrowdirstate.py	Sun Jan 21 17:04:42 2018 +0900
+++ b/hgext/narrow/narrowdirstate.py	Fri Jan 26 19:48:39 2018 +0900
@@ -23,8 +23,11 @@
     def walk(orig, self, match, subrepos, unknown, ignored, full=True,
              narrowonly=True):
         if narrowonly:
-            narrowmatch = repo.narrowmatch()
-            match = matchmod.intersectmatchers(match, narrowmatch)
+            # 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())
+            nm = matchmod.unionmatcher([repo.narrowmatch(), em])
+            match = matchmod.intersectmatchers(match, nm)
         return orig(self, match, subrepos, unknown, ignored, full)
 
     extensions.wrapfunction(dirstate.dirstate, 'walk', walk)