annotate tests/test-evolve-content-divergent-case-A2.t @ 6935:954d7ea5cd67 stable tip

stack: when stack base is obsolete, pick any successor, even if at random There are situations when s0 is obsolete and we also cannot pick just one successor for it to use in stack. In such a case, let's pick the "latest" successor from the first set. We're assuming that obsutil.successorssets() returns data in the same order (it should, since it makes sure to sort data internally). Keeping that in mind, while the successor picked for s0 by this code is not based on any sort of sophisticated logic, it should nonetheless be the same every time. This patch is probably not going to completely break anything that was previously working fine, because the previous behavior was to just abort with an exception.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 16 Nov 2024 17:01:02 +0400
parents 3216855846dd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5390
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
1 ===============================================
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
2 Testing content-divergence resolution: Case A.2
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
3 ===============================================
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
4
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
5 Independent rewrites of same changeset can lead to content-divergence. In most
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
6 common cases, it can occur when multiple users rewrite the same changeset
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
7 independently and push it.
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
8
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
9 This test belongs to a series of tests checking the resolution of content-divergent
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
10 changesets.
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
11
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
12 Category A: no parents are obsolete
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
13 Testcase 2: no conflict: both sides amended content changes (non-conflicting changes in same file)
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
14
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
15 A.2 both sides amended content changes
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
16 ======================================
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
17
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
18 .. (Divergence reason):
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
19 .. local: amended some content changes in same file as "other" but non-conflicting
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
20 .. other: amended some content changes in same file as "local" but non-conflicting
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
21 .. Where we show that since both side amended some content changes without any relocation,
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
22 .. the most reasonable behaviour is to simply perform 3-way merge.
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
23 ..
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
24 .. (local):
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
25 ..
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
26 .. A ø⇠○ A'
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
27 .. |/
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
28 .. ● O
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
29 ..
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
30 .. (other):
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
31 ..
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
32 .. A ø⇠○ A''
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
33 .. |/
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
34 .. ● O
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
35 ..
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
36 .. (Resolution):
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
37 ..
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
38 .. ○ A'''
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
39 .. |
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
40 .. ● O
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
41 ..
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
42
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
43 Setup
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
44 -----
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
45 $ . $TESTDIR/testlib/content-divergence-util.sh
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
46 $ setuprepos A.2
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
47 creating test repo for test case A.2
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
48 - upstream
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
49 - local
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
50 - other
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
51 cd into `local` and proceed with env setup
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
52
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
53 initial
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
54
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
55 $ cd local
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
56 $ mkcommit A0
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
57 $ hg push -q
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
58 $ sed -i '1ifoo' A0
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
59 $ hg amend -m "A1"
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
60 $ hg log -G --hidden
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
61 @ 2:e1f7c24563ba (draft): A1
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
62 |
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
63 | x 1:28b51eb45704 (draft): A0
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
64 |/
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
65 o 0:a9bdc8b26820 (public): O
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
66
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
67 $ cd ../other
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
68 $ hg pull -uq
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
69 $ echo bar >> A0
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
70 $ hg amend
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
71 $ hg push -q
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
72
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
73 $ cd ../local
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
74 $ hg pull -q
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
75 2 new content-divergent changesets
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
76
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
77 Actual test of resolution
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
78 -------------------------
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
79 $ hg evolve -l
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
80 e1f7c24563ba: A1
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
81 content-divergent: 5fbe90f37421 (draft) (precursor 28b51eb45704)
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
82
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
83 5fbe90f37421: A0
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
84 content-divergent: e1f7c24563ba (draft) (precursor 28b51eb45704)
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
85
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
86 $ hg log -G --hidden
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
87 * 3:5fbe90f37421 (draft): A0 [content-divergent]
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
88 |
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
89 | @ 2:e1f7c24563ba (draft): A1 [content-divergent]
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
90 |/
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
91 | x 1:28b51eb45704 (draft): A0
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
92 |/
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
93 o 0:a9bdc8b26820 (public): O
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
94
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
95
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
96 $ hg evolve --content-divergent
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
97 merge:[2] A1
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
98 with: [3] A0
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
99 base: [1] A0
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
100 merging A0
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
101 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
102 working directory is now at 414367a5568a
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
103
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
104 $ hg log -Gp
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
105 @ 4:414367a5568a (draft): A1
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
106 | diff -r a9bdc8b26820 -r 414367a5568a A0
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
107 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
108 | +++ b/A0 Thu Jan 01 00:00:00 1970 +0000
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
109 | @@ -0,0 +1,3 @@
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
110 | +foo
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
111 | +A0
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
112 | +bar
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
113 |
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
114 o 0:a9bdc8b26820 (public): O
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
115 diff -r 000000000000 -r a9bdc8b26820 O
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
116 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
117 +++ b/O Thu Jan 01 00:00:00 1970 +0000
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
118 @@ -0,0 +1,1 @@
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
119 +O
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
120
3216855846dd evolve: add test coverage for content-div case A2
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
121 $ hg evolve -l