| 1 |
==================================== |
| 2 |
Testing head checking code: Case B-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 B: simple case involving pruned changesets |
| 12 |
TestCase 2: multi-changeset branch, head is pruned, rest is superseded, through other |
| 13 |
|
| 14 |
.. old-state: |
| 15 |
.. |
| 16 |
.. * 2 changeset branch |
| 17 |
.. |
| 18 |
.. new-state: |
| 19 |
.. |
| 20 |
.. * old head is rewritten then pruned |
| 21 |
.. * 1 new branch succeeding to the other changeset in the old branch (through another obsolete branch) |
| 22 |
.. |
| 23 |
.. expected-result: |
| 24 |
.. |
| 25 |
.. * push allowed |
| 26 |
.. |
| 27 |
.. graph-summary: |
| 28 |
.. |
| 29 |
.. B ø⇠⊗ B' |
| 30 |
.. | | A' |
| 31 |
.. A ø⇠ø⇠◔ A'' |
| 32 |
.. |/ / |
| 33 |
.. | / |
| 34 |
.. |/ |
| 35 |
.. ● |
| 36 |
|
| 37 |
$ . $TESTDIR/testlib/push-checkheads-util.sh |
| 38 |
|
| 39 |
Test setup |
| 40 |
---------- |
| 41 |
|
| 42 |
$ mkdir B8 |
| 43 |
$ cd B8 |
| 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/B8/server |
| 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 |
new changesets d73caddc5533 (1 drafts) |
| 59 |
(run 'hg update' to get a working copy) |
| 60 |
$ hg up 0 |
| 61 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 62 |
$ mkcommit A1 |
| 63 |
created new head |
| 64 |
$ mkcommit B1 |
| 65 |
$ hg up 0 |
| 66 |
0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
| 67 |
$ mkcommit A2 |
| 68 |
created new head |
| 69 |
$ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` |
| 70 |
1 new obsolescence markers |
| 71 |
obsoleted 1 changesets |
| 72 |
1 new orphan changesets |
| 73 |
$ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` |
| 74 |
1 new obsolescence markers |
| 75 |
obsoleted 1 changesets |
| 76 |
$ hg debugobsolete --record-parents `getid "desc(B1)"` |
| 77 |
1 new obsolescence markers |
| 78 |
obsoleted 1 changesets |
| 79 |
$ hg debugobsolete `getid "desc(A1)" ` `getid "desc(A2)"` |
| 80 |
1 new obsolescence markers |
| 81 |
obsoleted 1 changesets |
| 82 |
$ hg log -G --hidden |
| 83 |
@ c1f8d089020f (draft): A2 |
| 84 |
| |
| 85 |
| x 262c8c798096 (draft): B1 |
| 86 |
| | |
| 87 |
| x f6082bc4ffef (draft): A1 |
| 88 |
|/ |
| 89 |
| x d73caddc5533 (draft): B0 |
| 90 |
| | |
| 91 |
| x 8aaa48160adc (draft): A0 |
| 92 |
|/ |
| 93 |
o 1e4be0697311 (public): root |
| 94 |
|
| 95 |
|
| 96 |
Actual testing |
| 97 |
-------------- |
| 98 |
|
| 99 |
$ hg push |
| 100 |
pushing to $TESTTMP/B8/server |
| 101 |
searching for changes |
| 102 |
adding changesets |
| 103 |
adding manifests |
| 104 |
adding file changes |
| 105 |
added 1 changesets with 1 changes to 1 files (+1 heads) |
| 106 |
4 new obsolescence markers |
| 107 |
obsoleted 2 changesets |
| 108 |
|
| 109 |
$ cd ../.. |