##// END OF EJS Templates
histedit: convert message action into a class...
Durham Goode -
r24769:e875b94d default
parent child Browse files
Show More
@@ -573,25 +573,9 b' class drop(histeditaction):'
573 573 parentctx = self.repo[self.state.parentctxnode]
574 574 return parentctx, [(self.node, tuple())]
575 575
576 def message(ui, state, ha, opts):
577 repo, ctxnode = state.repo, state.parentctxnode
578 ctx = repo[ctxnode]
579 oldctx = repo[ha]
580 hg.update(repo, ctx.node())
581 stats = applychanges(ui, repo, oldctx, opts)
582 if stats and stats[3] > 0:
583 raise error.InterventionRequired(
584 _('Fix up the change and run hg histedit --continue'))
585 message = oldctx.description()
586 commit = commitfuncfor(repo, oldctx)
587 editor = cmdutil.getcommiteditor(edit=True, editform='histedit.mess')
588 new = commit(text=message, user=oldctx.user(), date=oldctx.date(),
589 extra=oldctx.extra(), editor=editor)
590 newctx = repo[new]
591 if oldctx.node() != newctx.node():
592 return newctx, [(oldctx.node(), (new,))]
593 # We didn't make an edit, so just indicate no replaced nodes
594 return newctx, []
576 class message(histeditaction):
577 def commiteditor(self):
578 return cmdutil.getcommiteditor(edit=True, editform='histedit.mess')
595 579
596 580 def findoutgoing(ui, repo, remote=None, force=False, opts={}):
597 581 """utility function to find the first outgoing changeset
@@ -923,8 +907,8 b' def bootstrapcontinue(ui, state, opts):'
923 907 message = 'fold-temp-revision %s' % currentnode[:12]
924 908 else:
925 909 message = ctx.description()
926 editopt = action in ('e', 'edit', 'm', 'mess')
927 canonaction = {'e': 'edit', 'm': 'mess'}
910 editopt = action in ('e', 'edit')
911 canonaction = {'e': 'edit'}
928 912 editform = 'histedit.%s' % canonaction.get(action, action)
929 913 editor = cmdutil.getcommiteditor(edit=editopt, editform=editform)
930 914 commit = commitfuncfor(repo, ctx)
General Comments 0
You need to be logged in to leave comments. Login now