evolve: store the replacements in the evolvestate
authorPulkit Goyal <7895pulkit@gmail.com>
Mon, 22 Jan 2018 18:18:11 +0530
changeset 3481 93bb36b4a666
parent 3480 1799fc777f30
child 3482 7f646d98858e
evolve: store the replacements in the evolvestate This will greatly help when we will be implementing `hg evolve --abort`.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Mon Jan 22 18:13:52 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Mon Jan 22 18:18:11 2018 +0530
@@ -1151,12 +1151,11 @@
 
     # For the progress bar to show
     count = len(revs)
-    replacements = {}
     # Order the revisions
     if targetcat == 'orphan':
         revs = _orderrevs(repo, revs)
 
-    stateopts = {'category': targetcat}
+    stateopts = {'category': targetcat, 'replacements': {}}
     evolvestate.addopts(stateopts)
     for rev in revs:
         curctx = repo[rev]
@@ -1165,6 +1164,6 @@
                         progresscb, targetcat)
         seen += 1
         if ret[0]:
-            replacements[curctx.node()] = [ret[1]]
+            evolvestate['replacements'][curctx.node()] = [ret[1]]
     progresscb()
     _cleanup(ui, repo, startnode, showprogress)