[PATCH 2 of 2] rebase: remove extra "if" from check of collapsing named branches

Yuya Nishihara yuya at tcha.org
Sun Dec 6 09:24:25 CST 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1449327013 -32400
#      Sat Dec 05 23:50:13 2015 +0900
# Node ID da2eec44aafba17f62f559f451fed18b95a971a6
# Parent  0b93ef8a1c3e8f9394776ecada576fb608162dc3
rebase: remove extra "if" from check of collapsing named branches

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -386,14 +386,13 @@ def rebase(ui, repo, **opts):
             if dest.closesbranch() and not keepbranchesf:
                 ui.status(_('reopening closed branch head %s\n') % dest)
 
-        if keepbranchesf:
-            if collapsef:
-                branches = set()
-                for rev in state:
-                    branches.add(repo[rev].branch())
-                    if len(branches) > 1:
-                        raise error.Abort(_('cannot collapse multiple named '
-                            'branches'))
+        if keepbranchesf and collapsef:
+            branches = set()
+            for rev in state:
+                branches.add(repo[rev].branch())
+                if len(branches) > 1:
+                    raise error.Abort(_('cannot collapse multiple named '
+                                        'branches'))
 
         # Rebase
         if not targetancestors:


More information about the Mercurial-devel mailing list