[Bug 425510] Re: 'bzr mv' should do wildcard expansion on windows

Maritza Mendez martitzam at gmail.com
Wed Sep 9 08:03:13 BST 2009


I have made a one-line fix for this bug
(https://bugs.launchpad.net/bugs/425510<https://bugs.launchpad.net/bugs/425510>)
and a similar one-line fix for
https://bugs.launchpad.net/bugs/426410<https://bugs.launchpad.net/bugs/425510>)
in a private branch.  In each case it is a simple matter of invoking
Commnd._maybe_expand_globs() on the file arguments although in the case of
'bzr mv' I am not sure I've thought enough about clever side effects.
(Ultimately I decided not to protect the user and just go ahead and expand
blindly just like bash would.

So I went looking for some tests.  It appears to me that the blackbox tests
generally do not include tests for globbing, which I guess would explain how
these issues could exist.  Is there actually a policy of keeping the tests
"clean" of wildcards, or is this only an oversight?

Second question: for two "simple" bugs of essentially the same type is it
necessary to submit two separate patches?

I'm not sure when I'll have time to write the tests and get patches,
especially since that will take longer than the fixes did!  So if anyone
wants to claim these fixes for themself, I'd be happy with that.

Also, I am honestly not very comfortable with these ad hoc fixes for 'bzr
mv' and 'bzr rm'.  I did them because I need them now.  But it really seems
like the Right Thing To Do would be a high-level glob expansion which
applies a consistent policy for all input so that bzrlib would never have to
deal with platform-dependent shells and all new commands would automatically
work for all platforms.

Thanks
~M



On Mon, Sep 7, 2009 at 1:14 AM, Martin Pool <mbp at sourcefrog.net> wrote:

> ** Tags added: easy
>
> --
> 'bzr mv' should do wildcard expansion on windows
> https://bugs.launchpad.net/bugs/425510
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Bazaar Version Control System: Confirmed
>
> Bug description:
> Using bzr 1.18...
>
> The behavior of 'bzr mv' with wildcards is broken on Windows:
>
> C:\>mkdir t
> C:\>cd t
> C:\t>bzr init
> Created a standalone tree (format: pack-0.92)
> C:\t>echo > cat.txt
> C:\t>echo > dog.txt
> C:\t>mkdir pets
> C:\t>bzr add *.txt
> adding cat.txt
> adding dog.txt
> C:\t>bzr add pets
> adding pets
> C:\t>bzr mv *.txt .\pets
> bzr: ERROR: Could not move *.txt => pets: *.txt is not versioned.
>
> You see that 'bzr mv' seems to have a problem with the wildcard.
> Notice that above 'bzr add' did not have a problem with wildcard.
>
> C:\t>bzr mv cat.txt .\pets
> cat.txt => pets/cat.txt
> C:\t>bzr mv dog.txt .\pets
> dog.txt => pets/dog.txt
>
> Imagine having 100 files to move.  The user has to choose between either
> 'bzr mv' 100 times which preserves history or deleting and readding which
> destroys history but works with wildcarding.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20090909/5fd613ae/attachment-0002.htm 


More information about the bazaar mailing list