Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 818:eef752151556
Actually implement the -f switch for push
author | mpm@selenic.com |
---|---|
date | Mon, 01 Aug 2005 23:34:23 -0800 |
parents | 5a55e3011772 |
children | 0932bc2fb2be b65773f7db41 0fc4b1ab57e3 |
comparison
equal
deleted
inserted
replaced
817:cf1d9a01dd92 | 818:eef752151556 |
---|---|
817 else: | 817 else: |
818 ui.status("(run 'hg update' to get a working copy)\n") | 818 ui.status("(run 'hg update' to get a working copy)\n") |
819 | 819 |
820 return r | 820 return r |
821 | 821 |
822 def push(ui, repo, dest="default-push"): | 822 def push(ui, repo, dest="default-push", force=False): |
823 """push changes to the specified destination""" | 823 """push changes to the specified destination""" |
824 dest = ui.expandpath(dest) | 824 dest = ui.expandpath(dest) |
825 ui.status('pushing to %s\n' % (dest)) | 825 ui.status('pushing to %s\n' % (dest)) |
826 | 826 |
827 other = hg.repository(ui, dest) | 827 other = hg.repository(ui, dest) |
828 r = repo.push(other) | 828 r = repo.push(other, force) |
829 return r | 829 return r |
830 | 830 |
831 def rawcommit(ui, repo, *flist, **rc): | 831 def rawcommit(ui, repo, *flist, **rc): |
832 "raw commit interface" | 832 "raw commit interface" |
833 if rc['text']: | 833 if rc['text']: |
1201 "paths": (paths, [], 'hg paths [name]'), | 1201 "paths": (paths, [], 'hg paths [name]'), |
1202 "^pull": | 1202 "^pull": |
1203 (pull, | 1203 (pull, |
1204 [('u', 'update', None, 'update working directory')], | 1204 [('u', 'update', None, 'update working directory')], |
1205 'hg pull [-u] [SOURCE]'), | 1205 'hg pull [-u] [SOURCE]'), |
1206 "^push": (push, [], 'hg push [DEST]'), | 1206 "^push": |
1207 (push, | |
1208 [('f', 'force', None, 'force push')], | |
1209 'hg push [DEST]'), | |
1207 "rawcommit": | 1210 "rawcommit": |
1208 (rawcommit, | 1211 (rawcommit, |
1209 [('p', 'parent', [], 'parent'), | 1212 [('p', 'parent', [], 'parent'), |
1210 ('d', 'date', "", 'date code'), | 1213 ('d', 'date', "", 'date code'), |
1211 ('u', 'user', "", 'user'), | 1214 ('u', 'user', "", 'user'), |