Show More
@@ -0,0 +1,93 b'' | |||||
|
1 | ==================================== | |||
|
2 | Testing head checking code: Case D-2 | |||
|
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 branch has 2 changes, head is pruned, other is rewritten but result is not pushed | |||
|
13 | ||||
|
14 | .. old-state: | |||
|
15 | .. | |||
|
16 | .. * 1 changeset branch | |||
|
17 | .. | |||
|
18 | .. new-state: | |||
|
19 | .. | |||
|
20 | .. * old head is pruned | |||
|
21 | .. * 1 new branch succeeding to the other changeset in the old branch | |||
|
22 | .. * 1 new unrelated branch | |||
|
23 | .. | |||
|
24 | .. expected-result: | |||
|
25 | .. | |||
|
26 | .. * push allowed | |||
|
27 | .. * pushing only the unrelated branch: denied | |||
|
28 | .. | |||
|
29 | .. graph-summary: | |||
|
30 | .. | |||
|
31 | .. B β | |||
|
32 | .. | | |||
|
33 | .. A ΓΈβ β A' | |||
|
34 | .. |/ | |||
|
35 | .. | β C | |||
|
36 | .. |/ | |||
|
37 | .. β | |||
|
38 | ||||
|
39 | $ . $TESTDIR/testlib/push-checkheads-util.sh | |||
|
40 | ||||
|
41 | Test setup | |||
|
42 | ---------- | |||
|
43 | ||||
|
44 | $ mkdir D2 | |||
|
45 | $ cd D2 | |||
|
46 | $ setuprepos | |||
|
47 | creating basic server and client repo | |||
|
48 | updating to branch default | |||
|
49 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
50 | $ cd server | |||
|
51 | $ mkcommit B0 | |||
|
52 | $ cd ../client | |||
|
53 | $ hg pull | |||
|
54 | pulling from $TESTTMP/D2/server (glob) | |||
|
55 | searching for changes | |||
|
56 | adding changesets | |||
|
57 | adding manifests | |||
|
58 | adding file changes | |||
|
59 | added 1 changesets with 1 changes to 1 files | |||
|
60 | (run 'hg update' to get a working copy) | |||
|
61 | $ hg up 0 | |||
|
62 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
63 | $ mkcommit A1 | |||
|
64 | created new head | |||
|
65 | $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` | |||
|
66 | $ hg debugobsolete --record-parents `getid "desc(B0)"` | |||
|
67 | $ hg up 0 | |||
|
68 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
69 | $ mkcommit C0 | |||
|
70 | created new head | |||
|
71 | $ hg log -G --hidden | |||
|
72 | @ 0f88766e02d6 (draft): C0 | |||
|
73 | | | |||
|
74 | | o f6082bc4ffef (draft): A1 | |||
|
75 | |/ | |||
|
76 | | x d73caddc5533 (draft): B0 | |||
|
77 | | | | |||
|
78 | | x 8aaa48160adc (draft): A0 | |||
|
79 | |/ | |||
|
80 | o 1e4be0697311 (public): root | |||
|
81 | ||||
|
82 | ||||
|
83 | Actual testing | |||
|
84 | -------------- | |||
|
85 | ||||
|
86 | $ hg push --rev 'desc(C0)' | |||
|
87 | pushing to $TESTTMP/D2/server (glob) | |||
|
88 | searching for changes | |||
|
89 | abort: push creates new remote head 0f88766e02d6! | |||
|
90 | (merge or see 'hg help push' for details about pushing new heads) | |||
|
91 | [255] | |||
|
92 | ||||
|
93 | $ cd ../.. |
General Comments 0
You need to be logged in to leave comments.
Login now