Mercurial > hg
comparison hgext/rebase.py @ 16228:5b41d5ad52bf stable
rebase: move bookmarks as needed with pull --rebase (issue3285)
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 04 Mar 2012 17:12:12 -0600 |
parents | cd42f77d30c4 |
children | 0806823370d8 |
comparison
equal
deleted
inserted
replaced
16226:674ecd23c42c | 16228:5b41d5ad52bf |
---|---|
626 if opts.get('update'): | 626 if opts.get('update'): |
627 del opts['update'] | 627 del opts['update'] |
628 ui.debug('--update and --rebase are not compatible, ignoring ' | 628 ui.debug('--update and --rebase are not compatible, ignoring ' |
629 'the update flag\n') | 629 'the update flag\n') |
630 | 630 |
631 movemarkfrom = repo['.'].node() | |
631 cmdutil.bailifchanged(repo) | 632 cmdutil.bailifchanged(repo) |
632 revsprepull = len(repo) | 633 revsprepull = len(repo) |
633 origpostincoming = commands.postincoming | 634 origpostincoming = commands.postincoming |
634 def _dummy(*args, **kwargs): | 635 def _dummy(*args, **kwargs): |
635 pass | 636 pass |
644 branch = repo[None].branch() | 645 branch = repo[None].branch() |
645 dest = repo[branch].rev() | 646 dest = repo[branch].rev() |
646 if dest != repo['.'].rev(): | 647 if dest != repo['.'].rev(): |
647 # there was nothing to rebase we force an update | 648 # there was nothing to rebase we force an update |
648 hg.update(repo, dest) | 649 hg.update(repo, dest) |
650 if bookmarks.update(repo, [movemarkfrom], repo['.'].node()): | |
651 ui.status(_("updating bookmark %s\n") | |
652 % repo._bookmarkcurrent) | |
649 else: | 653 else: |
650 if opts.get('tool'): | 654 if opts.get('tool'): |
651 raise util.Abort(_('--tool can only be used with --rebase')) | 655 raise util.Abort(_('--tool can only be used with --rebase')) |
652 orig(ui, repo, *args, **opts) | 656 orig(ui, repo, *args, **opts) |
653 | 657 |