hgext/narrow/narrowdirstate.py
changeset 39960 1a7d901a0a0c
parent 38869 ad24b581e4d9
child 40086 41fcdfe3bfeb
--- a/hgext/narrow/narrowdirstate.py	Wed Sep 26 23:09:28 2018 -0700
+++ b/hgext/narrow/narrowdirstate.py	Mon Oct 01 15:29:31 2018 -0700
@@ -18,10 +18,9 @@
 
     def _editfunc(fn):
         def _wrapper(self, *args):
-            dirstate = repo.dirstate
             narrowmatch = repo.narrowmatch()
             for f in args:
-                if f is not None and not narrowmatch(f) and f not in dirstate:
+                if f is not None and not narrowmatch(f) and f not in self:
                     raise error.Abort(_("cannot track '%s' - it is outside " +
                         "the narrow clone") % f)
             return fn(self, *args)