mercurial/revset.py
changeset 28008 86c4cbdaffee
parent 27945 4186d359046a
child 28015 a036e1ae1fbe
--- a/mercurial/revset.py	Thu Feb 04 08:34:07 2016 -0800
+++ b/mercurial/revset.py	Fri Feb 05 13:30:25 2016 -0800
@@ -1086,13 +1086,14 @@
         matcher = matchmod.match(repo.root, repo.getcwd(), [x],
                                  ctx=repo[None], default='path')
 
+        files = c.manifest().walk(matcher)
+
         s = set()
-        for fname in c:
-            if matcher(fname):
-                fctx = c[fname]
-                s = s.union(set(c.rev() for c in fctx.ancestors(followfirst)))
-                # include the revision responsible for the most recent version
-                s.add(fctx.introrev())
+        for fname in files:
+            fctx = c[fname]
+            s = s.union(set(c.rev() for c in fctx.ancestors(followfirst)))
+            # include the revision responsible for the most recent version
+            s.add(fctx.introrev())
     else:
         s = _revancestors(repo, baseset([c.rev()]), followfirst)