annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6224
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
1 Finding split successors for the correct ancestor (issue6648)
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
2 https://bz.mercurial-scm.org/show_bug.cgi?id=6648
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
3
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
4 $ . $TESTDIR/testlib/common.sh
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
5
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
6 $ cat << EOF >> $HGRCPATH
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
7 > [extensions]
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
8 > evolve =
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
9 > EOF
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
10
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
11 $ hg init issue6648
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
12 $ cd issue6648
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
13
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
14 $ echo hi > foo
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
15 $ hg commit -qAm 'r0'
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
16 $ echo foo >> foo
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
17 $ echo foo >> foosplit
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
18 $ hg commit -qAm 'r1_splitme'
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
19 $ echo bar > bar
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
20 $ hg commit -qAm 'r2_obsoleteme'
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
21 $ echo baz > baz
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
22 $ hg commit -qAm 'r3'
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
23
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
24 $ hg prune -r 2
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
25 1 changesets pruned
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
26 1 new orphan changesets
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
27 $ hg split -r 1 --no-interactive foosplit
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
28 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
29 reverting foo
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
30 adding foosplit
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
31 created new head
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
32 no more changes to split
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
33
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
34 $ hg update -r 2
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
35 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
36 working directory parent is obsolete! (5c9b6cf2edc5)
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
37 (use 'hg evolve' to update to its parent successor)
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
38
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
39 $ hg log -G
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
40 o changeset: 5:983ec6453b57
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
41 | tag: tip
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
42 | user: test
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
43 | date: Thu Jan 01 00:00:00 1970 +0000
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
44 | summary: r1_splitme
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
45 |
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
46 o changeset: 4:9ca7a4996099
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
47 | parent: 0:e9326971c0ba
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
48 | user: test
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
49 | date: Thu Jan 01 00:00:00 1970 +0000
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
50 | summary: r1_splitme
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
51 |
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
52 | * changeset: 3:c1e686af368d
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
53 | | user: test
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
54 | | date: Thu Jan 01 00:00:00 1970 +0000
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
55 | | instability: orphan
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
56 | | summary: r3
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
57 | |
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
58 | @ changeset: 2:5c9b6cf2edc5
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
59 | | user: test
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
60 | | date: Thu Jan 01 00:00:00 1970 +0000
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
61 | | obsolete: pruned using prune
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
62 | | summary: r2_obsoleteme
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
63 | |
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
64 | x changeset: 1:acdff8eea54c
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
65 |/ user: test
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
66 | date: Thu Jan 01 00:00:00 1970 +0000
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
67 | obsolete: split using split as 4:9ca7a4996099, 5:983ec6453b57
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
68 | summary: r1_splitme
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
69 |
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
70 o changeset: 0:e9326971c0ba
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
71 user: test
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
72 date: Thu Jan 01 00:00:00 1970 +0000
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
73 summary: r0
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
74
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
75
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
76 handling obsolete wdp works
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
77
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
78 $ hg evolve
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
79 update:[5] r1_splitme
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
80 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
81 working directory is now at 983ec6453b57
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
82
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
83 stabilizing the orphan works
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
84
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
85 $ hg evolve
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
86 move:[3] r3
17ffdea0edbb evolve: look for split successors of the correct ancestor (issue6648)
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
87 atop:[5] r1_splitme