| 1 |
============================= |
| 2 |
Test distributed obsolescence |
| 3 |
============================= |
| 4 |
|
| 5 |
This file test various cases where data (changeset, phase, obsmarkers) is |
| 6 |
added to the repository in a specific order. Usually, this order is unlikely |
| 7 |
to happen in the local case but can easily happen in the distributed case. |
| 8 |
|
| 9 |
$ unset HGUSER |
| 10 |
$ unset EMAIL |
| 11 |
$ . $TESTDIR/testlib/obsmarker-common.sh |
| 12 |
$ cat >> $HGRCPATH << EOF |
| 13 |
> [extensions] |
| 14 |
> rebase = |
| 15 |
> [experimental] |
| 16 |
> evolution = all |
| 17 |
> [phases] |
| 18 |
> publish = False |
| 19 |
> [command-templates] |
| 20 |
> log = {rev}:{node|short} {desc}{if(obsfate, " [{join(obsfate, "; ")}]")}\n |
| 21 |
> EOF |
| 22 |
|
| 23 |
Check distributed chain building |
| 24 |
================================ |
| 25 |
|
| 26 |
Test case where a changeset is marked as a successor of another local |
| 27 |
changeset while the successor has already been obsoleted remotely. |
| 28 |
|
| 29 |
The chain of evolution should seamlessly connect and all but the new version |
| 30 |
(created remotely) should be seen as obsolete. |
| 31 |
|
| 32 |
Initial setup |
| 33 |
|
| 34 |
$ mkdir distributed-chain-building |
| 35 |
$ cd distributed-chain-building |
| 36 |
$ hg init server |
| 37 |
$ cd server |
| 38 |
$ cat << EOF >> .hg/hgrc |
| 39 |
> [ui] |
| 40 |
> username = server |
| 41 |
> EOF |
| 42 |
$ mkcommit ROOT |
| 43 |
$ mkcommit c_A0 |
| 44 |
$ hg up 'desc("ROOT")' |
| 45 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 46 |
$ mkcommit c_A1 |
| 47 |
created new head |
| 48 |
$ hg up 'desc("ROOT")' |
| 49 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 50 |
$ mkcommit c_B0 |
| 51 |
created new head |
| 52 |
$ hg debugobsolete `getid 'desc("c_A0")'` `getid 'desc("c_A1")'` |
| 53 |
1 new obsolescence markers |
| 54 |
obsoleted 1 changesets |
| 55 |
$ hg log -G --hidden -v |
| 56 |
@ 3:e5d7dda7cd28 c_B0 |
| 57 |
| |
| 58 |
| o 2:7f6b0a6f5c25 c_A1 |
| 59 |
|/ |
| 60 |
| x 1:e1b46f0f979f c_A0 [rewritten as 2:7f6b0a6f5c25 by server (at 1970-01-01 00:00 +0000)] |
| 61 |
|/ |
| 62 |
o 0:e82fb8d02bbf ROOT |
| 63 |
|
| 64 |
$ hg debugobsolete |
| 65 |
e1b46f0f979f52748347ff8729c59f2ef56e6fe2 7f6b0a6f5c25345a83870963efd827c1798a5959 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'} |
| 66 |
$ cd .. |
| 67 |
|
| 68 |
duplicate the repo for the client: |
| 69 |
|
| 70 |
$ cp -R server client |
| 71 |
$ cat << EOF >> client/.hg/hgrc |
| 72 |
> [paths] |
| 73 |
> default = ../server/ |
| 74 |
> [ui] |
| 75 |
> username = client |
| 76 |
> EOF |
| 77 |
|
| 78 |
server side: create new revision on the server (obsoleting another one) |
| 79 |
|
| 80 |
$ cd server |
| 81 |
$ hg up 'desc("ROOT")' |
| 82 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 83 |
$ mkcommit c_B1 |
| 84 |
created new head |
| 85 |
$ hg debugobsolete `getid 'desc("c_B0")'` `getid 'desc("c_B1")'` |
| 86 |
1 new obsolescence markers |
| 87 |
obsoleted 1 changesets |
| 88 |
$ hg log -G |
| 89 |
@ 4:391a2bf12b1b c_B1 |
| 90 |
| |
| 91 |
| o 2:7f6b0a6f5c25 c_A1 |
| 92 |
|/ |
| 93 |
o 0:e82fb8d02bbf ROOT |
| 94 |
|
| 95 |
$ hg log -G --hidden -v |
| 96 |
@ 4:391a2bf12b1b c_B1 |
| 97 |
| |
| 98 |
| x 3:e5d7dda7cd28 c_B0 [rewritten as 4:391a2bf12b1b by server (at 1970-01-01 00:00 +0000)] |
| 99 |
|/ |
| 100 |
| o 2:7f6b0a6f5c25 c_A1 |
| 101 |
|/ |
| 102 |
| x 1:e1b46f0f979f c_A0 [rewritten as 2:7f6b0a6f5c25 by server (at 1970-01-01 00:00 +0000)] |
| 103 |
|/ |
| 104 |
o 0:e82fb8d02bbf ROOT |
| 105 |
|
| 106 |
$ hg debugobsolete |
| 107 |
e1b46f0f979f52748347ff8729c59f2ef56e6fe2 7f6b0a6f5c25345a83870963efd827c1798a5959 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'} |
| 108 |
e5d7dda7cd28e6b3f79437e5b8122a38ece0255c 391a2bf12b1b8b05a72400ae36b26d50a091dc22 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'} |
| 109 |
$ cd .. |
| 110 |
|
| 111 |
client side: create a marker between two common changesets |
| 112 |
(client is not aware of the server activity yet) |
| 113 |
|
| 114 |
$ cd client |
| 115 |
$ hg debugobsolete `getid 'desc("c_A1")'` `getid 'desc("c_B0")'` |
| 116 |
1 new obsolescence markers |
| 117 |
obsoleted 1 changesets |
| 118 |
$ hg log -G |
| 119 |
@ 3:e5d7dda7cd28 c_B0 |
| 120 |
| |
| 121 |
o 0:e82fb8d02bbf ROOT |
| 122 |
|
| 123 |
$ hg log -G --hidden -v |
| 124 |
@ 3:e5d7dda7cd28 c_B0 |
| 125 |
| |
| 126 |
| x 2:7f6b0a6f5c25 c_A1 [rewritten as 3:e5d7dda7cd28 by client (at 1970-01-01 00:00 +0000)] |
| 127 |
|/ |
| 128 |
| x 1:e1b46f0f979f c_A0 [rewritten as 2:7f6b0a6f5c25 by server (at 1970-01-01 00:00 +0000)] |
| 129 |
|/ |
| 130 |
o 0:e82fb8d02bbf ROOT |
| 131 |
|
| 132 |
$ hg debugobsolete |
| 133 |
e1b46f0f979f52748347ff8729c59f2ef56e6fe2 7f6b0a6f5c25345a83870963efd827c1798a5959 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'} |
| 134 |
7f6b0a6f5c25345a83870963efd827c1798a5959 e5d7dda7cd28e6b3f79437e5b8122a38ece0255c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'client'} |
| 135 |
|
| 136 |
client side: pull from the server |
| 137 |
(the new successors should take over) |
| 138 |
|
| 139 |
$ hg up 'desc("ROOT")' |
| 140 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 141 |
$ hg pull --debug --confirm --config ui.interactive=True << EOF |
| 142 |
> n |
| 143 |
> EOF |
| 144 |
pulling from $TESTTMP/distributed-chain-building/server |
| 145 |
query 1; heads |
| 146 |
searching for changes |
| 147 |
taking quick initial sample |
| 148 |
query 2; still undecided: 1, sample size is: 1 |
| 149 |
2 total queries in *.*s (glob) |
| 150 |
1 changesets found |
| 151 |
list of changesets: |
| 152 |
391a2bf12b1b8b05a72400ae36b26d50a091dc22 |
| 153 |
listing keys for "bookmarks" |
| 154 |
bundle2-output-bundle: "HG20", 4 parts total |
| 155 |
bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload |
| 156 |
bundle2-output-part: "listkeys" (params: 1 mandatory) empty payload |
| 157 |
bundle2-output-part: "obsmarkers" streamed payload |
| 158 |
bundle2-output-part: "phase-heads" 48 bytes payload |
| 159 |
bundle2-input-bundle: with-transaction |
| 160 |
bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported |
| 161 |
adding changesets |
| 162 |
add changeset 391a2bf12b1b |
| 163 |
adding manifests |
| 164 |
adding file changes |
| 165 |
adding c_B1 revisions |
| 166 |
bundle2-input-part: total payload size 495 |
| 167 |
bundle2-input-part: "listkeys" (params: 1 mandatory) supported |
| 168 |
bundle2-input-part: "obsmarkers" supported |
| 169 |
bundle2-input-part: total payload size 143 |
| 170 |
bundle2-input-part: "phase-heads" supported |
| 171 |
bundle2-input-part: total payload size 48 |
| 172 |
bundle2-input-bundle: 4 parts total |
| 173 |
checking for updated bookmarks |
| 174 |
adding 1 changesets with 1 changes to 1 files (+1 heads) |
| 175 |
1 new obsolescence markers |
| 176 |
obsoleting 1 changesets |
| 177 |
new changesets 391a2bf12b1b (1 drafts) |
| 178 |
accept incoming changes (yn)? n |
| 179 |
transaction abort! |
| 180 |
rollback completed |
| 181 |
abort: user aborted |
| 182 |
[255] |
| 183 |
|
| 184 |
$ hg pull --confirm --config ui.interactive=True << EOF |
| 185 |
> y |
| 186 |
> EOF |
| 187 |
pulling from $TESTTMP/distributed-chain-building/server |
| 188 |
searching for changes |
| 189 |
adding changesets |
| 190 |
adding manifests |
| 191 |
adding file changes |
| 192 |
adding 1 changesets with 1 changes to 1 files (+1 heads) |
| 193 |
1 new obsolescence markers |
| 194 |
obsoleting 1 changesets |
| 195 |
new changesets 391a2bf12b1b (1 drafts) |
| 196 |
accept incoming changes (yn)? y |
| 197 |
added 1 changesets with 1 changes to 1 files (+1 heads) |
| 198 |
1 new obsolescence markers |
| 199 |
obsoleted 1 changesets |
| 200 |
new changesets 391a2bf12b1b (1 drafts) |
| 201 |
(run 'hg heads' to see heads) |
| 202 |
$ hg log -G |
| 203 |
o 4:391a2bf12b1b c_B1 |
| 204 |
| |
| 205 |
@ 0:e82fb8d02bbf ROOT |
| 206 |
|
| 207 |
$ hg log -G --hidden -v |
| 208 |
o 4:391a2bf12b1b c_B1 |
| 209 |
| |
| 210 |
| x 3:e5d7dda7cd28 c_B0 [rewritten as 4:391a2bf12b1b by server (at 1970-01-01 00:00 +0000)] |
| 211 |
|/ |
| 212 |
| x 2:7f6b0a6f5c25 c_A1 [rewritten as 3:e5d7dda7cd28 by client (at 1970-01-01 00:00 +0000)] |
| 213 |
|/ |
| 214 |
| x 1:e1b46f0f979f c_A0 [rewritten as 2:7f6b0a6f5c25 by server (at 1970-01-01 00:00 +0000)] |
| 215 |
|/ |
| 216 |
@ 0:e82fb8d02bbf ROOT |
| 217 |
|
| 218 |
$ hg debugobsolete |
| 219 |
e1b46f0f979f52748347ff8729c59f2ef56e6fe2 7f6b0a6f5c25345a83870963efd827c1798a5959 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'} |
| 220 |
7f6b0a6f5c25345a83870963efd827c1798a5959 e5d7dda7cd28e6b3f79437e5b8122a38ece0255c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'client'} |
| 221 |
e5d7dda7cd28e6b3f79437e5b8122a38ece0255c 391a2bf12b1b8b05a72400ae36b26d50a091dc22 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'} |
| 222 |
|
| 223 |
server side: receive client push |
| 224 |
(the other way around, pushing to the server, the obsolete changesets stay |
| 225 |
obsolete on the server side but the marker is sent out.) |
| 226 |
|
| 227 |
$ hg rollback |
| 228 |
repository tip rolled back to revision 3 (undo pull) |
| 229 |
$ hg push -f |
| 230 |
pushing to $TESTTMP/distributed-chain-building/server |
| 231 |
searching for changes |
| 232 |
adding changesets |
| 233 |
adding manifests |
| 234 |
adding file changes |
| 235 |
added 0 changesets with 0 changes to 1 files |
| 236 |
1 new obsolescence markers |
| 237 |
obsoleted 1 changesets |
| 238 |
$ hg -R ../server/ log -G |
| 239 |
@ 4:391a2bf12b1b c_B1 |
| 240 |
| |
| 241 |
o 0:e82fb8d02bbf ROOT |
| 242 |
|
| 243 |
$ hg -R ../server/ log -G --hidden -v |
| 244 |
@ 4:391a2bf12b1b c_B1 |
| 245 |
| |
| 246 |
| x 3:e5d7dda7cd28 c_B0 [rewritten as 4:391a2bf12b1b by server (at 1970-01-01 00:00 +0000)] |
| 247 |
|/ |
| 248 |
| x 2:7f6b0a6f5c25 c_A1 [rewritten as 3:e5d7dda7cd28 by client (at 1970-01-01 00:00 +0000)] |
| 249 |
|/ |
| 250 |
| x 1:e1b46f0f979f c_A0 [rewritten as 2:7f6b0a6f5c25 by server (at 1970-01-01 00:00 +0000)] |
| 251 |
|/ |
| 252 |
o 0:e82fb8d02bbf ROOT |
| 253 |
|
| 254 |
$ hg debugobsolete |
| 255 |
e1b46f0f979f52748347ff8729c59f2ef56e6fe2 7f6b0a6f5c25345a83870963efd827c1798a5959 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'} |
| 256 |
7f6b0a6f5c25345a83870963efd827c1798a5959 e5d7dda7cd28e6b3f79437e5b8122a38ece0255c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'client'} |
| 257 |
$ cd .. |
| 258 |
|
| 259 |
Check getting changesets after getting the markers |
| 260 |
================================================= |
| 261 |
|
| 262 |
This test case covers the scenario where commits are received -after- we |
| 263 |
received some obsolescence markers turning them obsolete. |
| 264 |
|
| 265 |
For example, we pull some successors from a repository (with associated |
| 266 |
predecessors marker chain) and then later we pull some intermediate |
| 267 |
precedessors changeset from another repository. Obsolescence markers must |
| 268 |
apply to the intermediate changeset. They have to be obsolete (and hidden). |
| 269 |
|
| 270 |
Avoiding pulling the changeset in the first place is a tricky decision because |
| 271 |
there could be non-obsolete ancestors that need to be pulled, but the |
| 272 |
discovery cannot currently find these (this is not the case in this tests). In |
| 273 |
addition, we could also have to pull the changeset because they have children. |
| 274 |
In this case, they would not be hidden (yet) because of the orphan descendant, |
| 275 |
but they would still have to be obsolete. (This is not tested in this case |
| 276 |
either). |
| 277 |
|
| 278 |
$ mkdir distributed-chain-building |
| 279 |
$ cd distributed-chain-building |
| 280 |
$ hg init server |
| 281 |
$ cd server |
| 282 |
$ cat << EOF >> .hg/hgrc |
| 283 |
> [ui] |
| 284 |
> username = server |
| 285 |
> EOF |
| 286 |
$ mkcommit ROOT |
| 287 |
$ cd .. |
| 288 |
$ hg clone server repo-Alice |
| 289 |
updating to branch default |
| 290 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 291 |
$ cat << EOF >> repo-Alice/.hg/hgrc |
| 292 |
> [ui] |
| 293 |
> username = alice |
| 294 |
> EOF |
| 295 |
$ hg clone server repo-Bob |
| 296 |
updating to branch default |
| 297 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 298 |
$ cat << EOF >> repo-Bob/.hg/hgrc |
| 299 |
> [ui] |
| 300 |
> username = bob |
| 301 |
> EOF |
| 302 |
$ hg clone server repo-Celeste |
| 303 |
updating to branch default |
| 304 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 305 |
$ cat << EOF >> repo-Celeste/.hg/hgrc |
| 306 |
> [ui] |
| 307 |
> username = celeste |
| 308 |
> EOF |
| 309 |
|
| 310 |
Create some changesets locally |
| 311 |
|
| 312 |
$ cd repo-Alice |
| 313 |
$ mkcommit c_A0 |
| 314 |
$ mkcommit c_B0 |
| 315 |
$ cd .. |
| 316 |
|
| 317 |
Bob pulls from Alice and rewrites them |
| 318 |
|
| 319 |
$ cd repo-Bob |
| 320 |
$ hg pull ../repo-Alice |
| 321 |
pulling from ../repo-Alice |
| 322 |
searching for changes |
| 323 |
adding changesets |
| 324 |
adding manifests |
| 325 |
adding file changes |
| 326 |
added 2 changesets with 2 changes to 2 files |
| 327 |
new changesets d33b0a3a6464:ef908e42ce65 (2 drafts) |
| 328 |
(run 'hg update' to get a working copy) |
| 329 |
$ hg up 'desc("c_A")' |
| 330 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 331 |
$ hg commit --amend -m 'c_A1' |
| 332 |
1 new orphan changesets |
| 333 |
$ hg rebase -r 'desc("c_B0")' -d . # no easy way to rewrite the message with the rebase |
| 334 |
rebasing 2:ef908e42ce65 "c_B0" |
| 335 |
$ hg up |
| 336 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 337 |
$ hg commit --amend -m 'c_B1' |
| 338 |
$ hg log -G |
| 339 |
@ 5:956063ac4557 c_B1 |
| 340 |
| |
| 341 |
o 3:5b5708a437f2 c_A1 |
| 342 |
| |
| 343 |
o 0:e82fb8d02bbf ROOT |
| 344 |
|
| 345 |
$ hg log -G --hidden -v |
| 346 |
@ 5:956063ac4557 c_B1 |
| 347 |
| |
| 348 |
| x 4:5ffb9e311b35 c_B0 [rewritten using amend as 5:956063ac4557 by bob (at 1970-01-01 00:00 +0000)] |
| 349 |
|/ |
| 350 |
o 3:5b5708a437f2 c_A1 |
| 351 |
| |
| 352 |
| x 2:ef908e42ce65 c_B0 [rewritten using rebase as 4:5ffb9e311b35 by bob (at 1970-01-01 00:00 +0000)] |
| 353 |
| | |
| 354 |
| x 1:d33b0a3a6464 c_A0 [rewritten using amend as 3:5b5708a437f2 by bob (at 1970-01-01 00:00 +0000)] |
| 355 |
|/ |
| 356 |
o 0:e82fb8d02bbf ROOT |
| 357 |
|
| 358 |
$ hg debugobsolete |
| 359 |
d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'} |
| 360 |
ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'bob'} |
| 361 |
5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'} |
| 362 |
$ cd .. |
| 363 |
|
| 364 |
Celeste pulls from Bob and rewrites them again |
| 365 |
|
| 366 |
$ cd repo-Celeste |
| 367 |
$ hg pull ../repo-Bob |
| 368 |
pulling from ../repo-Bob |
| 369 |
searching for changes |
| 370 |
adding changesets |
| 371 |
adding manifests |
| 372 |
adding file changes |
| 373 |
added 2 changesets with 2 changes to 2 files |
| 374 |
3 new obsolescence markers |
| 375 |
new changesets 5b5708a437f2:956063ac4557 (2 drafts) |
| 376 |
(run 'hg update' to get a working copy) |
| 377 |
$ hg up 'desc("c_A")' |
| 378 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 379 |
$ hg commit --amend -m 'c_A2' |
| 380 |
1 new orphan changesets |
| 381 |
$ hg rebase -r 'desc("c_B1")' -d . # no easy way to rewrite the message with the rebase |
| 382 |
rebasing 2:956063ac4557 "c_B1" |
| 383 |
$ hg up |
| 384 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 385 |
$ hg commit --amend -m 'c_B2' |
| 386 |
$ hg log -G |
| 387 |
@ 5:77ae25d99ff0 c_B2 |
| 388 |
| |
| 389 |
o 3:9866d64649a5 c_A2 |
| 390 |
| |
| 391 |
o 0:e82fb8d02bbf ROOT |
| 392 |
|
| 393 |
$ hg log -G --hidden -v |
| 394 |
@ 5:77ae25d99ff0 c_B2 |
| 395 |
| |
| 396 |
| x 4:3cf8de21cc22 c_B1 [rewritten using amend as 5:77ae25d99ff0 by celeste (at 1970-01-01 00:00 +0000)] |
| 397 |
|/ |
| 398 |
o 3:9866d64649a5 c_A2 |
| 399 |
| |
| 400 |
| x 2:956063ac4557 c_B1 [rewritten using rebase as 4:3cf8de21cc22 by celeste (at 1970-01-01 00:00 +0000)] |
| 401 |
| | |
| 402 |
| x 1:5b5708a437f2 c_A1 [rewritten using amend as 3:9866d64649a5 by celeste (at 1970-01-01 00:00 +0000)] |
| 403 |
|/ |
| 404 |
o 0:e82fb8d02bbf ROOT |
| 405 |
|
| 406 |
$ hg debugobsolete |
| 407 |
5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'} |
| 408 |
d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'} |
| 409 |
ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'bob'} |
| 410 |
5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'} |
| 411 |
956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'celeste'} |
| 412 |
3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'} |
| 413 |
|
| 414 |
Celeste now pushes to the server |
| 415 |
|
| 416 |
(note: it would be enough to just have direct Celeste -> Alice exchange here. |
| 417 |
However using a central server seems more common) |
| 418 |
|
| 419 |
$ hg push |
| 420 |
pushing to $TESTTMP/distributed-chain-building/distributed-chain-building/server |
| 421 |
searching for changes |
| 422 |
adding changesets |
| 423 |
adding manifests |
| 424 |
adding file changes |
| 425 |
added 2 changesets with 2 changes to 2 files |
| 426 |
6 new obsolescence markers |
| 427 |
$ cd .. |
| 428 |
|
| 429 |
Now Alice pulls from the server, then from Bob |
| 430 |
|
| 431 |
Alice first retrieves the new evolution of its changesets and associated markers |
| 432 |
from the server (note: could be from Celeste directly) |
| 433 |
|
| 434 |
$ cd repo-Alice |
| 435 |
$ hg up 'desc(ROOT)' |
| 436 |
0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
| 437 |
$ hg pull |
| 438 |
pulling from $TESTTMP/distributed-chain-building/distributed-chain-building/server |
| 439 |
searching for changes |
| 440 |
adding changesets |
| 441 |
adding manifests |
| 442 |
adding file changes |
| 443 |
added 2 changesets with 0 changes to 2 files (+1 heads) |
| 444 |
6 new obsolescence markers |
| 445 |
obsoleted 2 changesets |
| 446 |
new changesets 9866d64649a5:77ae25d99ff0 (2 drafts) |
| 447 |
(run 'hg heads' to see heads) |
| 448 |
$ hg debugobsolete |
| 449 |
3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'} |
| 450 |
5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'} |
| 451 |
5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'} |
| 452 |
956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'celeste'} |
| 453 |
d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'} |
| 454 |
ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'bob'} |
| 455 |
|
| 456 |
Then, she pulls from Bob, pulling predecessors of the changeset she has |
| 457 |
already pulled. The changesets are not obsoleted in the Bob repo yet. Their |
| 458 |
successors do not exist in Bob repository yet. |
| 459 |
|
| 460 |
$ hg pull ../repo-Bob |
| 461 |
pulling from ../repo-Bob |
| 462 |
searching for changes |
| 463 |
adding changesets |
| 464 |
adding manifests |
| 465 |
adding file changes |
| 466 |
added 2 changesets with 0 changes to 2 files (+1 heads) |
| 467 |
(2 other changesets obsolete on arrival) |
| 468 |
(run 'hg heads' to see heads) |
| 469 |
$ hg log -G |
| 470 |
o 4:77ae25d99ff0 c_B2 |
| 471 |
| |
| 472 |
o 3:9866d64649a5 c_A2 |
| 473 |
| |
| 474 |
@ 0:e82fb8d02bbf ROOT |
| 475 |
|
| 476 |
$ hg debugobsolete |
| 477 |
3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'} |
| 478 |
5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'} |
| 479 |
5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'} |
| 480 |
956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'celeste'} |
| 481 |
d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'} |
| 482 |
ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'bob'} |
| 483 |
|
| 484 |
Same tests, but change coming from a bundle |
| 485 |
(testing with a bundle is interesting because absolutely no discovery or |
| 486 |
decision is made in that case, so receiving the changesets are not an option). |
| 487 |
|
| 488 |
$ hg rollback |
| 489 |
repository tip rolled back to revision 4 (undo pull) |
| 490 |
$ hg log -G |
| 491 |
o 4:77ae25d99ff0 c_B2 |
| 492 |
| |
| 493 |
o 3:9866d64649a5 c_A2 |
| 494 |
| |
| 495 |
@ 0:e82fb8d02bbf ROOT |
| 496 |
|
| 497 |
$ hg debugobsolete |
| 498 |
3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'} |
| 499 |
5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'} |
| 500 |
5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'} |
| 501 |
956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'celeste'} |
| 502 |
d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'} |
| 503 |
ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'bob'} |
| 504 |
$ hg -R ../repo-Bob bundle ../step-1.hg |
| 505 |
searching for changes |
| 506 |
2 changesets found |
| 507 |
$ hg unbundle ../step-1.hg |
| 508 |
adding changesets |
| 509 |
adding manifests |
| 510 |
adding file changes |
| 511 |
added 2 changesets with 0 changes to 2 files (+1 heads) |
| 512 |
(2 other changesets obsolete on arrival) |
| 513 |
(run 'hg heads' to see heads) |
| 514 |
$ hg log -G |
| 515 |
o 4:77ae25d99ff0 c_B2 |
| 516 |
| |
| 517 |
o 3:9866d64649a5 c_A2 |
| 518 |
| |
| 519 |
@ 0:e82fb8d02bbf ROOT |
| 520 |
|
| 521 |
$ hg log -G --hidden -v |
| 522 |
x 6:956063ac4557 c_B1 [rewritten using amend, rebase as 4:77ae25d99ff0 by celeste (at 1970-01-01 00:00 +0000)] |
| 523 |
| |
| 524 |
x 5:5b5708a437f2 c_A1 [rewritten using amend as 3:9866d64649a5 by celeste (at 1970-01-01 00:00 +0000)] |
| 525 |
| |
| 526 |
| o 4:77ae25d99ff0 c_B2 |
| 527 |
| | |
| 528 |
| o 3:9866d64649a5 c_A2 |
| 529 |
|/ |
| 530 |
| x 2:ef908e42ce65 c_B0 [rewritten using amend, rebase as 6:956063ac4557 by bob (at 1970-01-01 00:00 +0000)] |
| 531 |
| | |
| 532 |
| x 1:d33b0a3a6464 c_A0 [rewritten using amend as 5:5b5708a437f2 by bob (at 1970-01-01 00:00 +0000)] |
| 533 |
|/ |
| 534 |
@ 0:e82fb8d02bbf ROOT |
| 535 |
|
| 536 |
$ hg debugobsolete |
| 537 |
3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'} |
| 538 |
5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'} |
| 539 |
5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'} |
| 540 |
956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'celeste'} |
| 541 |
d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'} |
| 542 |
ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'bob'} |
| 543 |
|
| 544 |
|
| 545 |
Same tests, but with --rev, this prevent regressing case where `hg pull --rev |
| 546 |
X` has to process a X that is filtered locally. |
| 547 |
|
| 548 |
$ hg rollback |
| 549 |
repository tip rolled back to revision 4 (undo unbundle) |
| 550 |
$ hg pull ../repo-Bob --rev 956063ac4557 |
| 551 |
pulling from ../repo-Bob |
| 552 |
searching for changes |
| 553 |
adding changesets |
| 554 |
adding manifests |
| 555 |
adding file changes |
| 556 |
added 2 changesets with 0 changes to 2 files (+1 heads) |
| 557 |
(2 other changesets obsolete on arrival) |
| 558 |
(run 'hg heads' to see heads) |
| 559 |
|
| 560 |
With --update |
| 561 |
|
| 562 |
$ hg rollback |
| 563 |
repository tip rolled back to revision 4 (undo pull) |
| 564 |
$ hg pull ../repo-Bob --rev 956063ac4557 --update |
| 565 |
pulling from ../repo-Bob |
| 566 |
searching for changes |
| 567 |
adding changesets |
| 568 |
adding manifests |
| 569 |
adding file changes |
| 570 |
added 2 changesets with 0 changes to 2 files (+1 heads) |
| 571 |
(2 other changesets obsolete on arrival) |
| 572 |
abort: cannot update to target: filtered revision '6' |
| 573 |
[10] |
| 574 |
|
| 575 |
$ cd .. |
| 576 |
|
| 577 |
Test pull report consistency |
| 578 |
============================ |
| 579 |
|
| 580 |
obsolete but visible should be reported |
| 581 |
--------------------------------------- |
| 582 |
|
| 583 |
Setup |
| 584 |
|
| 585 |
$ hg init repo-a |
| 586 |
$ cat << EOF >> repo-a/.hg/hgrc |
| 587 |
> [ui] |
| 588 |
> username=test |
| 589 |
> EOF |
| 590 |
$ cd repo-a |
| 591 |
$ hg debugbuilddag .. |
| 592 |
$ hg debugobsolete `getid tip` |
| 593 |
1 new obsolescence markers |
| 594 |
obsoleted 1 changesets |
| 595 |
$ cd ../ |
| 596 |
$ hg clone --pull repo-a repo-b |
| 597 |
requesting all changes |
| 598 |
adding changesets |
| 599 |
adding manifests |
| 600 |
adding file changes |
| 601 |
added 1 changesets with 0 changes to 0 files |
| 602 |
new changesets 1ea73414a91b (1 drafts) |
| 603 |
updating to branch default |
| 604 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 605 |
$ hg -R repo-a up tip --hidden |
| 606 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 607 |
updated to hidden changeset 66f7d451a68b |
| 608 |
(hidden revision '66f7d451a68b' is pruned) |
| 609 |
$ hg -R repo-a branch foo |
| 610 |
marked working directory as branch foo |
| 611 |
(branches are permanent and global, did you want a bookmark?) |
| 612 |
$ hg -R repo-a commit -m foo |
| 613 |
1 new orphan changesets |
| 614 |
|
| 615 |
Actual test |
| 616 |
(BROKEN) |
| 617 |
|
| 618 |
$ hg -R repo-b pull |
| 619 |
pulling from $TESTTMP/distributed-chain-building/distributed-chain-building/repo-a |
| 620 |
searching for changes |
| 621 |
adding changesets |
| 622 |
adding manifests |
| 623 |
adding file changes |
| 624 |
added 2 changesets with 0 changes to 0 files |
| 625 |
1 new obsolescence markers |
| 626 |
1 new orphan changesets |
| 627 |
new changesets 66f7d451a68b:95d586532b49 (2 drafts) |
| 628 |
(run 'hg update' to get a working copy) |