martinvonz created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Narrow has been walking only paths matching the narrowspec when
  walking the working copy. We have not done the same filtering when
  walking committed revisions (e.g. "hg files -r "), which seems a
  little odd. Let's make it consistent.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4898

AFFECTED FILES
  mercurial/context.py
  tests/test-narrow-commit.t

CHANGE DETAILS

diff --git a/tests/test-narrow-commit.t b/tests/test-narrow-commit.t
--- a/tests/test-narrow-commit.t
+++ b/tests/test-narrow-commit.t
@@ -91,8 +91,6 @@
   created new head
   $ hg files -r .
   inside/f1
-  outside/f1 (flat !)
-  outside/ (tree !)
   $ hg manifest --debug
   3f4197b4a11b9016e77ebc47fe566944885fd11b 644   inside/f1
   7fb3bb6356d28d4dc352c5ba52d7350a81b6bd46 644   outside/f1 (flat !)
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -542,7 +542,7 @@
                 return
             match.bad(fn, _('no such file in rev %s') % self)
 
-        m = matchmod.badmatch(match, bad)
+        m = matchmod.badmatch(self._repo.narrowmatch(match), bad)
         return self._manifest.walk(m)
 
     def matches(self, match):
@@ -1168,7 +1168,7 @@
 
     def walk(self, match):
         '''Generates matching file names.'''
-        return sorted(self._repo.dirstate.walk(match,
+        return sorted(self._repo.dirstate.walk(self._repo.narrowmatch(match),
                                                subrepos=sorted(self.substate),
                                                unknown=True, ignored=False))
 



To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to