Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
960:abfb5cc97fcd | 961:3e11d5038649 |
---|---|
924 else: | 924 else: |
925 ui.status("(run 'hg update' to get a working copy)\n") | 925 ui.status("(run 'hg update' to get a working copy)\n") |
926 | 926 |
927 return r | 927 return r |
928 | 928 |
929 def push(ui, repo, dest="default-push", force=False): | 929 def push(ui, repo, dest="default-push", force=False, ssh=None, remotecmd=None): |
930 """push changes to the specified destination""" | 930 """push changes to the specified destination""" |
931 dest = ui.expandpath(dest) | 931 dest = ui.expandpath(dest) |
932 ui.status('pushing to %s\n' % (dest)) | 932 ui.status('pushing to %s\n' % (dest)) |
933 | |
934 if ssh: | |
935 ui.setconfig("ui", "ssh", ssh) | |
936 if remotecmd: | |
937 ui.setconfig("ui", "remotecmd", remotecmd) | |
933 | 938 |
934 other = hg.repository(ui, dest) | 939 other = hg.repository(ui, dest) |
935 r = repo.push(other, force) | 940 r = repo.push(other, force) |
936 return r | 941 return r |
937 | 942 |
1337 (pull, | 1342 (pull, |
1338 [('u', 'update', None, 'update working directory')], | 1343 [('u', 'update', None, 'update working directory')], |
1339 'hg pull [-u] [SOURCE]'), | 1344 'hg pull [-u] [SOURCE]'), |
1340 "^push": | 1345 "^push": |
1341 (push, | 1346 (push, |
1342 [('f', 'force', None, 'force push')], | 1347 [('f', 'force', None, 'force push'), |
1348 ('e', 'ssh', "", 'ssh command'), | |
1349 ('', 'remotecmd', "", 'remote hg command')], | |
1343 'hg push [-f] [DEST]'), | 1350 'hg push [-f] [DEST]'), |
1344 "rawcommit": | 1351 "rawcommit": |
1345 (rawcommit, | 1352 (rawcommit, |
1346 [('p', 'parent', [], 'parent'), | 1353 [('p', 'parent', [], 'parent'), |
1347 ('d', 'date', "", 'date code'), | 1354 ('d', 'date', "", 'date code'), |