changeset 2486:3ea8111ead90

simplify filterfiles when filtering based on a directory since an unkown files cannot be an exact match, we bisect for a <path>/ instead of <path> and we get only the files below the directory.
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Fri, 23 Jun 2006 08:09:48 +0200
parents 885de96eb542
children 041363739ca8
files mercurial/dirstate.py
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Fri Jun 23 00:11:53 2006 +0200
+++ b/mercurial/dirstate.py	Fri Jun 23 08:09:48 2006 +0200
@@ -279,15 +279,11 @@
         blen = len(b)
 
         for x in unknown:
-            bs = bisect.bisect(b, x)
-            if bs != 0 and  b[bs-1] == x:
-                ret[x] = self.map[x]
-                continue
+            bs = bisect.bisect(b, "%s%s" % (x, '/'))
             while bs < blen:
                 s = b[bs]
                 if len(s) > len(x) and s.startswith(x):
-                    if s[len(x)] == '/':
-                        ret[s] = self.map[s]
+                    ret[s] = self.map[s]
                 else:
                     break
                 bs += 1