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.
--- 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