comparison tests/test-push-checkheads-pruned-B4.t @ 32011:698623950bf5

obsolescence: add test for the "branch replacement" logic during push, case B4 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:24 +0200
parents
children 53b3a1968aa6
comparison
equal deleted inserted replaced
32010:5622614e911c 32011:698623950bf5
1 ====================================
2 Testing head checking code: Case B-4
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 4: multi-changeset branch, all are pruned
13
14 .. old-state:
15 ..
16 .. * 2 changeset branch
17 ..
18 .. new-state:
19 ..
20 .. * old branch is pruned
21 ..
22 .. expected-result:
23 ..
24 .. * push allowed
25 ..
26 .. graph-summary:
27 ..
28 .. B ⊗
29 .. |
30 .. A ⊗
31 .. |
32 .. | ◔ C
33 .. |/
34 .. ●
35
36 $ . $TESTDIR/testlib/push-checkheads-util.sh
37
38 Test setup
39 ----------
40
41 $ mkdir B4
42 $ cd B4
43 $ setuprepos
44 creating basic server and client repo
45 updating to branch default
46 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 $ cd server
48 $ mkcommit B0
49 $ cd ../client
50 $ hg pull
51 pulling from $TESTTMP/B4/server (glob)
52 searching for changes
53 adding changesets
54 adding manifests
55 adding file changes
56 added 1 changesets with 1 changes to 1 files
57 (run 'hg update' to get a working copy)
58 $ hg up 0
59 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
60 $ mkcommit C0
61 created new head
62 $ hg debugobsolete --record-parents `getid "desc(A0)"`
63 $ hg debugobsolete --record-parents `getid "desc(B0)"`
64 $ hg log -G --hidden
65 @ 0f88766e02d6 (draft): C0
66 |
67 | x d73caddc5533 (draft): B0
68 | |
69 | x 8aaa48160adc (draft): A0
70 |/
71 o 1e4be0697311 (public): root
72
73
74 Actual testing
75 --------------
76
77 $ hg push
78 pushing to $TESTTMP/B4/server (glob)
79 searching for changes
80 adding changesets
81 adding manifests
82 adding file changes
83 added 1 changesets with 1 changes to 1 files (+1 heads)
84 2 new obsolescence markers
85
86 $ cd ../..