# HG changeset patch # User Siddharth Agarwal # Date 2013-04-18 21:28:06 # Node ID 53eadcb814fd9d3a8db3117366999be5b0318cac # Parent d8d548d868d3ad6eb0d43ed48c9762dde1fe2657 rebase: check no-op before checking phase (issue3891) This could lead to user confusion, because phases aren't really involved at all when attempting to perform a no-op rebase. diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -209,10 +209,6 @@ def rebase(ui, repo, **opts): _("can't remove original changesets with" " unrebased descendants"), hint=_('use --keep to keep original changesets')) - elif not keepf and not repo[root].mutable(): - raise util.Abort(_("can't rebase immutable changeset %s") - % repo[root], - hint=_('see hg help phases for details')) else: result = buildstate(repo, dest, rebaseset, collapsef) @@ -220,6 +216,10 @@ def rebase(ui, repo, **opts): # Empty state built, nothing to rebase ui.status(_('nothing to rebase\n')) return 1 + elif not keepf and not repo[root].mutable(): + raise util.Abort(_("can't rebase immutable changeset %s") + % repo[root], + hint=_('see hg help phases for details')) else: originalwd, target, state = result if collapsef: diff --git a/tests/test-rebase-scenario-global.t b/tests/test-rebase-scenario-global.t --- a/tests/test-rebase-scenario-global.t +++ b/tests/test-rebase-scenario-global.t @@ -276,6 +276,9 @@ C onto A - rebase onto an ancestor: Check rebasing public changeset $ hg pull --config phases.publish=True -q -r 6 . # update phase of 6 + $ hg rebase -d 0 -b 6 + nothing to rebase + [1] $ hg rebase -d 5 -b 6 abort: can't rebase immutable changeset e1c4361dd923 (see hg help phases for details)