# HG changeset patch # User David Soria Parra # Date 1413385575 25200 # Node ID b3483bc1ec8c19b274e9d7908b4c6b53461f2ad2 # Parent bb22cd700e0ac6d0afdd9d36433aa67bc2bc63b3 histedit: pass state to boostrapcontinue Pass the state to boostrapcontinue and remove the unecessary passing of repo. diff -r bb22cd700e0a -r b3483bc1ec8c hgext/histedit.py --- a/hgext/histedit.py Wed Oct 15 17:11:54 2014 -0700 +++ b/hgext/histedit.py Wed Oct 15 08:06:15 2014 -0700 @@ -569,9 +569,7 @@ # rebuild state if goal == 'continue': state = readstate(repo) - state.parentctx, repl = bootstrapcontinue(ui, repo, state.parentctx, - state.rules, opts) - state.replacements.extend(repl) + state = bootstrapcontinue(ui, state, opts) elif goal == 'abort': state = readstate(repo) mapping, tmpnodes, leafs, _ntm = processreplacement(repo, @@ -702,8 +700,9 @@ newchildren.pop(0) # remove ctx return newchildren -def bootstrapcontinue(ui, repo, parentctx, rules, opts): - action, currentnode = rules.pop(0) +def bootstrapcontinue(ui, state, opts): + repo, parentctx = state.repo, state.parentctx + action, currentnode = state.rules.pop(0) ctx = repo[currentnode] newchildren = gatherchildren(repo, parentctx) @@ -758,8 +757,11 @@ elif newchildren: # otherwise update "parentctx" before proceeding to further operation parentctx = repo[newchildren[-1]] - return parentctx, replacements + state.parentctx = parentctx + state.replacements.extend(replacements) + + return state def between(repo, old, new, keep): """select and validate the set of revision to edit