hgext/rebase.py
changeset 20250 f380b191e085
parent 20249 dc5157841361
child 20313 dcd65ce87260
--- a/hgext/rebase.py	Sun Nov 17 18:21:58 2013 -0500
+++ b/hgext/rebase.py	Sat Nov 16 15:46:29 2013 -0500
@@ -262,38 +262,32 @@
                         ui.status(_('nothing to rebase from %s to %s\n') %
                                   ('+'.join(str(repo[r]) for r in base), dest))
                     return 1
-            if rebaseset:
-                root = min(rebaseset)
-            else:
-                root = None
 
-            if not rebaseset:
-                repo.ui.debug('base is ancestor of destination\n')
-                result = None
-            elif (not (keepf or obsolete._enabled)
+            if (not (keepf or obsolete._enabled)
                   and repo.revs('first(children(%ld) - %ld)',
                                 rebaseset, rebaseset)):
                 raise util.Abort(
                     _("can't remove original changesets with"
                       " unrebased descendants"),
                     hint=_('use --keep to keep original changesets'))
-            else:
-                result = buildstate(repo, dest, rebaseset, collapsef)
 
+            result = buildstate(repo, dest, rebaseset, collapsef)
             if not result:
                 # Empty state built, nothing to rebase
                 ui.status(_('nothing to rebase\n'))
                 return 1
-            elif not keepf and not repo[root].mutable():
+
+            root = min(rebaseset)
+            if 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:
-                    targetancestors = repo.changelog.ancestors([target],
-                                                               inclusive=True)
-                    external = externalparent(repo, state, targetancestors)
+
+            originalwd, target, state = result
+            if collapsef:
+                targetancestors = repo.changelog.ancestors([target],
+                                                           inclusive=True)
+                external = externalparent(repo, state, targetancestors)
 
         if keepbranchesf:
             # insert _savebranch at the start of extrafns so if
@@ -308,7 +302,6 @@
                         raise util.Abort(_('cannot collapse multiple named '
                             'branches'))
 
-
         # Rebase
         if not targetancestors:
             targetancestors = repo.changelog.ancestors([target], inclusive=True)