comparison tests/test-push-checkheads-unpushed-D1.t @ 31986:f4d5d4f7aee1

obsolescence: add test for the "branch replacement" logic during push, case D1 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:27:28 +0200
parents
children b11e8c67fb0f
comparison
equal deleted inserted replaced
31985:7906cdb64895 31986:f4d5d4f7aee1
1 ====================================
2 Testing head checking code: Case D-1
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 1: remote head is rewritten, but successors is not part of the push
13
14 .. old-state:
15 ..
16 .. * 1 changeset branch
17 ..
18 .. new-state:
19 ..
20 .. * 1 changeset branch succeeding the old branch
21 .. * 1 new unrelated branch
22 ..
23 .. expected-result:
24 ..
25 .. * pushing only the unrelated branch: denied
26 ..
27 .. graph-summary:
28 ..
29 .. A ø⇠○ A'
30 .. |/
31 .. | ◔ B
32 .. |/
33 .. ●
34
35 $ . $TESTDIR/testlib/push-checkheads-util.sh
36
37 Test setup
38 ----------
39
40 $ mkdir D1
41 $ cd D1
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 client
47 $ hg up 0
48 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
49 $ mkcommit A1
50 created new head
51 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
52 $ hg up 0
53 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
54 $ mkcommit B0
55 created new head
56 $ hg log -G --hidden
57 @ 74ff5441d343 (draft): B0
58 |
59 | o f6082bc4ffef (draft): A1
60 |/
61 | x 8aaa48160adc (draft): A0
62 |/
63 o 1e4be0697311 (public): root
64
65
66 Actual testing
67 --------------
68
69 $ hg push -r 'desc(B0)'
70 pushing to $TESTTMP/D1/server (glob)
71 searching for changes
72 abort: push creates new remote head 74ff5441d343!
73 (merge or see 'hg help push' for details about pushing new heads)
74 [255]
75
76 $ cd ../..
77