merge with stable
authorMatt Mackall <mpm@selenic.com>
Mon, 29 Dec 2014 16:39:20 -0600
changeset 23684 14ac0c1579cd
parent 23683 5edb387158a1 (current diff)
parent 23671 e3f30068d2eb (diff)
child 23685 5b1eac343ccd
merge with stable
mercurial/sshpeer.py
--- a/mercurial/sshpeer.py	Thu Dec 25 23:33:26 2014 +0900
+++ b/mercurial/sshpeer.py	Mon Dec 29 16:39:20 2014 -0600
@@ -20,6 +20,8 @@
             self.release()
 
 def _serverquote(s):
+    if not s:
+        return s
     '''quote a string for the remote shell ... which we assume is sh'''
     if re.match('[a-zA-Z0-9@%_+=:,./-]*$', s):
         return s
@@ -45,7 +47,10 @@
         sshcmd = self.ui.config("ui", "ssh", "ssh")
         remotecmd = self.ui.config("ui", "remotecmd", "hg")
 
-        args = util.sshargs(sshcmd, self.host, self.user, self.port)
+        args = util.sshargs(sshcmd,
+                            _serverquote(self.host),
+                            _serverquote(self.user),
+                            _serverquote(self.port))
 
         if create:
             cmd = '%s %s %s' % (sshcmd, args,