comparison tests/test-evolve-issue6648.t @ 6224:17ffdea0edbb stable

evolve: look for split successors of the correct ancestor (issue6648) Consider two changesets, 1 and 2. 1 is split into two new changesets and 2 is pruned. If we stand on 2 and call hg evolve, _singlesuccessor() will traverse ancestors of wdp in search of a changeset with successors to update to (it will be 1, which was split). In case of a split, select_split_successor() gets control. The issue is this function didn't traverse ancestors, and instead tried to look up successors of the original changeset (i.e. 2 in our case, which was pruned). We can make select_split_successor() aware of _singlesuccessor() logic by using the changeset that actually has successors without traversing ancestors again. It's done by storing that changeset in MultipleSuccessorsError exception.
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 21 Apr 2022 22:19:27 +0400
parents
children
comparison
equal deleted inserted replaced
6223:4298ae0b966d 6224:17ffdea0edbb
1 Finding split successors for the correct ancestor (issue6648)
2 https://bz.mercurial-scm.org/show_bug.cgi?id=6648
3
4 $ . $TESTDIR/testlib/common.sh
5
6 $ cat << EOF >> $HGRCPATH
7 > [extensions]
8 > evolve =
9 > EOF
10
11 $ hg init issue6648
12 $ cd issue6648
13
14 $ echo hi > foo
15 $ hg commit -qAm 'r0'
16 $ echo foo >> foo
17 $ echo foo >> foosplit
18 $ hg commit -qAm 'r1_splitme'
19 $ echo bar > bar
20 $ hg commit -qAm 'r2_obsoleteme'
21 $ echo baz > baz
22 $ hg commit -qAm 'r3'
23
24 $ hg prune -r 2
25 1 changesets pruned
26 1 new orphan changesets
27 $ hg split -r 1 --no-interactive foosplit
28 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
29 reverting foo
30 adding foosplit
31 created new head
32 no more changes to split
33
34 $ hg update -r 2
35 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
36 working directory parent is obsolete! (5c9b6cf2edc5)
37 (use 'hg evolve' to update to its parent successor)
38
39 $ hg log -G
40 o changeset: 5:983ec6453b57
41 | tag: tip
42 | user: test
43 | date: Thu Jan 01 00:00:00 1970 +0000
44 | summary: r1_splitme
45 |
46 o changeset: 4:9ca7a4996099
47 | parent: 0:e9326971c0ba
48 | user: test
49 | date: Thu Jan 01 00:00:00 1970 +0000
50 | summary: r1_splitme
51 |
52 | * changeset: 3:c1e686af368d
53 | | user: test
54 | | date: Thu Jan 01 00:00:00 1970 +0000
55 | | instability: orphan
56 | | summary: r3
57 | |
58 | @ changeset: 2:5c9b6cf2edc5
59 | | user: test
60 | | date: Thu Jan 01 00:00:00 1970 +0000
61 | | obsolete: pruned using prune
62 | | summary: r2_obsoleteme
63 | |
64 | x changeset: 1:acdff8eea54c
65 |/ user: test
66 | date: Thu Jan 01 00:00:00 1970 +0000
67 | obsolete: split using split as 4:9ca7a4996099, 5:983ec6453b57
68 | summary: r1_splitme
69 |
70 o changeset: 0:e9326971c0ba
71 user: test
72 date: Thu Jan 01 00:00:00 1970 +0000
73 summary: r0
74
75
76 handling obsolete wdp works
77
78 $ hg evolve
79 update:[5] r1_splitme
80 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
81 working directory is now at 983ec6453b57
82
83 stabilizing the orphan works
84
85 $ hg evolve
86 move:[3] r3
87 atop:[5] r1_splitme