# HG changeset patch # User mpm@selenic.com # Date 1124516217 28800 # Node ID 3e11d50386490be64ed7b4c6c702a7de54d49dd8 # Parent abfb5cc97fcd8c08e2149171fc7d67634015a53f Add --ssh and --remotecmd to push This uses the new setconfig options passing mechanism diff -r abfb5cc97fcd -r 3e11d5038649 mercurial/commands.py --- 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, diff -r abfb5cc97fcd -r 3e11d5038649 mercurial/hg.py --- 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)