rebase: change "result would have 3 parent" error message (BC)

The old error message "cannot use revision REV as base, result would have 3
parents" is confusing - why use REV as base? why add a new parent?.

This patch changes it to "cannot move parent", which seems better.

Differential Revision: https://phab.mercurial-scm.org/D342
This commit is contained in:
Jun Wu 2017-08-12 21:01:06 -07:00
parent 80b48fb03d
commit 7a9096496d
4 changed files with 8 additions and 9 deletions

View File

@ -1091,10 +1091,9 @@ def defineparents(repo, rev, dest, state):
# /| # None of A and B will be changed to D and rebase fails.
# A B D
if set(newps) == set(oldps) and dest not in newps:
# The error message is for compatibility. It's a bit misleading
# since rebase is not supposed to add new parents.
raise error.Abort(_('cannot use revision %d as base, '
'result would have 3 parents') % rev)
raise error.Abort(_('cannot rebase %d:%s without '
'moving at least one of its parents')
% (rev, repo[rev]))
repo.ui.debug(" future parents are %d and %d\n" % tuple(newps))

View File

@ -23,7 +23,7 @@ Source looks like "N"
A: A':Z
B: B':Z
AB: A':Z B':Z
C: ABORT: cannot use revision 3 as base, result would have 3 parents
C: ABORT: cannot rebase 3:a35c07e8a2a4 without moving at least one of its parents
AC: A':Z C':A'B
BC: B':Z C':B'A
ABC: A':Z B':Z C':A'B'
@ -31,7 +31,7 @@ Source looks like "N"
AD: A':Z D':Z
BD: B':Z D':B'
ABD: A':Z B':Z D':B'
CD: ABORT: cannot use revision 3 as base, result would have 3 parents
CD: ABORT: cannot rebase 3:a35c07e8a2a4 without moving at least one of its parents
ACD: A':Z C':A'B D':Z
BCD: B':Z C':B'A D':B'
ABCD: A':Z B':Z C':A'B' D':B'
@ -49,7 +49,7 @@ Moving backwards
B: B':Z
A:
BA: B':Z
C: ABORT: cannot use revision 3 as base, result would have 3 parents
C: ABORT: cannot rebase 3:b8d7149b562b without moving at least one of its parents
BC: B':Z C':B'A
AC:
BAC: B':Z C':B'A

View File

@ -494,7 +494,7 @@ Detach both parents
not rebasing ignored 4:26805aba1e60 "C" (C)
not rebasing ignored 5:4b61ff5c62e2 "E" (E)
rebasing 6:f15c3adaf214 "F" (F tip)
abort: cannot use revision 6 as base, result would have 3 parents
abort: cannot rebase 6:f15c3adaf214 without moving at least one of its parents
[255]
$ cd ..

View File

@ -271,7 +271,7 @@ G onto B - merge revision with both parents not in ancestors of target:
$ hg rebase -s 6 -d 1
rebasing 6:eea13746799a "G"
abort: cannot use revision 6 as base, result would have 3 parents
abort: cannot rebase 6:eea13746799a without moving at least one of its parents
[255]
$ hg rebase --abort
rebase aborted