Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 20184:a14d93b2fb1b
bookmarks: allow push -B to create a new remote head (issue2372)
Push is currently allowed to create a new head if there is a remote
bookmark that will be updated to point to the new head. If the
bookmark is not known remotely then push aborts, even if a -B argument
is about to push the bookmark. This change allows push to continue in
this case. This does not require a wireproto force.
author | Stephen Lee <sphen.lee@gmail.com> |
---|---|
date | Mon, 11 Nov 2013 21:16:54 +1100 |
parents | 04036798ebed |
children | cbe2bcc927cd |
comparison
equal
deleted
inserted
replaced
20183:de7e6c489412 | 20184:a14d93b2fb1b |
---|---|
4675 | 4675 |
4676 Returns 0 if push was successful, 1 if nothing to push. | 4676 Returns 0 if push was successful, 1 if nothing to push. |
4677 """ | 4677 """ |
4678 | 4678 |
4679 if opts.get('bookmark'): | 4679 if opts.get('bookmark'): |
4680 ui.setconfig('bookmarks', 'pushing', opts['bookmark']) | |
4680 for b in opts['bookmark']: | 4681 for b in opts['bookmark']: |
4681 # translate -B options to -r so changesets get pushed | 4682 # translate -B options to -r so changesets get pushed |
4682 if b in repo._bookmarks: | 4683 if b in repo._bookmarks: |
4683 opts.setdefault('rev', []).append(b) | 4684 opts.setdefault('rev', []).append(b) |
4684 else: | 4685 else: |