comparison tests/test-evolve-public-content-divergent-mergingleadstopublic.t @ 4530:d081cc4f5fef

tests: consolidate the public-content-divergent test cases This commit move the public-content-divergent tests in dedicated test files.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Wed, 17 Apr 2019 00:20:44 +0530
parents tests/test-evolve-public-content-divergent.t@14437b18b024
children
comparison
equal deleted inserted replaced
4529:e0eaa33a1f8a 4530:d081cc4f5fef
1 ===============================================================================
2 Tests the resolution of public content divergence: when merging leads to public
3 ===============================================================================
4
5 This file intend to cover all the cases possible when merging the other
6 divergent cset into public cset leads to public cset itself.
7 Possible variants are:
8
9 parent: same/different
10 relocation: [no-]conflict
11 merging: [no-]conflict
12
13 Setup
14 =====
15 $ cat >> $HGRCPATH <<EOF
16 > [alias]
17 > glog = log -GT "{rev}:{node|short} {desc|firstline}\n {phase} {troubles}\n\n"
18 > [phases]
19 > publish = False
20 > [extensions]
21 > rebase =
22 > EOF
23 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
24
25 Testing when same parent, no conflict:
26 --------------------------------------
27
28 $ hg init pubdiv1
29 $ cd pubdiv1
30 $ for ch in a b c; do
31 > echo $ch > $ch;
32 > hg ci -Am "added "$ch;
33 > done;
34 adding a
35 adding b
36 adding c
37
38 $ hg up .^
39 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
40 $ echo ch > ch
41 $ hg add ch
42 $ hg ci -m "added ch"
43 created new head
44
45 $ hg up .^
46 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
47 $ echo ch > ch
48 $ hg add ch
49 $ hg ci -m "added c"
50 created new head
51
52 $ hg glog
53 @ 4:f7c1071f1e7c added c
54 | draft
55 |
56 | o 3:90522bccf499 added ch
57 |/ draft
58 |
59 | o 2:155349b645be added c
60 |/ draft
61 |
62 o 1:5f6d8a4bf34a added b
63 | draft
64 |
65 o 0:9092f1db7931 added a
66 draft
67
68
69 $ hg prune 2 -s 3
70 1 changesets pruned
71 $ hg prune 2 -s 4 --hidden
72 1 changesets pruned
73 2 new content-divergent changesets
74 $ hg phase --public -r 4
75
76 $ hg glog
77 @ 4:f7c1071f1e7c added c
78 | public
79 |
80 | * 3:90522bccf499 added ch
81 |/ draft content-divergent
82 |
83 o 1:5f6d8a4bf34a added b
84 | public
85 |
86 o 0:9092f1db7931 added a
87 public
88
89 $ hg evolve --content-divergent --any
90 merge:[4] added c
91 with: [3] added ch
92 base: [2] added c
93 merging "other" content-divergent changeset '90522bccf499'
94 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 content-divergent changesets differ by descriptions only, discarding 90522bccf499
96
97 $ hg evolve -l
98
99 $ hg par
100 changeset: 4:f7c1071f1e7c
101 tag: tip
102 parent: 1:5f6d8a4bf34a
103 user: test
104 date: Thu Jan 01 00:00:00 1970 +0000
105 summary: added c
106
107 $ cd ..
108
109 Testing when different parent, no conflict:
110 -------------------------------------------
111
112 $ hg init pubdiv2
113 $ cd pubdiv2
114 $ for ch in a b c d; do
115 > echo $ch > $ch;
116 > hg ci -Am "added "$ch;
117 > done;
118 adding a
119 adding b
120 adding c
121 adding d
122
123 $ hg up 1
124 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
125 $ echo dh > dh
126 $ hg add dh
127 $ hg ci -m "added dh"
128 created new head
129
130 $ hg up 2
131 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
132 $ echo dh > dh
133 $ hg add dh
134 $ hg ci -m "added d"
135 created new head
136
137 $ hg glog
138 @ 5:e800202333a4 added d
139 | draft
140 |
141 | o 4:5acd58ef5066 added dh
142 | | draft
143 | |
144 +---o 3:9150fe93bec6 added d
145 | | draft
146 | |
147 o | 2:155349b645be added c
148 |/ draft
149 |
150 o 1:5f6d8a4bf34a added b
151 | draft
152 |
153 o 0:9092f1db7931 added a
154 draft
155
156
157 $ hg prune 3 -s 4
158 1 changesets pruned
159 $ hg prune 3 -s 5 --hidden
160 1 changesets pruned
161 2 new content-divergent changesets
162 $ hg phase --public -r 5
163
164 $ hg glog
165 @ 5:e800202333a4 added d
166 | public
167 |
168 | * 4:5acd58ef5066 added dh
169 | | draft content-divergent
170 | |
171 o | 2:155349b645be added c
172 |/ public
173 |
174 o 1:5f6d8a4bf34a added b
175 | public
176 |
177 o 0:9092f1db7931 added a
178 public
179
180 $ hg evolve --content-divergent --any
181 merge:[5] added d
182 with: [4] added dh
183 base: [3] added d
184 rebasing "other" content-divergent changeset 5acd58ef5066 on 155349b645be
185 updating to "local" side of the conflict: e800202333a4
186 merging "other" content-divergent changeset 'ae3429430ef1'
187 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 content-divergent changesets differ by descriptions only, discarding ae3429430ef1
189
190 $ hg evolve -l
191
192 $ hg par
193 changeset: 5:e800202333a4
194 tag: tip
195 parent: 2:155349b645be
196 user: test
197 date: Thu Jan 01 00:00:00 1970 +0000
198 summary: added d
199
200 $ cd ..
201
202 Testing when same parent, merging conflict:
203 -------------------------------------------
204
205 $ hg init pubdiv3
206 $ cd pubdiv3
207 $ for ch in a b c; do
208 > echo $ch > $ch;
209 > hg ci -Am "added "$ch;
210 > done;
211 adding a
212 adding b
213 adding c
214
215 $ hg up .^
216 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
217 $ echo chconflict > ch
218 $ hg add ch
219 $ hg ci -m "added ch"
220 created new head
221
222 $ hg up .^
223 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
224 $ echo ch > ch
225 $ hg add ch
226 $ hg ci -m "added c"
227 created new head
228
229 $ hg glog
230 @ 4:f7c1071f1e7c added c
231 | draft
232 |
233 | o 3:229da2719b19 added ch
234 |/ draft
235 |
236 | o 2:155349b645be added c
237 |/ draft
238 |
239 o 1:5f6d8a4bf34a added b
240 | draft
241 |
242 o 0:9092f1db7931 added a
243 draft
244
245
246 $ hg prune 2 -s 3
247 1 changesets pruned
248 $ hg prune 2 -s 4 --hidden
249 1 changesets pruned
250 2 new content-divergent changesets
251 $ hg phase --public -r 4
252
253 $ hg glog
254 @ 4:f7c1071f1e7c added c
255 | public
256 |
257 | * 3:229da2719b19 added ch
258 |/ draft content-divergent
259 |
260 o 1:5f6d8a4bf34a added b
261 | public
262 |
263 o 0:9092f1db7931 added a
264 public
265
266 $ hg evolve --content-divergent --any
267 merge:[4] added c
268 with: [3] added ch
269 base: [2] added c
270 merging "other" content-divergent changeset '229da2719b19'
271 merging ch
272 warning: conflicts while merging ch! (edit, then use 'hg resolve --mark')
273 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
274 fix conflicts and see `hg help evolve.interrupted`
275 [1]
276
277 $ hg diff
278 diff -r f7c1071f1e7c ch
279 --- a/ch Thu Jan 01 00:00:00 1970 +0000
280 +++ b/ch Thu Jan 01 00:00:00 1970 +0000
281 @@ -1,1 +1,5 @@
282 +<<<<<<< local: f7c1071f1e7c - test: added c
283 ch
284 +=======
285 +chconflict
286 +>>>>>>> other: 229da2719b19 - test: added ch
287
288 $ echo ch > ch
289 $ hg res -m
290 (no more unresolved files)
291 continue: hg evolve --continue
292
293 $ hg evolve --continue
294 content-divergent changesets differ by descriptions only, discarding 229da2719b19
295 working directory is now at f7c1071f1e7c
296
297 $ hg evolve -l
298
299 $ hg par
300 changeset: 4:f7c1071f1e7c
301 tag: tip
302 parent: 1:5f6d8a4bf34a
303 user: test
304 date: Thu Jan 01 00:00:00 1970 +0000
305 summary: added c
306
307 $ cd ..
308
309 Testing when different parent, relocation conflict:
310 ---------------------------------------------------
311
312 $ hg init pubdiv4
313 $ cd pubdiv4
314 $ for ch in a b c d; do
315 > echo $ch > $ch;
316 > hg ci -Am "added "$ch;
317 > done;
318 adding a
319 adding b
320 adding c
321 adding d
322
323 $ hg up 1
324 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
325 $ echo dh > dh
326 $ echo cc > c
327 $ hg add dh c
328 $ hg ci -m "added dh"
329 created new head
330
331 $ hg up 2
332 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
333 $ echo dh > dh
334 $ hg add dh
335 $ hg ci -m "added d"
336 created new head
337
338 $ hg glog
339 @ 5:e800202333a4 added d
340 | draft
341 |
342 | o 4:f89a8e2f86ac added dh
343 | | draft
344 | |
345 +---o 3:9150fe93bec6 added d
346 | | draft
347 | |
348 o | 2:155349b645be added c
349 |/ draft
350 |
351 o 1:5f6d8a4bf34a added b
352 | draft
353 |
354 o 0:9092f1db7931 added a
355 draft
356
357
358 $ hg prune 3 -s 4
359 1 changesets pruned
360 $ hg prune 3 -s 5 --hidden
361 1 changesets pruned
362 2 new content-divergent changesets
363 $ hg phase --public -r 5
364
365 $ hg glog
366 @ 5:e800202333a4 added d
367 | public
368 |
369 | * 4:f89a8e2f86ac added dh
370 | | draft content-divergent
371 | |
372 o | 2:155349b645be added c
373 |/ public
374 |
375 o 1:5f6d8a4bf34a added b
376 | public
377 |
378 o 0:9092f1db7931 added a
379 public
380
381 $ hg evolve --content-divergent --any
382 merge:[5] added d
383 with: [4] added dh
384 base: [3] added d
385 rebasing "other" content-divergent changeset f89a8e2f86ac on 155349b645be
386 merging c
387 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
388 fix conflicts and see `hg help evolve.interrupted`
389 [1]
390
391 $ echo c > c
392 $ hg res -m
393 (no more unresolved files)
394 continue: hg evolve --continue
395
396 $ hg evolve --continue
397 evolving 4:f89a8e2f86ac "added dh"
398 updating to "local" side of the conflict: e800202333a4
399 merging "other" content-divergent changeset 'bc309da55b88'
400 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
401 content-divergent changesets differ by descriptions only, discarding bc309da55b88
402 working directory is now at e800202333a4
403
404 $ hg evolve -l
405
406 $ hg par
407 changeset: 5:e800202333a4
408 tag: tip
409 parent: 2:155349b645be
410 user: test
411 date: Thu Jan 01 00:00:00 1970 +0000
412 summary: added d
413
414 $ cd ..
415
416 Testing when different parent, merging conflict:
417 ------------------------------------------------
418
419 $ hg init pubdiv5
420 $ cd pubdiv5
421 $ for ch in a b c d; do
422 > echo $ch > $ch;
423 > hg ci -Am "added "$ch;
424 > done;
425 adding a
426 adding b
427 adding c
428 adding d
429
430 $ hg up 1
431 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
432 $ echo dhconflict > dh
433 $ hg add dh
434 $ hg ci -m "added dh"
435 created new head
436
437 $ hg up 2
438 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
439 $ echo dh > dh
440 $ hg add dh
441 $ hg ci -m "added d"
442 created new head
443
444 $ hg glog
445 @ 5:e800202333a4 added d
446 | draft
447 |
448 | o 4:db0b7bba0aae added dh
449 | | draft
450 | |
451 +---o 3:9150fe93bec6 added d
452 | | draft
453 | |
454 o | 2:155349b645be added c
455 |/ draft
456 |
457 o 1:5f6d8a4bf34a added b
458 | draft
459 |
460 o 0:9092f1db7931 added a
461 draft
462
463
464 $ hg prune 3 -s 4
465 1 changesets pruned
466 $ hg prune 3 -s 5 --hidden
467 1 changesets pruned
468 2 new content-divergent changesets
469 $ hg phase --public -r 5
470
471 $ hg glog
472 @ 5:e800202333a4 added d
473 | public
474 |
475 | * 4:db0b7bba0aae added dh
476 | | draft content-divergent
477 | |
478 o | 2:155349b645be added c
479 |/ public
480 |
481 o 1:5f6d8a4bf34a added b
482 | public
483 |
484 o 0:9092f1db7931 added a
485 public
486
487 $ hg evolve --content-divergent --any
488 merge:[5] added d
489 with: [4] added dh
490 base: [3] added d
491 rebasing "other" content-divergent changeset db0b7bba0aae on 155349b645be
492 updating to "local" side of the conflict: e800202333a4
493 merging "other" content-divergent changeset 'a5bbf2042450'
494 merging dh
495 warning: conflicts while merging dh! (edit, then use 'hg resolve --mark')
496 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
497 fix conflicts and see `hg help evolve.interrupted`
498 [1]
499
500 $ echo dh > dh
501 $ hg res -m
502 (no more unresolved files)
503 continue: hg evolve --continue
504
505 $ hg evolve --continue
506 content-divergent changesets differ by descriptions only, discarding a5bbf2042450
507 working directory is now at e800202333a4
508
509 $ hg evolve -l
510
511 $ hg par
512 changeset: 5:e800202333a4
513 tag: tip
514 parent: 2:155349b645be
515 user: test
516 date: Thu Jan 01 00:00:00 1970 +0000
517 summary: added d
518
519 $ cd ..
520
521 Testing when different parent, conflict in relocation and merging:
522 ------------------------------------------------------------------
523
524 $ hg init pubdiv6
525 $ cd pubdiv6
526 $ for ch in a b c d; do
527 > echo $ch > $ch;
528 > hg ci -Am "added "$ch;
529 > done;
530 adding a
531 adding b
532 adding c
533 adding d
534
535 $ hg up 1
536 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
537 $ echo dhconflict > dh
538 $ echo cc > c
539 $ hg add dh c
540 $ hg ci -m "added dh"
541 created new head
542
543 $ hg up 2
544 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
545 $ echo dh > dh
546 $ hg add dh
547 $ hg ci -m "added d"
548 created new head
549
550 $ hg glog
551 @ 5:e800202333a4 added d
552 | draft
553 |
554 | o 4:67b19bbd770f added dh
555 | | draft
556 | |
557 +---o 3:9150fe93bec6 added d
558 | | draft
559 | |
560 o | 2:155349b645be added c
561 |/ draft
562 |
563 o 1:5f6d8a4bf34a added b
564 | draft
565 |
566 o 0:9092f1db7931 added a
567 draft
568
569
570 $ hg prune 3 -s 4
571 1 changesets pruned
572 $ hg prune 3 -s 5 --hidden
573 1 changesets pruned
574 2 new content-divergent changesets
575 $ hg phase --public -r 5
576
577 $ hg glog
578 @ 5:e800202333a4 added d
579 | public
580 |
581 | * 4:67b19bbd770f added dh
582 | | draft content-divergent
583 | |
584 o | 2:155349b645be added c
585 |/ public
586 |
587 o 1:5f6d8a4bf34a added b
588 | public
589 |
590 o 0:9092f1db7931 added a
591 public
592
593 $ hg evolve --content-divergent --any
594 merge:[5] added d
595 with: [4] added dh
596 base: [3] added d
597 rebasing "other" content-divergent changeset 67b19bbd770f on 155349b645be
598 merging c
599 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
600 fix conflicts and see `hg help evolve.interrupted`
601 [1]
602
603 $ echo c > c
604 $ hg res -m
605 (no more unresolved files)
606 continue: hg evolve --continue
607
608 $ hg evolve --continue
609 evolving 4:67b19bbd770f "added dh"
610 updating to "local" side of the conflict: e800202333a4
611 merging "other" content-divergent changeset '09054d1f3c97'
612 merging dh
613 warning: conflicts while merging dh! (edit, then use 'hg resolve --mark')
614 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
615 fix conflicts and see `hg help evolve.interrupted`
616 [1]
617
618 $ echo dh > dh
619 $ hg res -m
620 (no more unresolved files)
621 continue: hg evolve --continue
622
623 $ hg evolve --continue
624 content-divergent changesets differ by descriptions only, discarding 09054d1f3c97
625 working directory is now at e800202333a4
626
627 $ hg evolve -l
628
629 $ hg par
630 changeset: 5:e800202333a4
631 tag: tip
632 parent: 2:155349b645be
633 user: test
634 date: Thu Jan 01 00:00:00 1970 +0000
635 summary: added d
636
637 $ cd ..