evolve: factor out logic for --stop flag in separate function
This will make code clean
--- a/hgext3rd/evolve/evolvecmd.py Sun Jun 10 22:38:08 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py Sun Jun 10 22:42:57 2018 +0530
@@ -1405,10 +1405,7 @@
if not evolvestate:
raise error.Abort(_('no interrupted evolve to stop'))
evolvestate.load()
- pctx = repo['.']
- hg.updaterepo(repo, pctx.node(), True)
- ui.status(_('stopped the interrupted evolve\n'))
- ui.status(_('working directory is now at %s\n') % pctx)
+ stopevolve(ui, repo, evolvestate)
evolvestate.delete()
return
elif abortopt:
@@ -1471,6 +1468,13 @@
progresscb()
_cleanup(ui, repo, startnode, showprogress, shouldupdate)
+def stopevolve(ui, repo, evolvestate):
+ """logic for handling of `hg evolve --stop`"""
+ pctx = repo['.']
+ hg.updaterepo(repo, pctx.node(), True)
+ ui.status(_('stopped the interrupted evolve\n'))
+ ui.status(_('working directory is now at %s\n') % pctx)
+
def abortevolve(ui, repo, evolvestate):
""" logic for handling of `hg evolve --abort`"""