diff mercurial/commands.py @ 961:3e11d5038649

Add --ssh and --remotecmd to push This uses the new setconfig options passing mechanism
author mpm@selenic.com
date Fri, 19 Aug 2005 21:36:57 -0800
parents 307ca8ca234f
children 84355e3e4493
line wrap: on
line diff
--- 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,