Mercurial > hg-stable
comparison hgext/histedit.py @ 24768:342671704344
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.
author | Durham Goode <durham@fb.com> |
---|---|
date | Sat, 04 Apr 2015 00:30:01 -0700 |
parents | 477e76936b1d |
children | e875b94dc94c |
comparison
equal
deleted
inserted
replaced
24767:477e76936b1d | 24768:342671704344 |
---|---|
566 ] | 566 ] |
567 for ich in internalchanges: | 567 for ich in internalchanges: |
568 replacements.append((ich, (n,))) | 568 replacements.append((ich, (n,))) |
569 return repo[n], replacements | 569 return repo[n], replacements |
570 | 570 |
571 def drop(ui, state, ha, opts): | 571 class drop(histeditaction): |
572 repo, ctxnode = state.repo, state.parentctxnode | 572 def run(self): |
573 ctx = repo[ctxnode] | 573 parentctx = self.repo[self.state.parentctxnode] |
574 return ctx, [(repo[ha].node(), ())] | 574 return parentctx, [(self.node, tuple())] |
575 | |
576 | 575 |
577 def message(ui, state, ha, opts): | 576 def message(ui, state, ha, opts): |
578 repo, ctxnode = state.repo, state.parentctxnode | 577 repo, ctxnode = state.repo, state.parentctxnode |
579 ctx = repo[ctxnode] | 578 ctx = repo[ctxnode] |
580 oldctx = repo[ha] | 579 oldctx = repo[ha] |