Mercurial > hg-stable
comparison tests/test-bundle2-exchange.t @ 22939:e48277540413
test-bundle2: also test the argument of the changegroup hook
We also track execution of the changegroup hook. The important information here
is to make sure the information that the transaction was processing a bundle2 is passed to
hook. This will let most hooks disable themselves while waiting for the hook
concluding bundle2 processing (the one we discovered to be not called for
pull in the previous changesets).
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 13 Oct 2014 14:52:38 -0700 |
parents | 4f2222f86612 |
children | e803186296ab |
comparison
equal
deleted
inserted
replaced
22938:4f2222f86612 | 22939:e48277540413 |
---|---|
24 > push_ssl = false | 24 > push_ssl = false |
25 > allow_push = * | 25 > allow_push = * |
26 > [phases] | 26 > [phases] |
27 > publish=False | 27 > publish=False |
28 > [hooks] | 28 > [hooks] |
29 > changegroup = sh -c "HG_LOCAL= HG_NODE= HG_TAG= python \"$TESTDIR/printenv.py\" changegroup" | |
29 > b2x-transactionclose = sh -c "HG_LOCAL= HG_NODE= HG_TAG= python \"$TESTDIR/printenv.py\" b2x-transactionclose" | 30 > b2x-transactionclose = sh -c "HG_LOCAL= HG_NODE= HG_TAG= python \"$TESTDIR/printenv.py\" b2x-transactionclose" |
30 > EOF | 31 > EOF |
31 | 32 |
32 The extension requires a repo (currently unused) | 33 The extension requires a repo (currently unused) |
33 | 34 |
40 $ hg unbundle $TESTDIR/bundles/rebase.hg | 41 $ hg unbundle $TESTDIR/bundles/rebase.hg |
41 adding changesets | 42 adding changesets |
42 adding manifests | 43 adding manifests |
43 adding file changes | 44 adding file changes |
44 added 8 changesets with 7 changes to 7 files (+3 heads) | 45 added 8 changesets with 7 changes to 7 files (+3 heads) |
46 changegroup hook: HG_SOURCE=unbundle HG_URL=bundle:*/tests/bundles/rebase.hg (glob) | |
45 (run 'hg heads' to see heads, 'hg merge' to merge) | 47 (run 'hg heads' to see heads, 'hg merge' to merge) |
46 | 48 |
47 $ cd .. | 49 $ cd .. |
48 | 50 |
49 Real world exchange | 51 Real world exchange |
61 adding changesets | 63 adding changesets |
62 adding manifests | 64 adding manifests |
63 adding file changes | 65 adding file changes |
64 added 2 changesets with 2 changes to 2 files | 66 added 2 changesets with 2 changes to 2 files |
65 1 new obsolescence markers | 67 1 new obsolescence markers |
68 changegroup hook: HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2 | |
66 updating to branch default | 69 updating to branch default |
67 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | 70 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
68 $ hg -R other log -G | 71 $ hg -R other log -G |
69 @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E | 72 @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E |
70 | | 73 | |
82 adding changesets | 85 adding changesets |
83 adding manifests | 86 adding manifests |
84 adding file changes | 87 adding file changes |
85 added 1 changesets with 1 changes to 1 files (+1 heads) | 88 added 1 changesets with 1 changes to 1 files (+1 heads) |
86 1 new obsolescence markers | 89 1 new obsolescence markers |
90 changegroup hook: HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2 | |
87 (run 'hg heads' to see heads, 'hg merge' to merge) | 91 (run 'hg heads' to see heads, 'hg merge' to merge) |
88 $ hg -R other log -G | 92 $ hg -R other log -G |
89 o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F | 93 o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F |
90 | | 94 | |
91 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E | 95 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E |
153 push | 157 push |
154 $ hg -R main push other --rev eea13746799a --bookmark book_eea1 | 158 $ hg -R main push other --rev eea13746799a --bookmark book_eea1 |
155 pushing to other | 159 pushing to other |
156 searching for changes | 160 searching for changes |
157 b2x-transactionclose hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=push HG_URL=push | 161 b2x-transactionclose hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=push HG_URL=push |
162 changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2 | |
158 remote: adding changesets | 163 remote: adding changesets |
159 remote: adding manifests | 164 remote: adding manifests |
160 remote: adding file changes | 165 remote: adding file changes |
161 remote: added 1 changesets with 0 changes to 0 files (-1 heads) | 166 remote: added 1 changesets with 0 changes to 0 files (-1 heads) |
162 remote: 1 new obsolescence markers | 167 remote: 1 new obsolescence markers |
184 adding manifests | 189 adding manifests |
185 adding file changes | 190 adding file changes |
186 added 1 changesets with 1 changes to 1 files (+1 heads) | 191 added 1 changesets with 1 changes to 1 files (+1 heads) |
187 1 new obsolescence markers | 192 1 new obsolescence markers |
188 updating bookmark book_02de | 193 updating bookmark book_02de |
194 changegroup hook: HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2 | |
189 (run 'hg heads' to see heads, 'hg merge' to merge) | 195 (run 'hg heads' to see heads, 'hg merge' to merge) |
190 $ hg -R other debugobsolete | 196 $ hg -R other debugobsolete |
191 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | 197 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
192 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | 198 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
193 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | 199 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
205 adding manifests | 211 adding manifests |
206 adding file changes | 212 adding file changes |
207 added 1 changesets with 1 changes to 1 files (+1 heads) | 213 added 1 changesets with 1 changes to 1 files (+1 heads) |
208 1 new obsolescence markers | 214 1 new obsolescence markers |
209 updating bookmark book_42cc | 215 updating bookmark book_42cc |
216 changegroup hook: HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2 | |
210 (run 'hg heads .' to see heads, 'hg merge' to merge) | 217 (run 'hg heads .' to see heads, 'hg merge' to merge) |
211 $ cat main-error.log | 218 $ cat main-error.log |
212 $ hg -R other debugobsolete | 219 $ hg -R other debugobsolete |
213 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | 220 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
214 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | 221 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
226 remote: adding file changes | 233 remote: adding file changes |
227 remote: added 1 changesets with 1 changes to 1 files | 234 remote: added 1 changesets with 1 changes to 1 files |
228 remote: 1 new obsolescence markers | 235 remote: 1 new obsolescence markers |
229 updating bookmark book_5fdd | 236 updating bookmark book_5fdd |
230 remote: b2x-transactionclose hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 | 237 remote: b2x-transactionclose hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 |
238 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2 | |
231 $ hg -R other log -G | 239 $ hg -R other log -G |
232 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C | 240 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C |
233 | | 241 | |
234 o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B | 242 o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B |
235 | | 243 | |
452 $ hg -R main push other -r e7ec4e813ba6 | 460 $ hg -R main push other -r e7ec4e813ba6 |
453 pushing to other | 461 pushing to other |
454 searching for changes | 462 searching for changes |
455 transaction abort! | 463 transaction abort! |
456 rollback completed | 464 rollback completed |
465 changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=0 HG_SOURCE=bundle2 HG_URL=bundle2 | |
457 abort: b2x-pretransactionclose.failpush hook exited with status 1 | 466 abort: b2x-pretransactionclose.failpush hook exited with status 1 |
458 [255] | 467 [255] |
459 | 468 |
460 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | 469 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
461 pushing to ssh://user@dummy/other | 470 pushing to ssh://user@dummy/other |
462 searching for changes | 471 searching for changes |
463 abort: b2x-pretransactionclose.failpush hook exited with status 1 | 472 abort: b2x-pretransactionclose.failpush hook exited with status 1 |
464 remote: transaction abort! | 473 remote: transaction abort! |
465 remote: rollback completed | 474 remote: rollback completed |
475 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=0 HG_SOURCE=bundle2 HG_URL=bundle2 | |
466 [255] | 476 [255] |
467 | 477 |
468 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | 478 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 |
469 pushing to http://localhost:$HGPORT2/ | 479 pushing to http://localhost:$HGPORT2/ |
470 searching for changes | 480 searching for changes |