| 1 |
============================================ |
| 2 |
Testing obsolescence markers push: Cases A.3 |
| 3 |
============================================ |
| 4 |
|
| 5 |
Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of |
| 6 |
all changesets that requested to be "in sync" after the push (even if they are |
| 7 |
already on both side). |
| 8 |
|
| 9 |
This test belongs to a series of tests checking such set is properly computed |
| 10 |
and applied. This does not tests "obsmarkers" discovery capabilities. |
| 11 |
|
| 12 |
Category A: simple cases |
| 13 |
TestCase 3: old branch split in two, only one of the new one pushed |
| 14 |
Variants: |
| 15 |
# a: changesets are known on remote |
| 16 |
# b: changesets are known on remote (push needs -f) |
| 17 |
|
| 18 |
A.3 new branchs created, one pushed. |
| 19 |
==================================== |
| 20 |
|
| 21 |
.. {{{ |
| 22 |
.. B' ○⇢ø B |
| 23 |
.. | | |
| 24 |
.. \Aø⇠◔ A' |
| 25 |
.. \|/ |
| 26 |
.. ● O |
| 27 |
.. }}} |
| 28 |
.. |
| 29 |
.. Markers exist from: |
| 30 |
.. |
| 31 |
.. * `A ø⇠○ A'` |
| 32 |
.. * `B ø⇠○ B'` |
| 33 |
.. |
| 34 |
.. Command runs: |
| 35 |
.. |
| 36 |
.. * hg push -r A |
| 37 |
.. |
| 38 |
.. Expected exchange: |
| 39 |
.. |
| 40 |
.. * chain from A |
| 41 |
.. |
| 42 |
.. Expected exclude: |
| 43 |
.. |
| 44 |
.. * chain from B |
| 45 |
.. |
| 46 |
.. Extra note: |
| 47 |
.. |
| 48 |
.. If A and B are remontly known, we should expect: |
| 49 |
.. |
| 50 |
.. * `hg push` will complain about the new head |
| 51 |
.. * `hg push` should complain about unstable history creation |
| 52 |
|
| 53 |
#testcases bm-v2 bm-v3 |
| 54 |
#if bm-v3 |
| 55 |
$ cat <<EOF >> $HGRCPATH |
| 56 |
> [experimental] |
| 57 |
> branch-cache-v3=yes |
| 58 |
> EOF |
| 59 |
#else |
| 60 |
$ cat <<EOF >> $HGRCPATH |
| 61 |
> [experimental] |
| 62 |
> branch-cache-v3=no |
| 63 |
> EOF |
| 64 |
#endif |
| 65 |
|
| 66 |
Setup |
| 67 |
----- |
| 68 |
|
| 69 |
$ . $TESTDIR/testlib/exchange-obsmarker-util.sh |
| 70 |
|
| 71 |
initial |
| 72 |
|
| 73 |
$ setuprepos A.3.a |
| 74 |
creating test repo for test case A.3.a |
| 75 |
- pulldest |
| 76 |
- main |
| 77 |
- pushdest |
| 78 |
cd into `main` and proceed with env setup |
| 79 |
$ cd main |
| 80 |
$ mkcommit A0 |
| 81 |
$ mkcommit B0 |
| 82 |
$ hg update -q 0 |
| 83 |
$ mkcommit A1 |
| 84 |
created new head |
| 85 |
$ hg update -q 0 |
| 86 |
$ mkcommit B1 |
| 87 |
created new head |
| 88 |
$ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'` |
| 89 |
1 new obsolescence markers |
| 90 |
obsoleted 1 changesets |
| 91 |
1 new orphan changesets |
| 92 |
$ hg debugobsolete `getid 'desc(B0)'` `getid 'desc(B1)'` |
| 93 |
1 new obsolescence markers |
| 94 |
obsoleted 1 changesets |
| 95 |
$ hg log -G --hidden |
| 96 |
@ f6298a8ac3a4 (draft): B1 |
| 97 |
| |
| 98 |
| o e5ea8f9c7314 (draft): A1 |
| 99 |
|/ |
| 100 |
| x 6e72f0a95b5e (draft): B0 |
| 101 |
| | |
| 102 |
| x 28b51eb45704 (draft): A0 |
| 103 |
|/ |
| 104 |
o a9bdc8b26820 (public): O |
| 105 |
|
| 106 |
$ inspect_obsmarkers |
| 107 |
obsstore content |
| 108 |
================ |
| 109 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 110 |
6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 111 |
$ cd .. |
| 112 |
$ cd .. |
| 113 |
|
| 114 |
Actual Test for first version (changeset unknown in remote) |
| 115 |
----------------------------------------------------------- |
| 116 |
|
| 117 |
$ dotest A.3.a A1 |
| 118 |
## Running testcase A.3.a |
| 119 |
# testing echange of "A1" (e5ea8f9c7314) |
| 120 |
## initial state |
| 121 |
# obstore: main |
| 122 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 123 |
6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 124 |
# obstore: pushdest |
| 125 |
# obstore: pulldest |
| 126 |
## pushing "A1" from main to pushdest |
| 127 |
pushing to pushdest |
| 128 |
searching for changes |
| 129 |
remote: adding changesets |
| 130 |
remote: adding manifests |
| 131 |
remote: adding file changes |
| 132 |
remote: added 1 changesets with 1 changes to 1 files |
| 133 |
remote: 1 new obsolescence markers |
| 134 |
## post push state |
| 135 |
# obstore: main |
| 136 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 137 |
6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 138 |
# obstore: pushdest |
| 139 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 140 |
# obstore: pulldest |
| 141 |
## pulling "e5ea8f9c7314" from main into pulldest |
| 142 |
pulling from main |
| 143 |
searching for changes |
| 144 |
adding changesets |
| 145 |
adding manifests |
| 146 |
adding file changes |
| 147 |
added 1 changesets with 1 changes to 1 files |
| 148 |
1 new obsolescence markers |
| 149 |
new changesets e5ea8f9c7314 (1 drafts) |
| 150 |
(run 'hg update' to get a working copy) |
| 151 |
## post pull state |
| 152 |
# obstore: main |
| 153 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 154 |
6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 155 |
# obstore: pushdest |
| 156 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 157 |
# obstore: pulldest |
| 158 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 159 |
|
| 160 |
other variant: changeset known in remote |
| 161 |
---------------------------------------- |
| 162 |
|
| 163 |
$ setuprepos A.3.b |
| 164 |
creating test repo for test case A.3.b |
| 165 |
- pulldest |
| 166 |
- main |
| 167 |
- pushdest |
| 168 |
cd into `main` and proceed with env setup |
| 169 |
$ cd main |
| 170 |
$ mkcommit A0 |
| 171 |
$ mkcommit B0 |
| 172 |
$ hg push -q ../pushdest |
| 173 |
$ hg push -q ../pulldest |
| 174 |
$ hg update -q 0 |
| 175 |
$ mkcommit A1 |
| 176 |
created new head |
| 177 |
$ hg update -q 0 |
| 178 |
$ mkcommit B1 |
| 179 |
created new head |
| 180 |
$ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'` |
| 181 |
1 new obsolescence markers |
| 182 |
obsoleted 1 changesets |
| 183 |
1 new orphan changesets |
| 184 |
$ hg debugobsolete `getid 'desc(B0)'` `getid 'desc(B1)'` |
| 185 |
1 new obsolescence markers |
| 186 |
obsoleted 1 changesets |
| 187 |
$ hg log -G --hidden |
| 188 |
@ f6298a8ac3a4 (draft): B1 |
| 189 |
| |
| 190 |
| o e5ea8f9c7314 (draft): A1 |
| 191 |
|/ |
| 192 |
| x 6e72f0a95b5e (draft): B0 |
| 193 |
| | |
| 194 |
| x 28b51eb45704 (draft): A0 |
| 195 |
|/ |
| 196 |
o a9bdc8b26820 (public): O |
| 197 |
|
| 198 |
$ inspect_obsmarkers |
| 199 |
obsstore content |
| 200 |
================ |
| 201 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 202 |
6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 203 |
$ cd .. |
| 204 |
$ cd .. |
| 205 |
|
| 206 |
Actual Test for first version (changeset known in remote) |
| 207 |
----------------------------------------------------------- |
| 208 |
|
| 209 |
check it complains about multiple heads |
| 210 |
|
| 211 |
$ cd A.3.b |
| 212 |
$ hg push -R main -r 'desc(A1)' pushdest |
| 213 |
pushing to pushdest |
| 214 |
searching for changes |
| 215 |
abort: push creates new remote head e5ea8f9c7314 |
| 216 |
(merge or see 'hg help push' for details about pushing new heads) |
| 217 |
[20] |
| 218 |
$ cd .. |
| 219 |
|
| 220 |
test obsmarkers exchange. |
| 221 |
|
| 222 |
$ dotest A.3.b A1 -f |
| 223 |
## Running testcase A.3.b |
| 224 |
# testing echange of "A1" (e5ea8f9c7314) |
| 225 |
## initial state |
| 226 |
# obstore: main |
| 227 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 228 |
6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 229 |
# obstore: pushdest |
| 230 |
# obstore: pulldest |
| 231 |
## pushing "A1" from main to pushdest |
| 232 |
pushing to pushdest |
| 233 |
searching for changes |
| 234 |
remote: adding changesets |
| 235 |
remote: adding manifests |
| 236 |
remote: adding file changes |
| 237 |
remote: added 1 changesets with 1 changes to 1 files (+1 heads) |
| 238 |
remote: 1 new obsolescence markers |
| 239 |
remote: obsoleted 1 changesets |
| 240 |
remote: 1 new orphan changesets |
| 241 |
## post push state |
| 242 |
# obstore: main |
| 243 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 244 |
6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 245 |
# obstore: pushdest |
| 246 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 247 |
# obstore: pulldest |
| 248 |
## pulling "e5ea8f9c7314" from main into pulldest |
| 249 |
pulling from main |
| 250 |
searching for changes |
| 251 |
adding changesets |
| 252 |
adding manifests |
| 253 |
adding file changes |
| 254 |
added 1 changesets with 1 changes to 1 files (+1 heads) |
| 255 |
1 new obsolescence markers |
| 256 |
obsoleted 1 changesets |
| 257 |
1 new orphan changesets |
| 258 |
new changesets e5ea8f9c7314 (1 drafts) |
| 259 |
(run 'hg heads' to see heads, 'hg merge' to merge) |
| 260 |
## post pull state |
| 261 |
# obstore: main |
| 262 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 263 |
6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 264 |
# obstore: pushdest |
| 265 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
| 266 |
# obstore: pulldest |
| 267 |
28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |