A later patch will clean up those states. This patch moves the messages
earlier.
Marked as BC since the order of message has changed.
durin42 |
hg-reviewers |
A later patch will clean up those states. This patch moves the messages
earlier.
Marked as BC since the order of message has changed.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
self.skipped.add(rev) | self.skipped.add(rev) | ||||
self.state[rev] = p1 | self.state[rev] = p1 | ||||
ui.debug('next revision set to %s\n' % p1) | ui.debug('next revision set to %s\n' % p1) | ||||
elif self.state[rev] == nullmerge: | elif self.state[rev] == nullmerge: | ||||
ui.debug('ignoring null merge rebase of %s\n' % rev) | ui.debug('ignoring null merge rebase of %s\n' % rev) | ||||
elif self.state[rev] == revignored: | elif self.state[rev] == revignored: | ||||
ui.status(_('not rebasing ignored %s\n') % desc) | ui.status(_('not rebasing ignored %s\n') % desc) | ||||
elif self.state[rev] == revprecursor: | elif self.state[rev] == revprecursor: | ||||
destctx = repo[self.obsoletenotrebased[rev]] | pass | ||||
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)) | |||||
elif self.state[rev] == revpruned: | elif self.state[rev] == revpruned: | ||||
msg = _('note: not rebasing %s, it has no successor\n') | pass | ||||
ui.status(msg % desc) | |||||
else: | else: | ||||
ui.status(_('already rebased %s as %s\n') % | ui.status(_('already rebased %s as %s\n') % | ||||
(desc, repo[self.state[rev]])) | (desc, repo[self.state[rev]])) | ||||
ui.progress(_('rebasing'), None) | ui.progress(_('rebasing'), None) | ||||
ui.note(_('rebase merging completed\n')) | ui.note(_('rebase merging completed\n')) | ||||
def _finishrebase(self): | def _finishrebase(self): | ||||
# If we have multiple roots, we may have "hole" in the rebase set. | # If we have multiple roots, we may have "hole" in the rebase set. | ||||
# Rebase roots that descend from those "hole" should not be detached as | # Rebase roots that descend from those "hole" should not be detached as | ||||
# other root are. We use the special `revignored` to inform rebase that | # other root are. We use the special `revignored` to inform rebase that | ||||
# the revision should be ignored but that `defineparents` should search | # the revision should be ignored but that `defineparents` should search | ||||
# a rebase destination that make sense regarding rebased topology. | # a rebase destination that make sense regarding rebased topology. | ||||
rebasedomain = set(repo.revs('%ld::%ld', rebaseset, rebaseset)) | rebasedomain = set(repo.revs('%ld::%ld', rebaseset, rebaseset)) | ||||
for ignored in set(rebasedomain) - set(rebaseset): | for ignored in set(rebasedomain) - set(rebaseset): | ||||
state[ignored] = revignored | state[ignored] = revignored | ||||
unfi = repo.unfiltered() | |||||
for r in obsoletenotrebased: | 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 | state[r] = revpruned | ||||
else: | 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 | state[r] = revprecursor | ||||
repo.ui.status(msg) | |||||
return originalwd, dest.rev(), state | return originalwd, dest.rev(), state | ||||
def clearrebased(ui, repo, dest, state, skipped, collapsedas=None): | def clearrebased(ui, repo, dest, state, skipped, collapsedas=None): | ||||
"""dispose of rebased revision at the end of the rebase | """dispose of rebased revision at the end of the rebase | ||||
If `collapsedas` is not None, the rebase was a collapse whose result if the | If `collapsedas` is not None, the rebase was a collapse whose result if the | ||||
`collapsedas` node.""" | `collapsedas` node.""" | ||||
tonode = repo.changelog.node | tonode = repo.changelog.node |
|/| | |/| | ||||
o | 5:24b6387c8c8c F | o | 5:24b6387c8c8c F | ||||
| | | | | | ||||
| o 4:9520eea781bc E | | o 4:9520eea781bc E | ||||
|/ | |/ | ||||
o 0:cd010b8cd998 A | o 0:cd010b8cd998 A | ||||
$ hg rebase --source 'desc(B)' --dest 'tip' --config experimental.rebaseskipobsolete=True | $ hg rebase --source 'desc(B)' --dest 'tip' --config experimental.rebaseskipobsolete=True | ||||
rebasing 8:8877864f1edb "B" | |||||
note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D" | note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D" | ||||
rebasing 8:8877864f1edb "B" | |||||
rebasing 10:5ae4c968c6ac "C" | rebasing 10:5ae4c968c6ac "C" | ||||
$ hg debugobsolete | $ hg debugobsolete | ||||
42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob) | 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob) | ||||
5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob) | 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob) | ||||
32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob) | 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob) | ||||
08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob) | 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob) | ||||
8877864f1edb05d0e07dc4ba77b67a80a7b86672 462a34d07e599b87ea08676a449373fe4e2e1347 0 (*) {'user': 'test'} (glob) | 8877864f1edb05d0e07dc4ba77b67a80a7b86672 462a34d07e599b87ea08676a449373fe4e2e1347 0 (*) {'user': 'test'} (glob) | ||||
5ae4c968c6aca831df823664e706c9d4aa34473d 98f6af4ee9539e14da4465128f894c274900b6e5 0 (*) {'user': 'test'} (glob) | 5ae4c968c6aca831df823664e706c9d4aa34473d 98f6af4ee9539e14da4465128f894c274900b6e5 0 (*) {'user': 'test'} (glob) | ||||
|/ | |/ | ||||
o 2:261e70097290 B2 | o 2:261e70097290 B2 | ||||
| | | | ||||
o 0:4a2df7238c3b A | o 0:4a2df7238c3b A | ||||
$ hg debugobsolete `hg log -r 7 -T '{node}\n'` --config experimental.stabilization=all | $ hg debugobsolete `hg log -r 7 -T '{node}\n'` --config experimental.stabilization=all | ||||
obsoleted 1 changesets | obsoleted 1 changesets | ||||
$ hg rebase -d 6 -r "4::" | $ hg rebase -d 6 -r "4::" | ||||
rebasing 4:ff2c4d47b71d "C" | |||||
note: not rebasing 7:360bbaa7d3ce "O", it has no successor | note: not rebasing 7:360bbaa7d3ce "O", it has no successor | ||||
rebasing 4:ff2c4d47b71d "C" | |||||
rebasing 8:8d47583e023f "P" (tip) | rebasing 8:8d47583e023f "P" (tip) | ||||
If all the changeset to be rebased are obsolete and present in the destination, we | If all the changeset to be rebased are obsolete and present in the destination, we | ||||
should display a friendly error message | should display a friendly error message | ||||
$ hg log -G | $ hg log -G | ||||
@ 10:121d9e3bc4c6 P | @ 10:121d9e3bc4c6 P | ||||
| | | | ||||
| o 19:601db7a18f51 dummy change successor | | o 19:601db7a18f51 dummy change successor | ||||
| | | | | | ||||
| o 18:357ddf1602d5 willconflict first version | | o 18:357ddf1602d5 willconflict first version | ||||
|/ | |/ | ||||
o 17:61bd55f69bc4 bar foo | o 17:61bd55f69bc4 bar foo | ||||
| | | | ||||
~ | ~ | ||||
$ hg rebase -r ".^^ + .^ + ." -d 19 | $ 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" | rebasing 20:b82fb57ea638 "willconflict second version" | ||||
merging willconflict | merging willconflict | ||||
warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark') | warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark') | ||||
unresolved conflicts (see hg resolve, then hg rebase --continue) | unresolved conflicts (see hg resolve, then hg rebase --continue) | ||||
[1] | [1] | ||||
$ hg resolve --mark willconflict | $ hg resolve --mark willconflict | ||||
(no more unresolved files) | (no more unresolved files) | ||||
continue: hg rebase --continue | continue: hg rebase --continue | ||||
$ hg rebase --continue | $ hg rebase --continue | ||||
rebasing 20:b82fb57ea638 "willconflict second version" | 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) | rebasing 22:7bdc8a87673d "dummy change" (tip) | ||||
$ cd .. | $ cd .. | ||||
Rebase merge where successor of one parent is equal to destination (issue5198) | Rebase merge where successor of one parent is equal to destination (issue5198) | ||||
$ hg init p1-succ-is-dest | $ hg init p1-succ-is-dest | ||||
$ cd p1-succ-is-dest | $ cd p1-succ-is-dest | ||||
> F C | > F C | ||||
> /| | | > /| | | ||||
> E D B # replace: E -> B | > E D B # replace: E -> B | ||||
> \|/ | > \|/ | ||||
> A | > A | ||||
> EOF | > EOF | ||||
$ hg rebase -d C -b F | $ hg rebase -d C -b F | ||||
rebasing 2:b18e25de2cf5 "D" (D) | |||||
note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" | note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" | ||||
rebasing 2:b18e25de2cf5 "D" (D) | |||||
rebasing 5:66f1a38021c9 "F" (F tip) | rebasing 5:66f1a38021c9 "F" (F tip) | ||||
warning: rebasing 5:66f1a38021c9 may include unwanted changes from 3:7fb047a69f22 | warning: rebasing 5:66f1a38021c9 may include unwanted changes from 3:7fb047a69f22 | ||||
$ hg log -G | $ hg log -G | ||||
o 7:9ed45af61fa0 F | o 7:9ed45af61fa0 F | ||||
| | | | ||||
o 6:8f47515dda15 D | o 6:8f47515dda15 D | ||||
| | | | ||||
| x 5:66f1a38021c9 F | | x 5:66f1a38021c9 F |