Add --ssh and --remotecmd to push
This uses the new setconfig options passing mechanism
--- a/mercurial/commands.py Fri Aug 19 21:25:25 2005 -0800
+++ b/mercurial/commands.py Fri Aug 19 21:36:57 2005 -0800
@@ -926,11 +926,16 @@
return r
-def push(ui, repo, dest="default-push", force=False):
+def push(ui, repo, dest="default-push", force=False, ssh=None, remotecmd=None):
"""push changes to the specified destination"""
dest = ui.expandpath(dest)
ui.status('pushing to %s\n' % (dest))
+ if ssh:
+ ui.setconfig("ui", "ssh", ssh)
+ if remotecmd:
+ ui.setconfig("ui", "remotecmd", remotecmd)
+
other = hg.repository(ui, dest)
r = repo.push(other, force)
return r
@@ -1339,7 +1344,9 @@
'hg pull [-u] [SOURCE]'),
"^push":
(push,
- [('f', 'force', None, 'force push')],
+ [('f', 'force', None, 'force push'),
+ ('e', 'ssh', "", 'ssh command'),
+ ('', 'remotecmd', "", 'remote hg command')],
'hg push [-f] [DEST]'),
"rawcommit":
(rawcommit,
--- a/mercurial/hg.py Fri Aug 19 21:25:25 2005 -0800
+++ b/mercurial/hg.py Fri Aug 19 21:36:57 2005 -0800
@@ -2106,8 +2106,10 @@
if not path:
raise RepoError("no remote repository path specified")
- cmd = "ssh %s 'hg -R %s serve --stdio'"
- cmd = cmd % (args, path)
+ sshcmd = self.ui.config("ui", "ssh", "ssh")
+ remotecmd = self.ui.config("ui", "remotecmd", "hg")
+ cmd = "%s %s '%s -R %s serve --stdio'"
+ cmd = cmd % (sshcmd, args, remotecmd, path)
self.pipeo, self.pipei, self.pipee = os.popen3(cmd)