comparison tests/test-push-checkheads-pruned-B7.t @ 32014:818cc18a7574

obsolescence: add test for the "branch replacement" logic during push, case B7 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:51 +0200
parents
children 53b3a1968aa6
comparison
equal deleted inserted replaced
32013:0cf4d6763735 32014:818cc18a7574
1 ====================================
2 Testing head checking code: Case B-7
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 7: single changesets, pruned then superseeded (on an existing changeset)
13
14 .. old-state:
15 ..
16 .. * 1 changeset branch
17 ..
18 .. new-state:
19 ..
20 .. * old branch is rewritten onto the common set,
21 .. * the new version is then pruned.
22 ..
23 .. expected-result:
24 ..
25 .. * push allowed
26 ..
27 .. graph-summary:
28 ..
29 .. A ø⇠⊗ A'
30 .. B ◔ | |
31 .. \|/
32 .. ●
33
34 $ . $TESTDIR/testlib/push-checkheads-util.sh
35
36 Test setup
37 ----------
38
39 $ mkdir B7
40 $ cd B7
41 $ setuprepos
42 creating basic server and client repo
43 updating to branch default
44 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 $ cd client
46 $ hg up 0
47 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
48 $ mkcommit B0
49 created new head
50 $ mkcommit A1
51 $ hg up 'desc(B0)'
52 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
53 $ hg debugobsolete `getid "desc(A0)"` `getid "desc(A1)"`
54 $ hg debugobsolete --record-parents `getid "desc(A1)"`
55 $ hg log -G --hidden
56 x ba93660aff8d (draft): A1
57 |
58 @ 74ff5441d343 (draft): B0
59 |
60 | x 8aaa48160adc (draft): A0
61 |/
62 o 1e4be0697311 (public): root
63
64
65 Actual testing
66 --------------
67
68 $ hg push
69 pushing to $TESTTMP/B7/server (glob)
70 searching for changes
71 adding changesets
72 adding manifests
73 adding file changes
74 added 1 changesets with 1 changes to 1 files (+1 heads)
75 2 new obsolescence markers
76
77 $ cd ../..