diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -446,14 +446,9 @@ elif self.state[rev] == revignored: ui.status(_('not rebasing ignored %s\n') % desc) elif self.state[rev] == revprecursor: - destctx = repo[self.obsoletenotrebased[rev]] - descdest = '%d:%s "%s"' % (destctx.rev(), destctx, - destctx.description().split('\n', 1)[0]) - msg = _('note: not rebasing %s, already in destination as %s\n') - ui.status(msg % (desc, descdest)) + pass elif self.state[rev] == revpruned: - msg = _('note: not rebasing %s, it has no successor\n') - ui.status(msg % desc) + pass else: ui.status(_('already rebased %s as %s\n') % (desc, repo[self.state[rev]])) @@ -1321,11 +1316,21 @@ rebasedomain = set(repo.revs('%ld::%ld', rebaseset, rebaseset)) for ignored in set(rebasedomain) - set(rebaseset): state[ignored] = revignored + unfi = repo.unfiltered() for r in obsoletenotrebased: - if obsoletenotrebased[r] is None: + desc = _ctxdesc(unfi[r]) + succ = obsoletenotrebased[r] + if succ is None: + msg = _('note: not rebasing %s, it has no successor\n') % desc state[r] = revpruned else: + destctx = unfi[succ] + destdesc = '%d:%s "%s"' % (destctx.rev(), destctx, + destctx.description().split('\n', 1)[0]) + msg = (_('note: not rebasing %s, already in destination as %s\n') + % (desc, destdesc)) state[r] = revprecursor + repo.ui.status(msg) return originalwd, dest.rev(), state def clearrebased(ui, repo, state, skipped, collapsedas=None): diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t --- a/tests/test-rebase-obsolete.t +++ b/tests/test-rebase-obsolete.t @@ -204,8 +204,8 @@ o 0:cd010b8cd998 A $ hg rebase --source 'desc(B)' --dest 'tip' --config experimental.rebaseskipobsolete=True + note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D" rebasing 8:8877864f1edb "B" - note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D" rebasing 10:5ae4c968c6ac "C" $ hg debugobsolete 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob) @@ -711,8 +711,8 @@ $ hg debugobsolete `hg log -r 7 -T '{node}\n'` --config experimental.evolution=all $ hg rebase -d 6 -r "4::" + note: not rebasing 7:360bbaa7d3ce "O", it has no successor rebasing 4:ff2c4d47b71d "C" - note: not rebasing 7:360bbaa7d3ce "O", it has no successor rebasing 8:8d47583e023f "P" (tip) If all the changeset to be rebased are obsolete and present in the destination, we @@ -877,6 +877,7 @@ | ~ $ hg rebase -r ".^^ + .^ + ." -d 19 + note: not rebasing 21:8b31da3c4919 "dummy change", already in destination as 19:601db7a18f51 "dummy change successor" rebasing 20:b82fb57ea638 "willconflict second version" merging willconflict warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark') @@ -888,7 +889,6 @@ continue: hg rebase --continue $ hg rebase --continue rebasing 20:b82fb57ea638 "willconflict second version" - note: not rebasing 21:8b31da3c4919 "dummy change", already in destination as 19:601db7a18f51 "dummy change successor" rebasing 22:7bdc8a87673d "dummy change" (tip) $ cd ..