[PATCH] ssh: use shlex to parse command line

Steve Borho steve at borho.org
Sun Sep 9 19:37:57 CDT 2007


On Sun, 2007-09-09 at 15:55 -0300, Alexis S. L. Carvalho wrote:
> Thus spake Patrick Mézard:
> > Steve Borho a écrit :
> > >... which looks pretty good.  It seems os.popen3() is successfully
> > >parsing the ssh command name, but the rest of the argument parsing
> > >(probably a function of the windows shell) is broken.
> > 
> > What about the attached patch (against crew-stable) ?
> > 
> > Tests pass under windows and macosx but they do not exercize it very 
> > much and it's hard to build one not looking too kludgy. I think quoting 
> > all arguments should be harmless under unix but I may be wrong.
> > 
> 
> One alternative that wouldn't require shlex would be to just add some
> util.quotecommand function that adds the extra quotes on windows.  From
> the user POV, he'd use the same syntax from the [hooks] section (i.e.
> system-specific quoting instead of shlex quoting).  Somthing like this:

I haven't had a chance to try this on Windows, but the shlex part is
probably redundant if there's no intention to ever pass an argument list
to popen*().

-- 
Steve Borho <steve at borho.org>



More information about the Mercurial-devel mailing list