comparison tests/test-checkheads-unpushed-D1.t @ 2250:2b4e2e93b7db

checkheads: add some extra tests about "partial push" This adds a couple of test that checks that the head replacement code is properly ignored replacement not relevant to the push.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 29 Mar 2017 14:02:46 +0200
parents
children
comparison
equal deleted inserted replaced
2249:0ecb9fba6364 2250:2b4e2e93b7db
1 ====================================
2 Testing head checking code: Case D-1
3 ====================================
4
5 Mercurial checks for the introduction of multiple heads on push. Evolution
6 comes into play to detect if existing heads on the server are being replaced by
7 some of the new heads we push.
8
9 This test file 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/checkheads-util.sh
36
37 Test setup
38 ----------
39
40 $ setuprepos
41 creating basic server and client repo
42 updating to branch default
43 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 $ cd client
45 $ hg up 0
46 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
47 $ mkcommit A1
48 created new head
49 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
50 $ hg up 0
51 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
52 $ mkcommit B0
53 created new head
54 $ hg log -G --hidden
55 @ 74ff5441d343 (draft): B0
56 |
57 | o f6082bc4ffef (draft): A1
58 |/
59 | x 8aaa48160adc (draft): A0
60 |/
61 o 1e4be0697311 (public): root
62
63
64 Actual testing
65 --------------
66
67 $ hg push -r 'desc(B0)'
68 pushing to $TESTTMP/server
69 searching for changes
70 abort: push creates new remote head 74ff5441d343!
71 (merge or see 'hg help push' for details about pushing new heads)
72 [255]
73
74
75