[PATCH] Per-host remotecmd option in .hgrc

Dmitry Samersoff dms at samersoff.net
Thu Sep 29 13:25:54 CDT 2011


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

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)



-- 
Dmitry Samersoff
dms at samersoff.net, http://devnull.samersoff.net
* There will come soft rains  ...


More information about the Mercurial-devel mailing list