# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1528650777 -19800 # Node ID a8f509981d30bf2bc877c2c0389771a12bf9cc11 # Parent 7b33a6ed053942c7bb32d3bcaa703084aba94bb9 evolve: factor out logic for --stop flag in separate function This will make code clean diff -r 7b33a6ed0539 -r a8f509981d30 hgext3rd/evolve/evolvecmd.py --- 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`"""