##// END OF EJS Templates
histedit: improve roll action integration with fold...
Durham Goode -
r24773:090da033 default
parent child Browse files
Show More
@@ -542,21 +542,20 b' class fold(histeditaction):'
542 middlecommits = newcommits.copy()
542 middlecommits = newcommits.copy()
543 middlecommits.discard(ctx.node())
543 middlecommits.discard(ctx.node())
544
544
545 foldopts = {}
545 return self.finishfold(repo.ui, repo, parentctx, rulectx, ctx.node(),
546 if isinstance(self, rollup):
546 middlecommits)
547 foldopts['rollup'] = True
548
547
549 return self.finishfold(repo.ui, repo, parentctx, rulectx, ctx.node(),
548 def skipprompt(self):
550 foldopts, middlecommits)
549 return False
551
550
552 def finishfold(self, ui, repo, ctx, oldctx, newnode, opts, internalchanges):
551 def finishfold(self, ui, repo, ctx, oldctx, newnode, internalchanges):
553 parent = ctx.parents()[0].node()
552 parent = ctx.parents()[0].node()
554 hg.update(repo, parent)
553 hg.update(repo, parent)
555 ### prepare new commit data
554 ### prepare new commit data
556 commitopts = opts.copy()
555 commitopts = {}
557 commitopts['user'] = ctx.user()
556 commitopts['user'] = ctx.user()
558 # commit message
557 # commit message
559 if opts.get('rollup'):
558 if self.skipprompt():
560 newmessage = ctx.description()
559 newmessage = ctx.description()
561 else:
560 else:
562 newmessage = '\n***\n'.join(
561 newmessage = '\n***\n'.join(
@@ -591,7 +590,8 b' class fold(histeditaction):'
591 return repo[n], replacements
590 return repo[n], replacements
592
591
593 class rollup(fold):
592 class rollup(fold):
594 pass
593 def skipprompt(self):
594 return True
595
595
596 class drop(histeditaction):
596 class drop(histeditaction):
597 def run(self):
597 def run(self):
General Comments 0
You need to be logged in to leave comments. Login now