##// END OF EJS Templates
histedit: move finishfold into fold class...
Durham Goode -
r24772:8f6494eb default
parent child Browse files
Show More
@@ -546,13 +546,10 class fold(histeditaction):
546 if isinstance(self, rollup):
546 if isinstance(self, rollup):
547 foldopts['rollup'] = True
547 foldopts['rollup'] = True
548
548
549 return finishfold(repo.ui, repo, parentctx, rulectx, ctx.node(),
549 return self.finishfold(repo.ui, repo, parentctx, rulectx, ctx.node(),
550 foldopts, middlecommits)
550 foldopts, middlecommits)
551
551
552 class rollup(fold):
552 def finishfold(self, ui, repo, ctx, oldctx, newnode, opts, internalchanges):
553 pass
554
555 def finishfold(ui, repo, ctx, oldctx, newnode, opts, internalchanges):
556 parent = ctx.parents()[0].node()
553 parent = ctx.parents()[0].node()
557 hg.update(repo, parent)
554 hg.update(repo, parent)
558 ### prepare new commit data
555 ### prepare new commit data
@@ -571,8 +568,8 def finishfold(ui, repo, ctx, oldctx, ne
571 commitopts['date'] = max(ctx.date(), oldctx.date())
568 commitopts['date'] = max(ctx.date(), oldctx.date())
572 extra = ctx.extra().copy()
569 extra = ctx.extra().copy()
573 # histedit_source
570 # histedit_source
574 # note: ctx is likely a temporary commit but that the best we can do here
571 # note: ctx is likely a temporary commit but that the best we can do
575 # This is sufficient to solve issue3681 anyway
572 # here. This is sufficient to solve issue3681 anyway.
576 extra['histedit_source'] = '%s,%s' % (ctx.hex(), oldctx.hex())
573 extra['histedit_source'] = '%s,%s' % (ctx.hex(), oldctx.hex())
577 commitopts['extra'] = extra
574 commitopts['extra'] = extra
578 phasebackup = repo.ui.backupconfig('phases', 'new-commit')
575 phasebackup = repo.ui.backupconfig('phases', 'new-commit')
@@ -593,6 +590,9 def finishfold(ui, repo, ctx, oldctx, ne
593 replacements.append((ich, (n,)))
590 replacements.append((ich, (n,)))
594 return repo[n], replacements
591 return repo[n], replacements
595
592
593 class rollup(fold):
594 pass
595
596 class drop(histeditaction):
596 class drop(histeditaction):
597 def run(self):
597 def run(self):
598 parentctx = self.repo[self.state.parentctxnode]
598 parentctx = self.repo[self.state.parentctxnode]
General Comments 0
You need to be logged in to leave comments. Login now