# HG changeset patch # User Brendan Cully # Date 1151014313 -7200 # Node ID 885de96eb5422f62e564f8f7e1ebc6abf1bd3aec # Parent eabcda3ed0dddff5b785eaf4795ab7d42afdbc98 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. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- 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