comparison tests/test-bundle2-exchange.t @ 22971:3fe571c74b27

changegroup: store source and url in the `hookargs` dict We store the source and url of the current data into `transaction.hookargs` this let us inherit it from upper layers that may have created a much wider transaction. We have to modify bundle2 at the same time to register the source and url in the transaction. We have to do it in the same patch otherwise, the `addchangegroup` call would fill these values and the hook calling will crash because of the duplicated 'source' and 'url' arguments passed to the hook call.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 14 Oct 2014 00:06:46 -0700
parents 7c13c9404c2c
children 44b16b59b80a
comparison
equal deleted inserted replaced
22970:d82e2223f132 22971:3fe571c74b27
151 push 151 push
152 $ hg -R main push other --rev eea13746799a --bookmark book_eea1 152 $ hg -R main push other --rev eea13746799a --bookmark book_eea1
153 pushing to other 153 pushing to other
154 searching for changes 154 searching for changes
155 b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_URL=push 155 b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_URL=push
156 changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_SOURCE=bundle2 HG_URL=bundle2 156 changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_SOURCE=push HG_URL=push
157 remote: adding changesets 157 remote: adding changesets
158 remote: adding manifests 158 remote: adding manifests
159 remote: adding file changes 159 remote: adding file changes
160 remote: added 1 changesets with 0 changes to 0 files (-1 heads) 160 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
161 remote: 1 new obsolescence markers 161 remote: 1 new obsolescence markers
227 remote: adding file changes 227 remote: adding file changes
228 remote: added 1 changesets with 1 changes to 1 files 228 remote: added 1 changesets with 1 changes to 1 files
229 remote: 1 new obsolescence markers 229 remote: 1 new obsolescence markers
230 updating bookmark book_5fdd 230 updating bookmark book_5fdd
231 remote: b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 231 remote: b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
232 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=bundle2 HG_URL=bundle2 232 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
233 $ hg -R other log -G 233 $ hg -R other log -G
234 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C 234 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
235 | 235 |
236 o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B 236 o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
237 | 237 |
454 $ hg -R main push other -r e7ec4e813ba6 454 $ hg -R main push other -r e7ec4e813ba6
455 pushing to other 455 pushing to other
456 searching for changes 456 searching for changes
457 transaction abort! 457 transaction abort!
458 rollback completed 458 rollback completed
459 changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=e7ec4e813ba6b07be2a0516ce1a74bb4e503f91a HG_SOURCE=bundle2 HG_URL=bundle2 459 changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=e7ec4e813ba6b07be2a0516ce1a74bb4e503f91a HG_SOURCE=push HG_URL=push
460 abort: b2x-pretransactionclose.failpush hook exited with status 1 460 abort: b2x-pretransactionclose.failpush hook exited with status 1
461 [255] 461 [255]
462 462
463 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 463 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
464 pushing to ssh://user@dummy/other 464 pushing to ssh://user@dummy/other
465 searching for changes 465 searching for changes
466 abort: b2x-pretransactionclose.failpush hook exited with status 1 466 abort: b2x-pretransactionclose.failpush hook exited with status 1
467 remote: transaction abort! 467 remote: transaction abort!
468 remote: rollback completed 468 remote: rollback completed
469 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=e7ec4e813ba6b07be2a0516ce1a74bb4e503f91a HG_SOURCE=bundle2 HG_URL=bundle2 469 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=e7ec4e813ba6b07be2a0516ce1a74bb4e503f91a HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
470 [255] 470 [255]
471 471
472 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 472 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
473 pushing to http://localhost:$HGPORT2/ 473 pushing to http://localhost:$HGPORT2/
474 searching for changes 474 searching for changes