comparison tests/test-push-checkheads-unpushed-D6.t @ 31989:85a22bc03d58

obsolescence: add test for the "branch replacement" logic during push, case D6 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. The current code for this logic is very basic (eg: issue4354) and was poorly tested. We have a better implementation coming in the evolve extension fixing these issues and with more serious tests coverage. In the process of upstreaming this improved logic, we start with adding the test case that are already passing with the current implementation. Once they are all in, we'll upstream the better implementation and the extra test cases. See inline documentation for details about the test case added in this changeset.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Thu, 13 Apr 2017 16:28:15 +0200
parents
children b11e8c67fb0f
comparison
equal deleted inserted replaced
31988:c5a45e238922 31989:85a22bc03d58
1 ====================================
2 Testing head checking code: Case D-6
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 D: remote head is "obs-affected" locally, but result is not part of the push
12 TestCase 6: single changeset, superseeded then pruned (on a new changeset unpushed) changeset
13
14 This is a partial push variation of case B-6
15
16 .. old-state:
17 ..
18 .. * 1 changeset branch
19 ..
20 .. new-state:
21 ..
22 .. * old branch is rewritten onto another one,
23 .. * the new version is then pruned.
24 ..
25 .. expected-result:
26 ..
27 .. * push denied
28 ..
29 .. graph-summary:
30 ..
31 .. A ø⇠⊗ A'
32 .. | |
33 .. C ◔ | ○ B
34 .. \|/
35 .. ●
36
37 $ . $TESTDIR/testlib/push-checkheads-util.sh
38
39 Test setup
40 ----------
41
42 $ mkdir D6
43 $ cd D6
44 $ setuprepos
45 creating basic server and client repo
46 updating to branch default
47 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 $ cd client
49 $ hg up 0
50 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
51 $ mkcommit B0
52 created new head
53 $ mkcommit A1
54 $ hg up '0'
55 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
56 $ mkcommit C0
57 created new head
58 $ hg debugobsolete `getid "desc(A0)"` `getid "desc(A1)"`
59 $ hg debugobsolete --record-parents `getid "desc(A1)"`
60 $ hg log -G --hidden
61 @ 0f88766e02d6 (draft): C0
62 |
63 | x ba93660aff8d (draft): A1
64 | |
65 | o 74ff5441d343 (draft): B0
66 |/
67 | x 8aaa48160adc (draft): A0
68 |/
69 o 1e4be0697311 (public): root
70
71
72 Actual testing
73 --------------
74
75 $ hg push --rev 'desc(C0)'
76 pushing to $TESTTMP/D6/server (glob)
77 searching for changes
78 abort: push creates new remote head 0f88766e02d6!
79 (merge or see 'hg help push' for details about pushing new heads)
80 [255]
81
82 $ cd ../..