[PATCH windows rfc] dummyssh: just use execvp() to replace ourselves instead of os.system()

Yuya Nishihara yuya at tcha.org
Tue May 2 22:50:21 EDT 2017


On Tue, 2 May 2017 22:00:45 -0400, Augie Fackler wrote:
> I have no idea if this is a good patch or not, but it looks like it ought to helming out with some windows weirdness. :)

> > -if os.name == 'nt':
> > -    # hack to make simple unix single quote quoting work on windows
> > -    hgcmd = hgcmd.replace("'", '"')
> > -r = os.system(hgcmd)
> > -sys.exit(bool(r))
> > +args = shlex.split(hgcmd)
> > +os.execvp("hg", args)

No idea whether this is good or bad, but Windows has no POSIX fork & exec
semantics, so Windows execvp() wouldn't be what we want.


More information about the Mercurial-devel mailing list