mercurial/context.py
branchstable
changeset 16145 616c2e278f18
parent 16143 fceb2964fa6c
child 16151 a01d2fb5ba65
child 16359 a1b6a63f9f39
--- a/mercurial/context.py	Thu Feb 23 00:07:54 2012 +0900
+++ b/mercurial/context.py	Thu Feb 23 00:07:54 2012 +0900
@@ -206,14 +206,15 @@
         # follow that here, too
         fset.discard('.')
         for fn in self:
-            for ffn in fset:
-                # match if the file is the exact name or a directory
-                if ffn == fn or fn.startswith("%s/" % ffn):
-                    fset.remove(ffn)
-                    break
+            if fn in fset:
+                # specified pattern is the exact name
+                fset.remove(fn)
             if match(fn):
                 yield fn
         for fn in sorted(fset):
+            if fn in self._dirs:
+                # specified pattern is a directory
+                continue
             if match.bad(fn, _('no such file in rev %s') % self) and match(fn):
                 yield fn