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

Maritza Mendez martitzam at gmail.com
Wed Sep 9 21:26:43 BST 2009


On Wed, Sep 9, 2009 at 7:13 AM, John Arbash Meinel
<john at arbash-meinel.com>wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Vincent Ladeuil wrote:
> >>>>>> "martin" == Martin Pool <mbp at canonical.com> writes:
> >
> > <snip/>
> >
> >     martin> Perhaps a better way to tackle this is for the
> >     martin> declaration of the argument pattern taken by the
> >     martin> command to declare which arguments will be subject to
> >     martin> expansion?
> >
> > +1
> >
> >         Vincent
> >
> >
>
> So there is actually a way to get access to the original command line
> string that was passed. If you look at:
>  bzrlib.win32utils.get_unicode_argv
>
> it does:
>  pargv = CommandLineToArgv(GetCommandLine(), ctypes.byref(c))
>
> GetCommandLine() gives you the raw Unicode string as supplied by the
> caller. Which means that it has all the quoting characters, etc.
>
> So we could simply replace "CommandLineToArgv()" with a function that
> was more 'Unixy'.
>
> I only realized recently that GetCommandLine() existed, and gave you the
> fully quoted text.
>
> It is a little bit tricky, but you can play around with it with:
>
> python -c "from ctypes import *;" \
>  "f = windll.kernel32.GetCommandLineW"\
>  "GetCommandLine = WINFUNCTYPE(c_wchar_p)(f)"\
>  "print repr(GetCommandLine())"
>
> You can add extra arguments, etc. Note that it also indicates that when
> running under 'python' we will need to be careful to strip off the
> arguments to python which are separate from the arguments to our
> function. (We already do some of that in get_unicode_arg()).
>
> Also for *me personally* I actually run under Cygwin as my shell,
> running the native Win32 client. Which means my shell will do the
> automatic expansion and interpretation of "" and '', which means things
> will probably break for me. But we certainly could do it.
>
> John
> =:->
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (Cygwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkqnuA8ACgkQJdeBCYSNAAM7mgCgmXFcldsxv/Seu3GOCopflxmi
> YcYAoIIHFDllgEYeqQWsrkWI2xZXIhxi
> =hHKj
> -----END PGP SIGNATURE-----
>
>
Wow.  I need to be mroe careful bring things up on the list.  I didn;t
expect this much discussion, although I must say I'm learning a lot from
it.  :)  I would use Cygwin, too, to get a bash shell but I don't think
you're suggesting packaging this with bzr, right?

By the way, although I may seem pro-Windows, I'm really just an advocate for
seeing bzr used on Windows.  So for example I think it would be completely
reasonable for bzr users on Windows to have to learn peculiar syntax rules
for bzr, so long as those rules are consistent across platforms.  That's the
idea of providing a thin layer between the command line and bzrlib.  I
realize that I may hold the minority opinion on this, but I offer this just
to show that I am not completely brainwashed into thinking that every tool
should cow-tow to Windows.

~M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20090909/4fd07d42/attachment-0002.htm 


More information about the bazaar mailing list