evolve: move if-else block under the right block
authorPulkit Goyal <7895pulkit@gmail.com>
Wed, 06 Jun 2018 01:19:36 +0530
changeset 3800 21914530c21c
parent 3799 037ccbf41c6d
child 3801 ee78135b2f45
evolve: move if-else block under the right block the index related if-else should be only executed when all three base, divergent and other have different branch names. I coded this last night and mistakenly mis-indented it. Caught when I was adding more tests.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Tue Jun 05 22:02:24 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Wed Jun 06 01:19:36 2018 +0530
@@ -477,12 +477,13 @@
                                           "%s or (b) %s or (c) %s? $$ &a $$ &b"
                                           " $$ &c") %
                                         (basebranch, divbranch, othbranch), 0)
-            if index == 0:
-                repo.dirstate.setbranch(basebranch)
-            elif index == 1:
-                pass
-            elif index == 2:
-                repo.dirstate.setbranch(othbranch)
+
+                if index == 0:
+                    repo.dirstate.setbranch(basebranch)
+                elif index == 1:
+                    pass
+                elif index == 2:
+                    repo.dirstate.setbranch(othbranch)
 
         # new node if any formed as the replacement
         newnode = None