| 1 |
==================================== |
| 2 |
Testing head checking code: Case D-5 |
| 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 5: multi-changeset branch, split on multiple other, (head on its own new branch) |
| 13 |
|
| 14 |
.. old-state: |
| 15 |
.. |
| 16 |
.. * 2 branch (1 changeset, and 2 changesets) |
| 17 |
.. |
| 18 |
.. new-state: |
| 19 |
.. |
| 20 |
.. * 1 new branch superseding the head of the old-2-changesets-branch, |
| 21 |
.. * 1 new changesets on the old-1-changeset-branch superseding the base of the other |
| 22 |
.. |
| 23 |
.. expected-result: |
| 24 |
.. |
| 25 |
.. * push the new branch only -> push denied |
| 26 |
.. * push the existing branch only -> push allowed |
| 27 |
.. /!\ This push create unstability/orphaning on the other hand and we should |
| 28 |
.. probably detect/warn agains that. |
| 29 |
.. |
| 30 |
.. graph-summary: |
| 31 |
.. |
| 32 |
.. B ø⇠◔ B' |
| 33 |
.. | | |
| 34 |
.. A'◔⇢ø | |
| 35 |
.. | |/ |
| 36 |
.. C ● | |
| 37 |
.. \| |
| 38 |
.. ● |
| 39 |
|
| 40 |
$ . $TESTDIR/testlib/push-checkheads-util.sh |
| 41 |
|
| 42 |
Test setup |
| 43 |
---------- |
| 44 |
|
| 45 |
$ mkdir D5 |
| 46 |
$ cd D5 |
| 47 |
$ setuprepos |
| 48 |
creating basic server and client repo |
| 49 |
updating to branch default |
| 50 |
2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 51 |
$ cd server |
| 52 |
$ mkcommit B0 |
| 53 |
$ hg up 0 |
| 54 |
0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
| 55 |
$ mkcommit C0 |
| 56 |
created new head |
| 57 |
$ cd ../client |
| 58 |
$ hg pull |
| 59 |
pulling from $TESTTMP/D5/server |
| 60 |
searching for changes |
| 61 |
adding changesets |
| 62 |
adding manifests |
| 63 |
adding file changes |
| 64 |
added 2 changesets with 2 changes to 2 files (+1 heads) |
| 65 |
new changesets d73caddc5533:0f88766e02d6 (2 drafts) |
| 66 |
(run 'hg heads' to see heads, 'hg merge' to merge) |
| 67 |
$ hg up 'desc(C0)' |
| 68 |
1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 69 |
$ mkcommit A1 |
| 70 |
$ hg up 0 |
| 71 |
0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
| 72 |
$ mkcommit B1 |
| 73 |
created new head |
| 74 |
$ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` |
| 75 |
1 new obsolescence markers |
| 76 |
obsoleted 1 changesets |
| 77 |
1 new orphan changesets |
| 78 |
$ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` |
| 79 |
1 new obsolescence markers |
| 80 |
obsoleted 1 changesets |
| 81 |
$ hg log -G --hidden |
| 82 |
@ 25c56d33e4c4 (draft): B1 |
| 83 |
| |
| 84 |
| o a0802eb7fc1b (draft): A1 |
| 85 |
| | |
| 86 |
| o 0f88766e02d6 (draft): C0 |
| 87 |
|/ |
| 88 |
| x d73caddc5533 (draft): B0 |
| 89 |
| | |
| 90 |
| x 8aaa48160adc (draft): A0 |
| 91 |
|/ |
| 92 |
o 1e4be0697311 (public): root |
| 93 |
|
| 94 |
|
| 95 |
Actual testing |
| 96 |
-------------- |
| 97 |
|
| 98 |
$ hg push --rev 'desc(B1)' |
| 99 |
pushing to $TESTTMP/D5/server |
| 100 |
searching for changes |
| 101 |
abort: push creates new remote head 25c56d33e4c4 |
| 102 |
(merge or see 'hg help push' for details about pushing new heads) |
| 103 |
[20] |
| 104 |
$ hg push --rev 'desc(A1)' |
| 105 |
pushing to $TESTTMP/D5/server |
| 106 |
searching for changes |
| 107 |
adding changesets |
| 108 |
adding manifests |
| 109 |
adding file changes |
| 110 |
added 1 changesets with 1 changes to 1 files |
| 111 |
1 new obsolescence markers |
| 112 |
obsoleted 1 changesets |
| 113 |
1 new orphan changesets |
| 114 |
|
| 115 |
$ cd ../.. |