rebase: remove extra "if" from check of collapsing named branches
authorYuya Nishihara <yuya@tcha.org>
Sat, 05 Dec 2015 23:50:13 +0900
changeset 27261 986d04b9fedd
parent 27260 d755a9531fce
child 27262 3d0feb2f978b
rebase: remove extra "if" from check of collapsing named branches
hgext/rebase.py
--- a/hgext/rebase.py	Sat Dec 05 23:48:22 2015 +0900
+++ b/hgext/rebase.py	Sat Dec 05 23:50:13 2015 +0900
@@ -386,14 +386,13 @@
             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: