[MERGE] [bug #111664] bzr rm refuses to delete renamed files
Vincent Ladeuil
v.ladeuil+lp at free.fr
Thu Jun 28 07:53:50 BST 2007
>>>>> "Marius" == Marius Kruger <amanic at gmail.com> writes:
Marius> hi,
Marius> On 6/25/07, Robert Collins <robertc at robertcollins.net> wrote:
>>
>> On Mon, 2007-06-25 at 19:40 +0200, Marius Kruger wrote:
>> > hopefully this bundle address all the comments on the list.
>> > The changes I made since the last patch are:
>>
>> +1 Conditional on one further change:
Marius> ...
>> assertRemoveErrorContainsRe can now away completely I think. I propose
>> the following -
>> delete the asertRemoveErrorContainsRe method
>> change
>> + e = self.assertRaises(errors.BzrRemoveChangedFilesError,
>> tree.remove,
>> + TestRemove.files, keep_files=False)
>> + self._assertRemoveErrorContainsRe(e, 'unknown:.*b/c.*b.*a.*d')
>>
>> into
>>
>> + err = self.assertRaises(errors.BzrRemoveChangedFilesError,
>> tree.remove,
>> + TestRemove.files, keep_files=False)
>> + self._assertContainsRe(err.changes_as_text,
>> 'unknown:.*b/c.*b.*a.*d')
Marius> done
Marius> (never mind my previous e-mail,
Marius> the pattern was a little wrong: the 'd' should have been sorted to the
Marius> front,
Marius> but because the was a 'd' in the rest of the error message, this test used
Marius> to pass.
Marius> It seems its a good thing to make this change away from str(err),
Marius> and it seems a, b, c, d are not such a good choice for file names if the
Marius> testing
Marius> is done by simple regexes... but hopefully there are not other such nasty
Marius> surprises.)
Why don't you use 'unknown:.*\bb/c\b.*\bb\b.*\ba\b.*\bd\b' ?
i.e ensure that you match on the names 'a', 'c/b', 'b', 'a' and 'd'
That will reduce possible failures.
Vincent
More information about the bazaar
mailing list