changeset 3459:218fbcc3220c

evolve: store the replacements occurred during `hg evolve` at top level This patch starts storing the replacements made during the `hg evolve` command. The current dictionary is not used anywhere but will be used in future as we want to introduce abort functionality, so we want to delay writing of obsmarkers, storing these exchanges in statefile etc.
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 16 Jan 2018 17:14:32 +0530
parents 210132852a3d
children ada7fb453034
files hgext3rd/evolve/__init__.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/__init__.py	Sat Jan 27 16:13:19 2018 +0530
+++ b/hgext3rd/evolve/__init__.py	Tue Jan 16 17:14:32 2018 +0530
@@ -1620,14 +1620,18 @@
 
     # For the progress bar to show
     count = len(revs)
+    replacements = {}
     # Order the revisions
     if targetcat == 'orphan':
         revs = _orderrevs(repo, revs)
     for rev in revs:
+        curctx = repo[rev]
         progresscb()
-        _solveone(ui, repo, repo[rev], dryrunopt, confirmopt,
-                  progresscb, targetcat)
+        ret = _solveone(ui, repo, curctx, dryrunopt, confirmopt,
+                         progresscb, targetcat)
         seen += 1
+        if ret[0]:
+            replacements[curctx.node()] = [ret[1]]
     progresscb()
     _cleanup(ui, repo, startnode, showprogress)