chengsoonong / wib

A common interface to both git and hg
GNU General Public License v3.0
3 stars 2 forks source link

Rewrote Repo.shell to use argument lists instead of shell=True #9

Closed MatthewJA closed 7 years ago

MatthewJA commented 7 years ago

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...