changeset 371:240573913439

Create ssh subprocess with a shell command instead of an exec list This allows ui.ssh to be configured with a command line fragment instead of just the name of an executable.
author Mads Kiilerich <mads@kiilerich.com>
date Sat, 25 Dec 2010 23:49:16 +0100
parents 37a06b903df6
children 663973c89351
files hggit/_ssh.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/_ssh.py
+++ b/hggit/_ssh.py
@@ -1,3 +1,5 @@
+from mercurial import util
+
 class SSHVendor(object):
     """Parent class for ui-linked Vendor classes."""
 
@@ -16,8 +18,11 @@
 
             sshcmd = ui.config("ui", "ssh", "ssh")
             args = util.sshargs(sshcmd, host, username, port)
-
-            proc = subprocess.Popen([sshcmd, args] + command,
+            cmd = '%s %s %s' % (sshcmd, args, 
+                                util.shellquote(' '.join(command)))
+            ui.debug('calling ssh: %s\n' % cmd)
+            print command
+            proc = subprocess.Popen(util.quotecommand(cmd), shell=True,
                                     stdin=subprocess.PIPE,
                                     stdout=subprocess.PIPE)
             return SubprocessWrapper(proc)