I rewrote the Repo.shell function to call commands with an argument list instead of using the shell. This automatically handles escaping (so the quotes + spaces escaping is no longer a problem, at least not on Windows), and fixes wib log on Windows. It also neatens up some of the code, since concatenating filenames and command strings is no longer required. I've renamed shell to call to better mirror the subprocess API given that the function no longer uses the shell.
I haven't figured out how to pipe into less, so the only thing that this pull request should break is hg log | less, which has been replaced by hg log. There's a way around it, I'm just unsure what. (Possibly paginating from Python is neater than using less, but I'm not sure about that either.)
I haven't tested this on hg, as I have neither Mercurial nor any Mercurial repositories...
I rewrote the
Repo.shell
function to call commands with an argument list instead of using the shell. This automatically handles escaping (so the quotes + spaces escaping is no longer a problem, at least not on Windows), and fixeswib log
on Windows. It also neatens up some of the code, since concatenating filenames and command strings is no longer required. I've renamedshell
tocall
to better mirror thesubprocess
API given that the function no longer uses the shell.I haven't figured out how to pipe into
less
, so the only thing that this pull request should break ishg log | less
, which has been replaced byhg log
. There's a way around it, I'm just unsure what. (Possibly paginating from Python is neater than usingless
, but I'm not sure about that either.)I haven't tested this on
hg
, as I have neither Mercurial nor any Mercurial repositories...