[PATCH] win32: fix ssh://host:port when using Plink

Steve Borho steve at borho.org
Wed Dec 12 17:21:26 CST 2007


On Wed, 2007-12-12 at 17:10 -0600, Steve Borho wrote:
> # HG changeset patch
> # User Steve Borho <steve at borho.org>
> # Date 1197499466 21600
> # Node ID b6ab8be29d43c181d3ffa3a64c8ea537549b81ce
> # Parent  6a8233c9abca666559fca0acd143356c2901bcd2
> win32: fix ssh://host:port when using Plink
> 
> Moves ssh argument building to platform specific utils code.
> The win32 version looks for plink in ssh command string and
> uses '-P' in lieu of '-p' for specifying a port
> 
> diff --git a/mercurial/sshrepo.py b/mercurial/sshrepo.py
> --- a/mercurial/sshrepo.py
> +++ b/mercurial/sshrepo.py
> @@ -24,11 +24,10 @@ class sshrepository(remoterepository):
>          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

I just realized this code I copy-pasted already had a typo in it.  I'll
post a new patch that fixes both new occurances of this line to (~):

           args = self.port and ("%s -p %s" % (args, self.port)) or args

How amusing that both syntaxes worked.

-- 
Steve Borho (steve at borho.org)
http://www.borho.org/~steve/steve.asc
Key fingerprint = 2D08 E7CF B624 624C DE1F  E2E4 B0C2 5292 F2C6 2C8C



More information about the Mercurial-devel mailing list