|
1 ==================================== |
|
2 Testing head checking code: Case A-3 |
|
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 A: simple case involving a branch being superceeded by another. |
|
12 TestCase 3: multi-changeset branch with reordering |
|
13 |
|
14 Push should be allowed |
|
15 .. old-state: |
|
16 .. |
|
17 .. * 2 changeset branch |
|
18 .. |
|
19 .. new-state: |
|
20 .. |
|
21 .. * 2 changeset branch succeeding the old one with reordering |
|
22 .. |
|
23 .. expected-result: |
|
24 .. |
|
25 .. * push allowed |
|
26 .. |
|
27 .. graph-summary: |
|
28 .. |
|
29 .. B ø⇠⇠ |
|
30 .. | ⇡ |
|
31 .. A ø⇠⇠⇠○ A' |
|
32 .. | ⇡/ |
|
33 .. | ○ B' |
|
34 .. |/ |
|
35 .. ● |
|
36 |
|
37 $ . $TESTDIR/testlib/push-checkheads-util.sh |
|
38 |
|
39 Test setup |
|
40 ---------- |
|
41 |
|
42 $ mkdir A3 |
|
43 $ cd A3 |
|
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 server |
|
49 $ mkcommit B0 |
|
50 $ cd ../client |
|
51 $ hg pull |
|
52 pulling from $TESTTMP/A3/server (glob) |
|
53 searching for changes |
|
54 adding changesets |
|
55 adding manifests |
|
56 adding file changes |
|
57 added 1 changesets with 1 changes to 1 files |
|
58 (run 'hg update' to get a working copy) |
|
59 $ hg up 0 |
|
60 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
61 $ mkcommit B1 |
|
62 created new head |
|
63 $ mkcommit A1 |
|
64 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` |
|
65 $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` |
|
66 $ hg log -G --hidden |
|
67 @ c1c7524e9488 (draft): A1 |
|
68 | |
|
69 o 25c56d33e4c4 (draft): B1 |
|
70 | |
|
71 | x d73caddc5533 (draft): B0 |
|
72 | | |
|
73 | x 8aaa48160adc (draft): A0 |
|
74 |/ |
|
75 o 1e4be0697311 (public): root |
|
76 |
|
77 |
|
78 Actual testing |
|
79 -------------- |
|
80 |
|
81 $ hg push |
|
82 pushing to $TESTTMP/A3/server (glob) |
|
83 searching for changes |
|
84 adding changesets |
|
85 adding manifests |
|
86 adding file changes |
|
87 added 2 changesets with 2 changes to 2 files (+1 heads) |
|
88 2 new obsolescence markers |
|
89 |
|
90 $ cd ../.. |