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.
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 (18 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
bookmarks.deactivate(repo) | bookmarks.deactivate(repo) | ||||
# Store the state before we begin so users can run 'hg rebase --abort' | # Store the state before we begin so users can run 'hg rebase --abort' | ||||
# if we fail before the transaction closes. | # if we fail before the transaction closes. | ||||
self.storestatus() | self.storestatus() | ||||
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) | total = len(cands) | ||||
pos = 0 | posholder = [0] | ||||
for subset in sortsource(self.destmap): | def progress(ctx): | ||||
sortedrevs = self.repo.revs('sort(%ld, -topo)', subset) | posholder[0] += 1 | ||||
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): | |||||
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, | ||||
) | ) | ||||
posholder = [pos] | |||||
def progress(ctx): | |||||
posholder[0] += 1 | |||||
self.repo.ui.progress(_("rebasing"), posholder[0], | |||||
("%d:%s" % (ctx.rev(), ctx)), | |||||
_('changesets'), total) | |||||
for rev in sortedrevs: | for rev in sortedrevs: | ||||
self._rebasenode(tr, rev, allowdivergence, progress) | self._rebasenode(tr, rev, allowdivergence, progress) | ||||
pos = posholder[0] | |||||
ui.progress(_('rebasing'), None) | ui.progress(_('rebasing'), None) | ||||
ui.note(_('rebase merging completed\n')) | ui.note(_('rebase merging completed\n')) | ||||
def _rebasenode(self, tr, rev, allowdivergence, progressfn): | def _rebasenode(self, tr, rev, allowdivergence, progressfn): | ||||
repo, ui, opts = self.repo, self.ui, self.opts | repo, ui, opts = self.repo, self.ui, self.opts | ||||
dest = self.destmap[rev] | dest = self.destmap[rev] | ||||
ctx = repo[rev] | ctx = repo[rev] | ||||
desc = _ctxdesc(ctx) | desc = _ctxdesc(ctx) |