Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
2484:eabcda3ed0dd | 2485:885de96eb542 |
---|---|
283 if bs != 0 and b[bs-1] == x: | 283 if bs != 0 and b[bs-1] == x: |
284 ret[x] = self.map[x] | 284 ret[x] = self.map[x] |
285 continue | 285 continue |
286 while bs < blen: | 286 while bs < blen: |
287 s = b[bs] | 287 s = b[bs] |
288 if len(s) > len(x) and s.startswith(x) and s[len(x)] == '/': | 288 if len(s) > len(x) and s.startswith(x): |
289 ret[s] = self.map[s] | 289 if s[len(x)] == '/': |
290 ret[s] = self.map[s] | |
290 else: | 291 else: |
291 break | 292 break |
292 bs += 1 | 293 bs += 1 |
293 return ret | 294 return ret |
294 | 295 |