comparison tests/test-push-checkheads-pruned-B5.t @ 32012:413c731f5475

obsolescence: add test for the "branch replacement" logic during push, case B5 Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This changeset adds test for the improved "branch replacement" logic introduce in an earlier commits. This tests initially lived in the evolve extensions. Since we now have the code handling this logic in core, it make sense to have the tests in core too. See inline documentation for details about the test case added in this changeset.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sat, 15 Apr 2017 02:53:31 +0200
parents
children 53b3a1968aa6
comparison
equal deleted inserted replaced
32011:698623950bf5 32012:413c731f5475
1 ====================================
2 Testing head checking code: Case B-5
3 ====================================
4
5 Mercurial checks for the introduction of new heads on push. Evolution comes
6 into play to detect if existing branches on the server are being replaced by
7 some of the new one we push.
8
9 This case is part of a series of tests checking this behavior.
10
11 Category B: simple case involving pruned changesets
12 TestCase 5: multi-changeset branch, mix of pruned and superceeded
13
14 .. old-state:
15 ..
16 .. * 3 changeset branch
17 ..
18 .. new-state:
19 ..
20 .. * old head is pruned
21 .. * old mid is superceeded
22 .. * old root is pruned
23 ..
24 .. expected-result:
25 ..
26 .. * push allowed
27 ..
28 .. graph-summary:
29 ..
30 .. B ⊗
31 .. |
32 .. A ø⇠◔ A'
33 .. | |
34 .. B ⊗ |
35 .. |/
36 .. ●
37
38 $ . $TESTDIR/testlib/push-checkheads-util.sh
39
40 Test setup
41 ----------
42
43 $ mkdir B5
44 $ cd B5
45 $ setuprepos
46 creating basic server and client repo
47 updating to branch default
48 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 $ cd server
50 $ mkcommit B0
51 $ mkcommit C0
52 $ cd ../client
53 $ hg pull
54 pulling from $TESTTMP/B5/server (glob)
55 searching for changes
56 adding changesets
57 adding manifests
58 adding file changes
59 added 2 changesets with 2 changes to 2 files
60 (run 'hg update' to get a working copy)
61 $ hg up 0
62 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
63 $ mkcommit B1
64 created new head
65 $ hg debugobsolete --record-parents `getid "desc(A0)"`
66 $ hg debugobsolete `getid "desc(B0)"` `getid "desc(B1)"`
67 $ hg debugobsolete --record-parents `getid "desc(C0)"`
68 $ hg log -G --hidden
69 @ 25c56d33e4c4 (draft): B1
70 |
71 | x 821fb21d0dd2 (draft): C0
72 | |
73 | x d73caddc5533 (draft): B0
74 | |
75 | x 8aaa48160adc (draft): A0
76 |/
77 o 1e4be0697311 (public): root
78
79
80 Actual testing
81 --------------
82
83 $ hg push
84 pushing to $TESTTMP/B5/server (glob)
85 searching for changes
86 adding changesets
87 adding manifests
88 adding file changes
89 added 1 changesets with 1 changes to 1 files (+1 heads)
90 3 new obsolescence markers
91
92 $ cd ../..