# HG changeset patch # User Durham Goode # Date 1428132601 25200 # Node ID 3426717043443b268b9954404d5e813f1eee0560 # Parent 477e76936b1d3ed58f8a56ed402533aa50a35b13 histedit: convert drop action into a class This converts the drop action into a histeditclass instance, as part of an ongoing effort to refactor histedit for maintainability and robustness. diff -r 477e76936b1d -r 342671704344 hgext/histedit.py --- a/hgext/histedit.py Sat Apr 04 11:39:08 2015 -0700 +++ b/hgext/histedit.py Sat Apr 04 00:30:01 2015 -0700 @@ -568,11 +568,10 @@ replacements.append((ich, (n,))) return repo[n], replacements -def drop(ui, state, ha, opts): - repo, ctxnode = state.repo, state.parentctxnode - ctx = repo[ctxnode] - return ctx, [(repo[ha].node(), ())] - +class drop(histeditaction): + def run(self): + parentctx = self.repo[self.state.parentctxnode] + return parentctx, [(self.node, tuple())] def message(ui, state, ha, opts): repo, ctxnode = state.repo, state.parentctxnode