comparison tests/test-push-checkheads-pruned-B2.t @ 32010:5622614e911c

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