evolve: load evolvestate before passing to continueevolve()
authorPulkit Goyal <7895pulkit@gmail.com>
Fri, 16 Mar 2018 16:04:28 +0530
changeset 3556 b0438c9101ad
parent 3555 60e132e20b14
child 3557 77a400149758
evolve: load evolvestate before passing to continueevolve() This patch moves some code from continueevolve() to evolve() function so that we have a loaded evolvestate present in the evolve() function for post processing.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Fri Mar 16 15:56:05 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Fri Mar 16 16:04:28 2018 +0530
@@ -1126,6 +1126,9 @@
     evolvestate = state.cmdstate(repo)
     # Continuation handling
     if contopt:
+        if not evolvestate:
+            raise error.Abort('no evolve to continue')
+        evolvestate.load()
         return continueevolve(ui, repo, evolvestate, progresscb)
 
     else:
@@ -1162,9 +1165,6 @@
 
 def continueevolve(ui, repo, evolvestate, progresscb):
     """logic for handling of `hg evolve --continue`"""
-    if not evolvestate:
-        raise error.Abort('no evolve to continue')
-    evolvestate.load()
     orig = repo[evolvestate['current']]
     with repo.wlock(), repo.lock():
         ctx = orig