[PATCH] Per-host remotecmd option in .hgrc

Matt Mackall mpm at selenic.com
Fri Sep 30 14:36:52 CDT 2011


On Thu, 2011-09-29 at 22:25 +0400, Dmitry Samersoff wrote:
> dsamersoff: Per-host remotecmd option in .hgrc (issue359)
> 
> Patch below allows user to setup per-host remotecmd in the .hgrc file
> in the form:
> 
> [ui]
> remotecmd = /opt/bin/hg
> remotecmd.mircat.net =/opt/csw/bin/hg

Well I can't think of a better solution short of adding a bunch of
per-host sections. Can I get you to send a version that amends
mercurial/help/config.txt?

> It tested for a year in development process and fully compatible with 
> default behavior.
> 
> 
> # HG changeset patch
> # User dsamersoff
> # Date 1317320091 -14400
> # Node ID 76a7aa83b528d4f08a4e64537f8be787ea805a74
> # Parent  8df4166b6f634b305934fdd49c0e0ae64184d4ed
> Enable per-host remotecmd
> 
> diff -r 8df4166b6f63 -r 76a7aa83b528 mercurial/sshrepo.py
> --- a/mercurial/sshrepo.py      Wed Sep 28 16:11:53 2011 -0500
> +++ b/mercurial/sshrepo.py      Thu Sep 29 22:14:51 2011 +0400
> @@ -35,7 +35,9 @@
>           self.path = u.path or "."
> 
>           sshcmd = self.ui.config("ui", "ssh", "ssh")
> -        remotecmd = self.ui.config("ui", "remotecmd", "hg")
> +        remotecmd = self.ui.config("ui", "remotecmd.%s" % self.host, None)
> +        if remotecmd == None :
> +           remotecmd = self.ui.config("ui", "remotecmd", "hg")
> 
>           args = util.sshargs(sshcmd, self.host, self.user, self.port)
> 
> 
> 


-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list