# HG changeset patch # User Matt Mackall # Date 2014-12-29 22:39:20 # Node ID 14ac0c1579cdc55763facfc81e8abffc63464c5f # Parent 5edb387158a137f7c447c9bbccfc834c833a2de8 # Parent e3f30068d2ebdeb549ea0cd9fec76df2e6ef40bb merge with stable diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py --- a/mercurial/sshpeer.py +++ b/mercurial/sshpeer.py @@ -20,6 +20,8 @@ class remotelock(object): 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 @@ class sshpeer(wireproto.wirepeer): 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,