# HG changeset patch # User Pierre-Yves David # Date 2014-10-13 21:52:38 # Node ID e48277540413f0b80e9182ef50a00726ce7ab10d # Parent 4f2222f86612934c8d326533b641e256aafe902a 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). diff --git a/tests/test-bundle2-exchange.t b/tests/test-bundle2-exchange.t --- a/tests/test-bundle2-exchange.t +++ b/tests/test-bundle2-exchange.t @@ -26,6 +26,7 @@ enable obsolescence > [phases] > publish=False > [hooks] + > changegroup = sh -c "HG_LOCAL= HG_NODE= HG_TAG= python \"$TESTDIR/printenv.py\" changegroup" > b2x-transactionclose = sh -c "HG_LOCAL= HG_NODE= HG_TAG= python \"$TESTDIR/printenv.py\" b2x-transactionclose" > EOF @@ -42,6 +43,7 @@ The extension requires a repo (currently adding manifests adding file changes added 8 changesets with 7 changes to 7 files (+3 heads) + changegroup hook: HG_SOURCE=unbundle HG_URL=bundle:*/tests/bundles/rebase.hg (glob) (run 'hg heads' to see heads, 'hg merge' to merge) $ cd .. @@ -63,6 +65,7 @@ clone --pull adding file changes added 2 changesets with 2 changes to 2 files 1 new obsolescence markers + changegroup hook: HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R other log -G @@ -84,6 +87,7 @@ pull adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) 1 new obsolescence markers + changegroup hook: HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg -R other log -G o 2:24b6387c8c8c draft Nicolas Dumazet F @@ -155,6 +159,7 @@ push pushing to other searching for changes b2x-transactionclose hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=push HG_URL=push + changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2 remote: adding changesets remote: adding manifests remote: adding file changes @@ -186,6 +191,7 @@ pull over ssh added 1 changesets with 1 changes to 1 files (+1 heads) 1 new obsolescence markers updating bookmark book_02de + changegroup hook: HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg -R other debugobsolete 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} @@ -207,6 +213,7 @@ pull over http added 1 changesets with 1 changes to 1 files (+1 heads) 1 new obsolescence markers updating bookmark book_42cc + changegroup hook: HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2 (run 'hg heads .' to see heads, 'hg merge' to merge) $ cat main-error.log $ hg -R other debugobsolete @@ -228,6 +235,7 @@ push over ssh remote: 1 new obsolescence markers updating bookmark book_5fdd remote: b2x-transactionclose hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 + remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2 $ hg -R other log -G o 6:5fddd98957c8 draft Nicolas Dumazet book_5fdd C | @@ -454,6 +462,7 @@ Doing the actual push: hook abort searching for changes transaction abort! rollback completed + changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=0 HG_SOURCE=bundle2 HG_URL=bundle2 abort: b2x-pretransactionclose.failpush hook exited with status 1 [255] @@ -463,6 +472,7 @@ Doing the actual push: hook abort abort: b2x-pretransactionclose.failpush hook exited with status 1 remote: transaction abort! remote: rollback completed + remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=0 HG_SOURCE=bundle2 HG_URL=bundle2 [255] $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6