Mercurial > hg-stable
diff hgext/histedit.py @ 24959:3c762cceedde stable
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.
author | Durham Goode <durham@fb.com> |
---|---|
date | Fri, 01 May 2015 15:45:07 -0700 |
parents | a920abf5a592 |
children | 3f0744eeaeaf 8594d0b3018e |
line wrap: on
line diff
--- a/hgext/histedit.py Fri May 01 15:28:47 2015 -0700 +++ b/hgext/histedit.py Fri May 01 15:45:07 2015 -0700 @@ -893,21 +893,22 @@ 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