diff mercurial/dirstate.py @ 2485:885de96eb542

filterfiles: Search as long as the target is a prefix of current. filterfiles was failing to find files for directory arguments if another file existed that started with the directory name and sorted earlier. For example, a manifest of ('foo.h', 'foo/foo') would cause filterfiles('foo') to return nothing. This resolves issue #294.
author Brendan Cully <brendan@kublai.com>
date Fri, 23 Jun 2006 00:11:53 +0200
parents fe1689273f84
children 3ea8111ead90
line wrap: on
line diff
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -285,8 +285,9 @@ class dirstate(object):
                 continue
             while bs < blen:
                 s = b[bs]
-                if len(s) > len(x) and s.startswith(x) and s[len(x)] == '/':
-                    ret[s] = self.map[s]
+                if len(s) > len(x) and s.startswith(x):
+                    if s[len(x)] == '/':
+                        ret[s] = self.map[s]
                 else:
                     break
                 bs += 1