evolve: don't make values of replacements dict lists
authorPulkit Goyal <7895pulkit@gmail.com>
Wed, 23 May 2018 02:39:38 +0530
changeset 3753 a558c8adc5af
parent 3752 6878d708500a
child 3754 73ee40cbfb53
evolve: don't make values of replacements dict lists There was inconsistency in code base related to the values stored in replacements dict in evolvestate. At some places we store a list, at some places we just store the nodeid. Let's make sure we store only the nodeid, not a list. If there are cases, when there are multiple replacements or changesets created during resolution, later patch will introduce storing temprevs in evolvestate which should be used.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Wed May 23 02:41:08 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Wed May 23 02:39:38 2018 +0530
@@ -1282,7 +1282,7 @@
                             progresscb, targetcat)
             seen += 1
             if ret[0]:
-                evolvestate['replacements'][curctx.node()] = [ret[1]]
+                evolvestate['replacements'][curctx.node()] = ret[1]
             else:
                 evolvestate['skippedrevs'].append(curctx.node())
 
@@ -1292,7 +1292,7 @@
                 ret = _solveone(ui, repo, repo[ret[1]], evolvestate, dryrunopt,
                                 confirmopt, progresscb, targetcat)
                 if ret[0]:
-                    evolvestate['replacements'][curctx.node()] = [ret[1]]
+                    evolvestate['replacements'][curctx.node()] = ret[1]
                 else:
                     evolvestate['skippedrevs'].append(curctx.node())
 
@@ -1310,7 +1310,7 @@
         cleanup = True
         startnode = evolvestate['startnode']
         for old, new in evolvestate['replacements'].iteritems():
-            evolvedctx.append(repo[new[0]])
+            evolvedctx.append(repo[new])
         evolvedrevs = [c.rev() for c in evolvedctx]
 
         # checking if phase changed of any of the evolved rev