Mercurial > evolve
comparison tests/test-evolve-content-divergent-case-B1.t @ 5784:43a5371fa669
divergence-resolution: add support and doc for a special case in divergence
Changes in troubles-handling.rst explains the special case in details and
also speak about what is the default behavior and how to change it.
author | Sushil khanchi <sushilkhanchi97@gmail.com> |
---|---|
date | Thu, 18 Feb 2021 23:37:41 +0530 |
parents | |
children | 53d63b608230 |
comparison
equal
deleted
inserted
replaced
5783:c5c879fed91c | 5784:43a5371fa669 |
---|---|
1 =============================================== | |
2 Testing content-divergence resolution: Case B.1 | |
3 =============================================== | |
4 | |
5 Independent rewrites of same changeset can lead to content-divergence. In most | |
6 common cases, it can occur when multiple users rewrite the same changeset | |
7 independently and push it. | |
8 | |
9 This test belongs to a series of tests checking the resolution of content-divergent | |
10 changesets. | |
11 | |
12 Category B: parents are obsolete | |
13 Testcase 1: one side amended changes and other rebased to in-between successor of basep1 | |
14 Variants: | |
15 # a: default resolution | |
16 # b: minimal resolution using `experimental.evolution.divergence-resolution-minimal=True` | |
17 | |
18 B.1 Relocated backward; Rebased to parent's successor | |
19 ===================================================== | |
20 | |
21 .. (Divergence reason): | |
22 .. local: rebased to the 'in-between' successor of basep1 | |
23 .. other: amended some changes | |
24 .. The default resolution here is that we choose the final successor as resolution parent, | |
25 .. but this behavior can be changed to use the 'in-between' successor as resolution parent | |
26 .. by using a config option `experimental.evolution.divergence-resolution-minimal=True` | |
27 .. | |
28 .. This test case is considered complicated and can change its behavior acc. to the user | |
29 .. feedback. For more, please look at section 'D-A3.1' in troubles-handling.rst | |
30 .. | |
31 .. (local): | |
32 .. | |
33 .. B ø → ○ B' | |
34 .. | | | |
35 .. A ø → ø A' → ○ A'' | |
36 .. | | | | |
37 .. |---- | | |
38 .. |----------- | |
39 .. | | |
40 .. O ● | |
41 .. | |
42 .. (other): | |
43 .. | |
44 .. B ø→○ B' | |
45 .. | / | |
46 .. A ○ | |
47 .. | | |
48 .. O ● | |
49 .. | |
50 .. (Resolution): | |
51 .. | |
52 .. ○ B''' | |
53 .. | | |
54 .. ○ A'' | |
55 .. | | |
56 .. ● O | |
57 .. | |
58 | |
59 Setup | |
60 ----- | |
61 $ . $TESTDIR/testlib/content-divergence-util.sh | |
62 $ setuprepos B.1 | |
63 creating test repo for test case B.1 | |
64 - upstream | |
65 - local | |
66 - other | |
67 cd into `local` and proceed with env setup | |
68 | |
69 initial | |
70 | |
71 $ cd upstream | |
72 $ mkcommit A | |
73 $ mkcommit B | |
74 $ cd ../local | |
75 $ hg pull -qu | |
76 $ hg prev | |
77 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
78 [1] A | |
79 $ echo fooA >> A | |
80 $ hg amend -m 'new_A' | |
81 1 new orphan changesets | |
82 $ hg evolve | |
83 move:[2] B | |
84 atop:[3] new_A | |
85 $ echo barA >> A | |
86 $ hg amend -m 'latest_A' | |
87 1 new orphan changesets | |
88 | |
89 $ cd ../other | |
90 $ hg pull -qu | |
91 $ echo fooB > B | |
92 $ hg amend -m 'new_B' | |
93 $ hg push -q | |
94 | |
95 $ cd ../local | |
96 $ hg push -fq | |
97 2 new orphan changesets | |
98 2 new content-divergent changesets | |
99 $ hg pull -q | |
100 1 new orphan changesets | |
101 2 new content-divergent changesets | |
102 | |
103 | |
104 Actual test of resolution | |
105 ------------------------- | |
106 | |
107 Variant_a: default resolution | |
108 ----------------------------- | |
109 $ hg evolve -l | |
110 429afd16ac76: B | |
111 orphan: 1ffcccee011c (obsolete parent) | |
112 content-divergent: 807cc2b37fb3 (draft) (precursor f6fbb35d8ac9) | |
113 | |
114 807cc2b37fb3: new_B | |
115 orphan: f5bc6836db60 (obsolete parent) | |
116 content-divergent: 429afd16ac76 (draft) (precursor f6fbb35d8ac9) | |
117 | |
118 $ hg log -G | |
119 * 6:807cc2b37fb3 (draft): new_B [orphan content-divergent] | |
120 | | |
121 | @ 5:45ed635c7cfc (draft): latest_A | |
122 | | | |
123 | | * 4:429afd16ac76 (draft): B [orphan content-divergent] | |
124 | | | | |
125 | | x 3:1ffcccee011c (draft): new_A | |
126 | |/ | |
127 x | 1:f5bc6836db60 (draft): A | |
128 |/ | |
129 o 0:a9bdc8b26820 (public): O | |
130 | |
131 $ hg evolve --content-divergent | |
132 merge:[4] B | |
133 with: [6] new_B | |
134 base: [2] B | |
135 rebasing "divergent" content-divergent changeset 429afd16ac76 on 45ed635c7cfc | |
136 rebasing "other" content-divergent changeset 807cc2b37fb3 on 45ed635c7cfc | |
137 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
138 | |
139 $ hg log -G | |
140 o 9:6f740085e668 (draft): new_B | |
141 | | |
142 @ 5:45ed635c7cfc (draft): latest_A | |
143 | | |
144 o 0:a9bdc8b26820 (public): O | |
145 | |
146 $ hg evolve -l | |
147 | |
148 | |
149 Variant_b: minimal resolution | |
150 ----------------------------- | |
151 | |
152 $ cd ../other | |
153 $ hg pull -q | |
154 2 new orphan changesets | |
155 2 new content-divergent changesets | |
156 $ hg evolve -l | |
157 807cc2b37fb3: new_B | |
158 orphan: f5bc6836db60 (obsolete parent) | |
159 content-divergent: 429afd16ac76 (draft) (precursor f6fbb35d8ac9) | |
160 | |
161 429afd16ac76: B | |
162 orphan: 1ffcccee011c (obsolete parent) | |
163 content-divergent: 807cc2b37fb3 (draft) (precursor f6fbb35d8ac9) | |
164 | |
165 $ hg log -G | |
166 o 6:45ed635c7cfc (draft): latest_A | |
167 | | |
168 | * 5:429afd16ac76 (draft): B [orphan content-divergent] | |
169 | | | |
170 | x 4:1ffcccee011c (draft): new_A | |
171 |/ | |
172 | @ 3:807cc2b37fb3 (draft): new_B [orphan content-divergent] | |
173 | | | |
174 | x 1:f5bc6836db60 (draft): A | |
175 |/ | |
176 o 0:a9bdc8b26820 (public): O | |
177 | |
178 $ hg evolve --content-divergent --config experimental.evolution.divergence-resolution-minimal=True | |
179 merge:[3] new_B | |
180 with: [5] B | |
181 base: [2] B | |
182 rebasing "divergent" content-divergent changeset 807cc2b37fb3 on 1ffcccee011c | |
183 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
184 working directory is now at 2431e876af63 | |
185 | |
186 $ hg log -G | |
187 @ 8:2431e876af63 (draft): new_B [orphan] | |
188 | | |
189 | o 6:45ed635c7cfc (draft): latest_A | |
190 | | | |
191 x | 4:1ffcccee011c (draft): new_A | |
192 |/ | |
193 o 0:a9bdc8b26820 (public): O | |
194 | |
195 $ hg evolve -l | |
196 2431e876af63: new_B | |
197 orphan: 1ffcccee011c (obsolete parent) | |
198 |