# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1521199801 -19800 # Node ID cec6e21b3bcf50549aed3ee78ac678c20124b294 # Parent 77a400149758cabd6c5a743c18b958a8061aa330 evolve: de-duplicate some function calls _cleanup() was called in continueevolve() and evolve() function too. Let's call it at a single place for both the cases. Also call progresscb() outside of conditionals to call it both times. diff -r 77a400149758 -r cec6e21b3bcf hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Fri Mar 16 16:11:22 2018 +0530 +++ b/hgext3rd/evolve/evolvecmd.py Fri Mar 16 17:00:01 2018 +0530 @@ -1130,6 +1130,10 @@ raise error.Abort('no evolve to continue') evolvestate.load() continueevolve(ui, repo, evolvestate, progresscb) + if evolvestate['command'] != 'evolve': + evolvestate.delete() + return + startnode = repo.unfiltered()[evolvestate['startnode']] evolvestate.delete() else: cmdutil.bailifchanged(repo) @@ -1160,8 +1164,8 @@ evolvestate['replacements'][curctx.node()] = [ret[1]] else: evolvestate['skippedrevs'].append(curctx.node()) - progresscb() - _cleanup(ui, repo, startnode, showprogress) + progresscb() + _cleanup(ui, repo, startnode, showprogress) def continueevolve(ui, repo, evolvestate, progresscb): """logic for handling of `hg evolve --continue`""" @@ -1227,7 +1231,6 @@ evolvestate['replacements'][ctx.node()] = node category = evolvestate['category'] confirm = evolvestate['confirm'] - startnode = evolvestate['startnode'] unfi = repo.unfiltered() for rev in evolvestate['revs']: # XXX: prevent this lookup by storing nodes instead of revnums @@ -1240,6 +1243,4 @@ evolvestate['replacements'][curctx.node()] = newnode[1] else: evolvestate['skippedrevs'].append(curctx.node()) - - _cleanup(ui, repo, unfi[startnode], True) return