##// END OF EJS Templates
obsolescence: add test for the "branch replacement" logic during push, case D6...
Pierre-Yves David -
r31989:85a22bc0 default
parent child Browse files
Show More
@@ -0,0 +1,82
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 ../..
General Comments 0
You need to be logged in to leave comments. Login now