##// END OF EJS Templates
rebase: extract function for rebasing a single node...
Martin von Zweigbergk -
r36949:28f98809 default
parent child Browse files
Show More
@@ -430,17 +430,27 b' class rebaseruntime(object):'
430 430 ui.note(_('rebase merging completed\n'))
431 431
432 432 def _performrebasesubset(self, tr, subset, pos, total):
433 repo, ui, opts = self.repo, self.ui, self.opts
434 sortedrevs = repo.revs('sort(%ld, -topo)', subset)
433 sortedrevs = self.repo.revs('sort(%ld, -topo)', subset)
435 434 allowdivergence = self.ui.configbool(
436 435 'experimental', 'evolution.allowdivergence')
437 436 if not allowdivergence:
438 sortedrevs -= repo.revs(
437 sortedrevs -= self.repo.revs(
439 438 'descendants(%ld) and not %ld',
440 439 self.obsoletewithoutsuccessorindestination,
441 440 self.obsoletewithoutsuccessorindestination,
442 441 )
442 posholder = [pos]
443 def progress(ctx):
444 posholder[0] += 1
445 self.repo.ui.progress(_("rebasing"), posholder[0],
446 ("%d:%s" % (ctx.rev(), ctx)), _('changesets'),
447 total)
443 448 for rev in sortedrevs:
449 self._rebasenode(tr, rev, allowdivergence, progress)
450 return posholder[0]
451
452 def _rebasenode(self, tr, rev, allowdivergence, progressfn):
453 repo, ui, opts = self.repo, self.ui, self.opts
444 454 dest = self.destmap[rev]
445 455 ctx = repo[rev]
446 456 desc = _ctxdesc(ctx)
@@ -470,10 +480,8 b' class rebaseruntime(object):'
470 480 self.skipped))
471 481 self.state[rev] = dest
472 482 elif self.state[rev] == revtodo:
473 pos += 1
474 483 ui.status(_('rebasing %s\n') % desc)
475 ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, ctx)),
476 _('changesets'), total)
484 progressfn(ctx)
477 485 p1, p2, base = defineparents(repo, rev, self.destmap,
478 486 self.state, self.skipped,
479 487 self.obsoletenotrebased)
@@ -538,7 +546,6 b' class rebaseruntime(object):'
538 546 else:
539 547 ui.status(_('already rebased %s as %s\n') %
540 548 (desc, repo[self.state[rev]]))
541 return pos
542 549
543 550 def _finishrebase(self):
544 551 repo, ui, opts = self.repo, self.ui, self.opts
General Comments 0
You need to be logged in to leave comments. Login now