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.
--- a/mercurial/dirstate.py Wed Jun 21 22:45:29 2006 -0700
+++ b/mercurial/dirstate.py Fri Jun 23 00:11:53 2006 +0200
@@ -285,8 +285,9 @@
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