comparison tests/test-evolve-content-divergent-stack.t @ 4490:7a5c6109ee84

branching: merge with test consolidation Conflict were simple once isolated.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 10 Apr 2019 16:59:28 +0200
parents tests/test-evolve-content-divergence.t@819bad275701 tests/test-evolve-content-divergence.t@d02a7c8cdee5
children 7a779a288793 bcd52ce0916d
comparison
equal deleted inserted replaced
4489:818e8190e867 4490:7a5c6109ee84
1 =================================================
2 Tests the resolution of content divergence: stack
3 =================================================
4
5 This file intend to cover case with stacks of divergent changesets
6
7 $ cat >> $HGRCPATH <<EOF
8 > [alias]
9 > glog = log -GT "{rev}:{node|short} {desc|firstline}\n ({bookmarks}) [{branch}] {phase}"
10 > [phases]
11 > publish = False
12 > [extensions]
13 > rebase =
14 > EOF
15 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
16
17 Resolving content-divergence of a stack with same parents
18 ---------------------------------------------------------
19
20 $ hg init stacktest
21 $ cd stacktest
22 $ echo ".*\.orig" > .hgignore
23 $ hg add .hgignore
24 $ hg ci -m "added hgignore"
25 $ for ch in a b c d; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done;
26
27 $ hg glog
28 @ 4:c41c793e0ef1 added d
29 | () [default] draft
30 o 3:ca1b80f7960a added c
31 | () [default] draft
32 o 2:b1661037fa25 added b
33 | () [default] draft
34 o 1:c7586e2a9264 added a
35 | () [default] draft
36 o 0:8fa14d15e168 added hgignore
37 () [default] draft
38
39 $ cd ..
40 $ hg init stack2
41 $ cd stack2
42 $ hg pull ../stacktest
43 pulling from ../stacktest
44 requesting all changes
45 adding changesets
46 adding manifests
47 adding file changes
48 added 5 changesets with 5 changes to 5 files
49 new changesets 8fa14d15e168:c41c793e0ef1 (5 drafts)
50 (run 'hg update' to get a working copy)
51 $ hg glog
52 o 4:c41c793e0ef1 added d
53 | () [default] draft
54 o 3:ca1b80f7960a added c
55 | () [default] draft
56 o 2:b1661037fa25 added b
57 | () [default] draft
58 o 1:c7586e2a9264 added a
59 | () [default] draft
60 o 0:8fa14d15e168 added hgignore
61 () [default] draft
62
63 $ hg up c7586e2a9264
64 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 $ echo bar > a
66 $ hg amend -m "watbar to a"
67 3 new orphan changesets
68 $ echo wat > a
69 $ hg amend -m "watbar to a"
70 $ hg evolve --all
71 move:[2] added b
72 atop:[6] watbar to a
73 move:[3] added c
74 move:[4] added d
75 working directory is now at 15c781f93cac
76 $ hg glog
77 @ 9:15c781f93cac added d
78 | () [default] draft
79 o 8:9e5fb1d5b955 added c
80 | () [default] draft
81 o 7:88516dccf68a added b
82 | () [default] draft
83 o 6:82b74d5dc678 watbar to a
84 | () [default] draft
85 o 0:8fa14d15e168 added hgignore
86 () [default] draft
87
88 $ cd ../stacktest
89 $ hg up .^^^
90 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
91 $ echo wat > a
92 $ hg amend -m "watbar to a"
93 3 new orphan changesets
94 $ hg evolve --all
95 move:[2] added b
96 atop:[5] watbar to a
97 move:[3] added c
98 move:[4] added d
99 working directory is now at c72d2885eb51
100 $ hg glog
101 @ 8:c72d2885eb51 added d
102 | () [default] draft
103 o 7:3ce4be6d8e5e added c
104 | () [default] draft
105 o 6:d5f148423c16 added b
106 | () [default] draft
107 o 5:8e222f257bbf watbar to a
108 | () [default] draft
109 o 0:8fa14d15e168 added hgignore
110 () [default] draft
111
112 $ hg pull ../stack2
113 pulling from ../stack2
114 searching for changes
115 adding changesets
116 adding manifests
117 adding file changes
118 added 4 changesets with 0 changes to 4 files (+1 heads)
119 5 new obsolescence markers
120 8 new content-divergent changesets
121 new changesets 82b74d5dc678:15c781f93cac (4 drafts)
122 (run 'hg heads' to see heads, 'hg merge' to merge)
123
124 $ hg glog
125 * 12:15c781f93cac added d
126 | () [default] draft
127 * 11:9e5fb1d5b955 added c
128 | () [default] draft
129 * 10:88516dccf68a added b
130 | () [default] draft
131 * 9:82b74d5dc678 watbar to a
132 | () [default] draft
133 | @ 8:c72d2885eb51 added d
134 | | () [default] draft
135 | * 7:3ce4be6d8e5e added c
136 | | () [default] draft
137 | * 6:d5f148423c16 added b
138 | | () [default] draft
139 | * 5:8e222f257bbf watbar to a
140 |/ () [default] draft
141 o 0:8fa14d15e168 added hgignore
142 () [default] draft
143
144 $ hg evolve --all --content-divergent
145 merge:[5] watbar to a
146 with: [9] watbar to a
147 base: [1] added a
148 updating to "local" side of the conflict: 8e222f257bbf
149 merging "other" content-divergent changeset '82b74d5dc678'
150 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
151 6 new orphan changesets
152 merge:[6] added b
153 with: [10] added b
154 base: [2] added b
155 updating to "local" side of the conflict: d5f148423c16
156 merging "other" content-divergent changeset '88516dccf68a'
157 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 merge:[7] added c
159 with: [11] added c
160 base: [3] added c
161 updating to "local" side of the conflict: 3ce4be6d8e5e
162 merging "other" content-divergent changeset '9e5fb1d5b955'
163 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
164 merge:[8] added d
165 with: [12] added d
166 base: [4] added d
167 updating to "local" side of the conflict: c72d2885eb51
168 merging "other" content-divergent changeset '15c781f93cac'
169 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 working directory is now at 038fe7db3d88
171
172 $ hg glog
173 @ 16:038fe7db3d88 added d
174 | () [default] draft
175 o 15:b2cac10f3836 added c
176 | () [default] draft
177 o 14:eadfd9d70680 added b
178 | () [default] draft
179 o 13:f66f262fff6c watbar to a
180 | () [default] draft
181 o 0:8fa14d15e168 added hgignore
182 () [default] draft
183 Resolving content-divergence of a stack with different parents
184 ---------------------------------------------------------
185
186 $ cd ..
187 $ hg init stackrepo1
188 $ cd stackrepo1
189 $ echo ".*\.orig" > .hgignore
190 $ hg add .hgignore
191 $ hg ci -m "added hgignore"
192
193 $ for ch in a b c d;
194 > do echo foo > $ch;
195 > hg add $ch;
196 > hg ci -qm "added "$ch;
197 > done;
198
199 $ hg glog
200 @ 4:c41c793e0ef1 added d
201 | () [default] draft
202 o 3:ca1b80f7960a added c
203 | () [default] draft
204 o 2:b1661037fa25 added b
205 | () [default] draft
206 o 1:c7586e2a9264 added a
207 | () [default] draft
208 o 0:8fa14d15e168 added hgignore
209 () [default] draft
210
211 $ cd ..
212 $ hg init stackrepo2
213 $ cd stackrepo2
214 $ hg pull ../stackrepo1
215 pulling from ../stackrepo1
216 requesting all changes
217 adding changesets
218 adding manifests
219 adding file changes
220 added 5 changesets with 5 changes to 5 files
221 new changesets 8fa14d15e168:c41c793e0ef1 (5 drafts)
222 (run 'hg update' to get a working copy)
223
224 $ hg glog
225 o 4:c41c793e0ef1 added d
226 | () [default] draft
227 o 3:ca1b80f7960a added c
228 | () [default] draft
229 o 2:b1661037fa25 added b
230 | () [default] draft
231 o 1:c7586e2a9264 added a
232 | () [default] draft
233 o 0:8fa14d15e168 added hgignore
234 () [default] draft
235
236 $ hg up 8fa14d15e168
237 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
238 $ echo newfile > newfile
239 $ hg ci -Am "add newfile"
240 adding newfile
241 created new head
242 $ hg rebase -s c7586e2a9264 -d .
243 rebasing 1:c7586e2a9264 "added a"
244 rebasing 2:b1661037fa25 "added b"
245 rebasing 3:ca1b80f7960a "added c"
246 rebasing 4:c41c793e0ef1 "added d"
247
248 $ hg glog
249 o 9:d45f050514c2 added d
250 | () [default] draft
251 o 8:8ed612937375 added c
252 | () [default] draft
253 o 7:6eb54b5af3fb added b
254 | () [default] draft
255 o 6:c04ff147ef79 added a
256 | () [default] draft
257 @ 5:2228e3b74514 add newfile
258 | () [default] draft
259 o 0:8fa14d15e168 added hgignore
260 () [default] draft
261
262 $ cd ../stackrepo1
263 $ hg up .^^^
264 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
265 $ echo wat > a
266 $ hg amend -m "watbar to a"
267 3 new orphan changesets
268 $ hg evolve --all
269 move:[2] added b
270 atop:[5] watbar to a
271 move:[3] added c
272 move:[4] added d
273 working directory is now at c72d2885eb51
274
275 $ hg glog
276 @ 8:c72d2885eb51 added d
277 | () [default] draft
278 o 7:3ce4be6d8e5e added c
279 | () [default] draft
280 o 6:d5f148423c16 added b
281 | () [default] draft
282 o 5:8e222f257bbf watbar to a
283 | () [default] draft
284 o 0:8fa14d15e168 added hgignore
285 () [default] draft
286
287 $ hg pull ../stackrepo2
288 pulling from ../stackrepo2
289 searching for changes
290 adding changesets
291 adding manifests
292 adding file changes
293 added 5 changesets with 1 changes to 5 files (+1 heads)
294 4 new obsolescence markers
295 8 new content-divergent changesets
296 new changesets 2228e3b74514:d45f050514c2 (5 drafts)
297 (run 'hg heads' to see heads, 'hg merge' to merge)
298
299 $ hg glog
300 * 13:d45f050514c2 added d
301 | () [default] draft
302 * 12:8ed612937375 added c
303 | () [default] draft
304 * 11:6eb54b5af3fb added b
305 | () [default] draft
306 * 10:c04ff147ef79 added a
307 | () [default] draft
308 o 9:2228e3b74514 add newfile
309 | () [default] draft
310 | @ 8:c72d2885eb51 added d
311 | | () [default] draft
312 | * 7:3ce4be6d8e5e added c
313 | | () [default] draft
314 | * 6:d5f148423c16 added b
315 | | () [default] draft
316 | * 5:8e222f257bbf watbar to a
317 |/ () [default] draft
318 o 0:8fa14d15e168 added hgignore
319 () [default] draft
320
321 $ hg evolve --all --content-divergent
322 merge:[10] added a
323 with: [5] watbar to a
324 base: [1] added a
325 rebasing "other" content-divergent changeset 8e222f257bbf on 2228e3b74514
326 updating to "local" side of the conflict: c04ff147ef79
327 merging "other" content-divergent changeset '186bdc2cdfa2'
328 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
329 6 new orphan changesets
330 merge:[11] added b
331 with: [6] added b
332 base: [2] added b
333 rebasing "other" content-divergent changeset d5f148423c16 on c04ff147ef79
334 updating to "local" side of the conflict: 6eb54b5af3fb
335 merging "other" content-divergent changeset '8542f15656e7'
336 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
337 merge:[12] added c
338 with: [7] added c
339 base: [3] added c
340 rebasing "other" content-divergent changeset 3ce4be6d8e5e on 6eb54b5af3fb
341 updating to "local" side of the conflict: 8ed612937375
342 merging "other" content-divergent changeset 'a690ce53104a'
343 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
344 merge:[13] added d
345 with: [8] added d
346 base: [4] added d
347 rebasing "other" content-divergent changeset c72d2885eb51 on 8ed612937375
348 updating to "local" side of the conflict: d45f050514c2
349 merging "other" content-divergent changeset '1d1772990a3b'
350 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
351 working directory is now at 5f7a38bdb75c
352
353 $ hg glog
354 @ 21:5f7a38bdb75c added d
355 | () [default] draft
356 o 19:9865d598f0e0 added c
357 | () [default] draft
358 o 17:ac70b8c8eb63 added b
359 | () [default] draft
360 o 15:74fbf3e6a0b6 watbar to a
361 | () [default] draft
362 o 9:2228e3b74514 add newfile
363 | () [default] draft
364 o 0:8fa14d15e168 added hgignore
365 () [default] draft
366 $ cd ..