# HG changeset patch # User Durham Goode # Date 2015-05-01 22:45:07 # Node ID 3c762cceedde44b89ac90f44115d82de6f78393a # Parent a920abf5a592038e15b6e292974938a2bf3d0d48 histedit: fix --continue when rules are finished If histedit failed after all the rules were complete (for instance, if there was an exception in the cleanup phase), you couldn't --continue because it was unable to pop a rule. Let's just skip the rule execution phase of --continue if there are no more rules. diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -893,21 +893,22 @@ def _histedit(ui, repo, state, *freeargs def bootstrapcontinue(ui, state, opts): repo = state.repo - action, currentnode = state.rules.pop(0) - - actobj = actiontable[action].fromrule(state, currentnode) + if state.rules: + action, currentnode = state.rules.pop(0) - s = repo.status() - if s.modified or s.added or s.removed or s.deleted: - actobj.continuedirty() + actobj = actiontable[action].fromrule(state, currentnode) + s = repo.status() if s.modified or s.added or s.removed or s.deleted: - raise util.Abort(_("working copy still dirty")) + actobj.continuedirty() + s = repo.status() + if s.modified or s.added or s.removed or s.deleted: + raise util.Abort(_("working copy still dirty")) - parentctx, replacements = actobj.continueclean() + parentctx, replacements = actobj.continueclean() - state.parentctxnode = parentctx.node() - state.replacements.extend(replacements) + state.parentctxnode = parentctx.node() + state.replacements.extend(replacements) return state