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

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Sep 10 10:13:49 BST 2009


>>>>> "Maritza" == Maritza Mendez <martitzam at gmail.com> writes:

<snip/>

    Maritza> I have not added any tests but I have verified
    Maritza> expected operation on both windows and linux.

You certainly did that by typing bzr commands and a couple of
shell ones to check the results.

Can you show me ?

I'm working on shell-like tests and would be immensely interested
in addressing your needs here.

Since the topic is also related to quote handling, I mention that
I had to redefine shlex.split() for the needs of these shell-like
texts and it's as easy as:

def split(s):
    """Split a command line respecting quotes."""
    scanner = shlex.shlex(s)
    scanner.quotes = '\'"`'
    scanner.whitespace_split = True
    for t in list(scanner):
        # Strip the simple and double quotes since we don't care about them.
        # We leave the backquotes in place though since they have a different
        # semantic.
        if t[0] in  ('"', "'") and t[0] == t[-1]:
            yield t[1:-1]
        else:
            yield t

Adding glob expansion there, shouldn't be that hard either.

       Vincent



More information about the bazaar mailing list