[issue294] hg remove --after dir fails when dir.* also exists
Brendan Cully
brendan at kublai.com
Wed Jun 21 17:33:30 CDT 2006
Here's a patch.
On Wednesday, 21 June 2006 at 20:26, Brendan Cully wrote:
>
> New submission from Brendan Cully <brendan at kublai.com>:
>
> Create a repository like so:
> hg init foo
> cd foo
> mkdir foo
> touch foo/foo
> touch foo.h
> hg add
> hg commit -m'foo'
>
> Then try this:
> rm -r foo
> hg rm -A foo
>
> This looks like it might be a bug in dirstate.filterfiles?
>
> if len(s) > len(x) and s.startswith(x) and s[len(x)] == '/':
> ret[s] = self.map[s]
> else:
> break
>
> messages: 1567
> nosy: brendan
> priority: bug
> status: unread
> title: hg remove --after dir fails when dir.* also exists
> topic: matcher
>
> ____________________________________________________
> Mercurial issue tracker <mercurial-bugs at selenic.com>
> <http://www.selenic.com/mercurial/bts/issue294>
> ____________________________________________________
>
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
-------------- next part --------------
# HG changeset patch
# User Brendan Cully <brendan at kublai.com>
# Node ID f057ae15d7738dd3555b63e71f0346e5cd24d719
# Parent ff9ee834e3b6f0c151f920288cdcfc62bbd2ff80
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 -r ff9ee834e3b6 -r f057ae15d773 mercurial/dirstate.py
--- a/mercurial/dirstate.py Tue Jun 20 09:11:41 2006 -0700
+++ b/mercurial/dirstate.py Wed Jun 21 15:25:40 2006 -0700
@@ -286,8 +286,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
More information about the Mercurial
mailing list