Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
( )
hg-reviewers |
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | hgext/rebase.py (11 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
# if we fail before the transaction closes. | # if we fail before the transaction closes. | ||||
self.storestatus() | self.storestatus() | ||||
if tr: | if tr: | ||||
# When using single transaction, store state when transaction | # When using single transaction, store state when transaction | ||||
# commits. | # commits. | ||||
self.storestatus(tr) | self.storestatus(tr) | ||||
cands = [k for k, v in self.state.iteritems() if v == revtodo] | cands = [k for k, v in self.state.iteritems() if v == revtodo] | ||||
total = len(cands) | p = repo.ui.makeprogress(_("rebasing"), unit=_('changesets'), | ||||
posholder = [0] | total=len(cands)) | ||||
def progress(ctx): | def progress(ctx): | ||||
posholder[0] += 1 | p.increment(item=("%d:%s" % (ctx.rev(), ctx))) | ||||
self.repo.ui.progress(_("rebasing"), posholder[0], | |||||
("%d:%s" % (ctx.rev(), ctx)), | |||||
_('changesets'), total) | |||||
allowdivergence = self.ui.configbool( | allowdivergence = self.ui.configbool( | ||||
'experimental', 'evolution.allowdivergence') | 'experimental', 'evolution.allowdivergence') | ||||
for subset in sortsource(self.destmap): | for subset in sortsource(self.destmap): | ||||
sortedrevs = self.repo.revs('sort(%ld, -topo)', subset) | sortedrevs = self.repo.revs('sort(%ld, -topo)', subset) | ||||
if not allowdivergence: | if not allowdivergence: | ||||
sortedrevs -= self.repo.revs( | sortedrevs -= self.repo.revs( | ||||
'descendants(%ld) and not %ld', | 'descendants(%ld) and not %ld', | ||||
self.obsoletewithoutsuccessorindestination, | self.obsoletewithoutsuccessorindestination, | ||||
self.obsoletewithoutsuccessorindestination, | self.obsoletewithoutsuccessorindestination, | ||||
) | ) | ||||
for rev in sortedrevs: | for rev in sortedrevs: | ||||
self._rebasenode(tr, rev, allowdivergence, progress) | self._rebasenode(tr, rev, allowdivergence, progress) | ||||
ui.progress(_('rebasing'), None) | p.complete() | ||||
ui.note(_('rebase merging completed\n')) | ui.note(_('rebase merging completed\n')) | ||||
def _concludenode(self, rev, p1, p2, editor, commitmsg=None): | def _concludenode(self, rev, p1, p2, editor, commitmsg=None): | ||||
'''Commit the wd changes with parents p1 and p2. | '''Commit the wd changes with parents p1 and p2. | ||||
Reuse commit info from rev but also store useful information in extra. | Reuse commit info from rev but also store useful information in extra. | ||||
Return node of committed revision.''' | Return node of committed revision.''' | ||||
repo = self.repo | repo = self.repo |