mercurial/sshrepo.py
changeset 5644 e2e8e977a6cb
parent 5293 32ec518ee3cb
child 5893 87e6b4f4871b
--- a/mercurial/sshrepo.py	Mon Dec 10 22:41:18 2007 +0100
+++ b/mercurial/sshrepo.py	Wed Dec 12 16:44:26 2007 -0600
@@ -24,12 +24,11 @@
         self.port = m.group(5)
         self.path = m.group(7) or "."
 
-        args = self.user and ("%s@%s" % (self.user, self.host)) or self.host
-        args = self.port and ("%s -p %s") % (args, self.port) or args
-
         sshcmd = self.ui.config("ui", "ssh", "ssh")
         remotecmd = self.ui.config("ui", "remotecmd", "hg")
 
+        args = util.sshargs(sshcmd, self.host, self.user, self.port)
+
         if create:
             cmd = '%s %s "%s init %s"'
             cmd = cmd % (sshcmd, args, remotecmd, self.path)