# HG changeset patch # User Benoit Boissinot # Date 1151042988 -7200 # Node ID 3ea8111ead90dec43d217e9427e023664efd56a3 # Parent 885de96eb5422f62e564f8f7e1ebc6abf1bd3aec simplify filterfiles when filtering based on a directory since an unkown files cannot be an exact match, we bisect for a / instead of and we get only the files below the directory. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -279,15 +279,11 @@ class dirstate(object): 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