Issue359

Title Per-host remotecmd option in .hgrc
Priority wish Status chatting
Superseder Nosy List ThomasAH, djc, dov, nwf
Assigned To Topics patch, ssh_proto, ui

Created on 2006-09-06.13:10:36 by nwf, last changed 2008-08-04.17:28:26 by ThomasAH.

Files
File name Uploaded Type Edit Remove
per-host-remotecmd nwf, 2007-04-12.15:11:46 text/x-diff
Messages
msg6704 (view) Author: ThomasAH Date: 2008-08-04.17:28:26
djc, I don't think we have this yet
msg6701 (view) Author: djc Date: 2008-08-04.16:26:39
I seem to recall we have this by now. Need to check.
msg2989 (view) Author: nwf Date: 2007-04-12.15:11:46
Here's a new version of the patch, which is basically just a migration to the 
right location of the one below.
msg2987 (view) Author: ThomasAH Date: 2007-04-11.19:44:54
Yes, your missing something obvious: I didn't use my brain :)

I thought you were asking for different ssh commands (most often asked for to
give ssh options), not different remote hg calls.

While there is the possibility to fix many things using .bashrc (or whatever
shell's login script), but often it is not desired to change things on the
remote side.

I guess the best thing (next to providing a patch :)) would be to talk about
this issue in #mercurial on freenode or to talk on the mailing list about this.
msg2985 (view) Author: nwf Date: 2007-04-11.18:09:57
That's fine, but how do I set the command per host?

So I have Machine1 which is normal and responds fine to "hg" as remotecmd... 
and Machine2 which is... shall we say strange, for reasons I do not control, 
and works optimally with a wrapper program "hgwrap" (which sets paths, which 
are not loaded on login.  As I said, weird machine).

I want "remotecmd.machine2 = hgwrap" in my ~/.hgrc so that the normal machines 
still stay normal.

I apologize profusely if I'm missing something obvious.
msg2983 (view) Author: ThomasAH Date: 2007-04-11.05:57:37
Why not?
You can have many "Host" sections in your .ssh/config, even if they all have the
same User and HostName set.
msg2981 (view) Author: nwf Date: 2007-04-11.00:17:31
While I appreciate the suggestion, this doesn't (seem to) help for machines I 
don't control, where I only have one login?
msg1901 (view) Author: ThomasAH Date: 2006-09-07.20:41:34
You know that you can specify many options in your ~/.ssh/config?

For example I use this:
 Host hg hg.intevation.org
 User hg
 HostName hg.intevation.org
 IdentityFile ~/.ssh/id_dsa_hg
 IdentitiesOnly yes

So whenever I access the host "hg" or "hg.intevation.org" the real hostname used
is "hg.intevation.org" with the other options specified there.
msg1870 (view) Author: nwf Date: 2006-09-06.13:10:35
I would like to be able to specify per-remote-host remotecmd options in my 
~/.hgrc file.  The diff to enable this is simple and small:

diff -r 5e39ad2c8b52 mercurial/sshrepo.py
--- a/mercurial/sshrepo.py	Tue Jun 27 01:41:07 2006 +0300
+++ b/mercurial/sshrepo.py	Wed Sep 06 09:10:34 2006 -0400
@@ -30,6 +30,7 @@ class sshrepository(remoterepository):
 
         sshcmd = self.ui.config("ui", "ssh", "ssh")
         remotecmd = self.ui.config("ui", "remotecmd", "hg")
+        remotecmd = self.ui.config("ui", "remotecmd.%s" % self.host, 
remotecmd);
 
         if create:
             try:


Other options, such as per-host&port may also be desirable?
History
Date User Action Args
2008-08-04 17:28:26ThomasAHsetnosy: ThomasAH, nwf, dov, djc
messages: + msg6704
2008-08-04 16:26:39djcsetnosy: + djc
messages: + msg6701
2008-02-12 12:00:24djcsettopic: + patch
nosy: ThomasAH, nwf, dov
2008-01-15 16:38:37dovsetnosy: + dov
2007-04-12 15:11:46nwfsetfiles: + per-host-remotecmd
nosy: ThomasAH, nwf
messages: + msg2989
2007-04-11 19:44:54ThomasAHsetnosy: ThomasAH, nwf
messages: + msg2987
2007-04-11 18:09:58nwfsetnosy: ThomasAH, nwf
messages: + msg2985
2007-04-11 05:57:37ThomasAHsetnosy: ThomasAH, nwf
messages: + msg2983
2007-04-11 00:17:32nwfsetnosy: ThomasAH, nwf
messages: + msg2981
2006-09-07 20:41:36ThomasAHsetstatus: unread -> chatting
nosy: + ThomasAH
messages: + msg1901
2006-09-06 13:10:36nwfcreate