diff hgext/rebase.py @ 19059:53eadcb814fd

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.
author Siddharth Agarwal <sid0@fb.com>
date Thu, 18 Apr 2013 14:28:06 -0700
parents 42b620fc89e2
children 0250047a365e
line wrap: on
line diff
--- a/hgext/rebase.py	Wed Apr 10 19:27:49 2013 -0500
+++ b/hgext/rebase.py	Thu Apr 18 14:28:06 2013 -0700
@@ -209,10 +209,6 @@
                     _("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 @@
                 # 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: