2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2017-08-06 21:40:53 +03:00
|
|
|
$ cat >> $HGRCPATH <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> bruterebase=$TESTDIR/bruterebase.py
|
|
|
|
> [experimental]
|
2017-09-28 20:19:06 +03:00
|
|
|
> evolution.createmarkers=True
|
2017-09-28 20:56:40 +03:00
|
|
|
> evolution.allowunstable=True
|
2017-08-06 21:40:53 +03:00
|
|
|
> EOF
|
|
|
|
$ init() {
|
|
|
|
> N=`expr ${N:-0} + 1`
|
|
|
|
> cd $TESTTMP && hg init repo$N && cd repo$N
|
2019-12-17 05:10:38 +03:00
|
|
|
> drawdag
|
2017-08-06 21:40:53 +03:00
|
|
|
> }
|
|
|
|
|
|
|
|
Source looks like "N"
|
|
|
|
|
|
|
|
$ init <<'EOS'
|
|
|
|
> C D
|
|
|
|
> |\|
|
|
|
|
> A B Z
|
|
|
|
> EOS
|
|
|
|
|
2019-12-17 05:10:38 +03:00
|
|
|
$ hg debugbruterebase "all()-$Z" $Z --hidden
|
2017-08-06 21:40:53 +03:00
|
|
|
A: A':Z
|
|
|
|
B: B':Z
|
|
|
|
AB: A':Z B':Z
|
2017-08-13 07:01:06 +03:00
|
|
|
C: ABORT: cannot rebase 3:a35c07e8a2a4 without moving at least one of its parents
|
2017-08-06 21:40:53 +03:00
|
|
|
AC: A':Z C':A'B
|
|
|
|
BC: B':Z C':B'A
|
|
|
|
ABC: A':Z B':Z C':A'B'
|
|
|
|
D: D':Z
|
|
|
|
AD: A':Z D':Z
|
|
|
|
BD: B':Z D':B'
|
|
|
|
ABD: A':Z B':Z D':B'
|
2017-08-13 07:01:06 +03:00
|
|
|
CD: ABORT: cannot rebase 3:a35c07e8a2a4 without moving at least one of its parents
|
rebase: rewrite core algorithm (issue5578) (issue5630)
"defineparents" is the core algorithm of rebase. The old code has too many
tech debts (like outdated comments, confusing assertions, etc) and is very
error-prone to be improved. This patch rewrites "defineparents" to make the
code easier to reason about, and solve a bunch of issues, including:
- Assertion error: no base found (demonstrated by D212, issue5578)
- Asymmetric result (demonstrated by D211, "F with one parent")
- Wrong new parent (demonstrated by D262, "C':A'A'")
- "revlog index out of range" (demonstrated by D262, issue5630)
- "nothing to merge" (demonstrated by D262)
As a side effect, merge base decision has been made more solid - rebase now
prints out explicitly what could go wrong when it cannot find a unique
suitable merge base.
.. fix:: Issue 5578, Issue 5630
Core rebase algorithm has been rewritten to be more robust.
Differential Revision: https://phab.mercurial-scm.org/D21
2017-08-11 07:30:31 +03:00
|
|
|
ACD: A':Z C':A'B D':Z
|
2017-08-06 21:40:53 +03:00
|
|
|
BCD: B':Z C':B'A D':B'
|
|
|
|
ABCD: A':Z B':Z C':A'B' D':B'
|
|
|
|
|
|
|
|
Moving backwards
|
|
|
|
|
|
|
|
$ init <<'EOS'
|
|
|
|
> C
|
|
|
|
> |\
|
|
|
|
> A B
|
|
|
|
> |
|
|
|
|
> Z
|
|
|
|
> EOS
|
2019-12-17 05:10:38 +03:00
|
|
|
$ hg debugbruterebase "all()-$Z" $Z --hidden
|
2017-08-06 21:40:53 +03:00
|
|
|
B: B':Z
|
|
|
|
A:
|
|
|
|
BA: B':Z
|
2017-08-13 07:01:06 +03:00
|
|
|
C: ABORT: cannot rebase 3:b8d7149b562b without moving at least one of its parents
|
2017-08-06 21:40:53 +03:00
|
|
|
BC: B':Z C':B'A
|
|
|
|
AC:
|
rebase: rewrite core algorithm (issue5578) (issue5630)
"defineparents" is the core algorithm of rebase. The old code has too many
tech debts (like outdated comments, confusing assertions, etc) and is very
error-prone to be improved. This patch rewrites "defineparents" to make the
code easier to reason about, and solve a bunch of issues, including:
- Assertion error: no base found (demonstrated by D212, issue5578)
- Asymmetric result (demonstrated by D211, "F with one parent")
- Wrong new parent (demonstrated by D262, "C':A'A'")
- "revlog index out of range" (demonstrated by D262, issue5630)
- "nothing to merge" (demonstrated by D262)
As a side effect, merge base decision has been made more solid - rebase now
prints out explicitly what could go wrong when it cannot find a unique
suitable merge base.
.. fix:: Issue 5578, Issue 5630
Core rebase algorithm has been rewritten to be more robust.
Differential Revision: https://phab.mercurial-scm.org/D21
2017-08-11 07:30:31 +03:00
|
|
|
BAC: B':Z C':B'A
|