test-bundle2: check visible data in pre/post-transaction hooks
We are about to make bookmarks and phases available for hooks.
Therefore we need a witness for this new availability. We introduce
the new hooks in a distinct changeset to reduce the noise in the ones
with actual changes.
--- a/tests/test-bundle2-exchange.t Fri Oct 17 22:19:05 2014 -0700
+++ b/tests/test-bundle2-exchange.t Wed Nov 12 16:54:57 2014 +0000
@@ -21,7 +21,9 @@
> publish=False
> [hooks]
> changegroup = sh -c "HG_LOCAL= python \"$TESTDIR/printenv.py\" changegroup"
- > b2x-transactionclose = sh -c "HG_LOCAL= python \"$TESTDIR/printenv.py\" b2x-transactionclose"
+ > b2x-pretransactionclose.tip = printf 'pre-close-tip:'; hg log -r tip -T '{node|short} {phase} {bookmarks}\n'
+ > b2x-transactionclose.tip = printf 'postclose-tip:'; hg log -r tip -T '{node|short} {phase} {bookmarks}\n'
+ > b2x-transactionclose.env = sh -c "HG_LOCAL= python \"$TESTDIR/printenv.py\" b2x-transactionclose"
> EOF
The extension requires a repo (currently unused)
@@ -59,6 +61,8 @@
adding file changes
added 2 changesets with 2 changes to 2 files
1 new obsolescence markers
+ pre-close-tip:9520eea781bc public
+ postclose-tip:9520eea781bc draft
b2x-transactionclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
changegroup hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
updating to branch default
@@ -82,6 +86,8 @@
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
1 new obsolescence markers
+ pre-close-tip:24b6387c8c8c public
+ postclose-tip:24b6387c8c8c draft
b2x-transactionclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
changegroup hook: HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
(run 'hg heads' to see heads, 'hg merge' to merge)
@@ -102,6 +108,8 @@
$ hg -R other pull -r 24b6387c8c8c
pulling from $TESTTMP/main (glob)
no changes found
+ pre-close-tip:000000000000 public
+ postclose-tip:24b6387c8c8c public
b2x-transactionclose hook: HG_NEW_OBSMARKERS=0 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
$ hg -R other log -G
o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
@@ -119,6 +127,8 @@
$ hg -R other pull -r 24b6387c8c8c
pulling from $TESTTMP/main (glob)
no changes found
+ pre-close-tip:24b6387c8c8c public
+ postclose-tip:24b6387c8c8c public
b2x-transactionclose hook: HG_NEW_OBSMARKERS=0 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
$ hg -R other log -G
o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
@@ -156,6 +166,8 @@
$ hg -R main push other --rev eea13746799a --bookmark book_eea1
pushing to other
searching for changes
+ pre-close-tip:eea13746799a draft
+ postclose-tip:eea13746799a public book_eea1
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
changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_SOURCE=push HG_URL=push
remote: adding changesets
@@ -189,6 +201,8 @@
added 1 changesets with 1 changes to 1 files (+1 heads)
1 new obsolescence markers
updating bookmark book_02de
+ pre-close-tip:02de42196ebe public
+ postclose-tip:02de42196ebe draft book_02de
b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=ssh://user@dummy/main
changegroup hook: HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_SOURCE=pull HG_URL=ssh://user@dummy/main
(run 'hg heads' to see heads, 'hg merge' to merge)
@@ -212,6 +226,8 @@
added 1 changesets with 1 changes to 1 files (+1 heads)
1 new obsolescence markers
updating bookmark book_42cc
+ pre-close-tip:42ccdea3bb16 public
+ postclose-tip:42ccdea3bb16 draft book_42cc
b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/
changegroup hook: HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/
(run 'hg heads .' to see heads, 'hg merge' to merge)
@@ -234,6 +250,8 @@
remote: added 1 changesets with 1 changes to 1 files
remote: 1 new obsolescence markers
updating bookmark book_5fdd
+ remote: pre-close-tip:5fddd98957c8 draft
+ remote: postclose-tip:5fddd98957c8 draft book_5fdd
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
remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
$ hg -R other log -G
@@ -469,6 +487,7 @@
$ hg -R main push other -r e7ec4e813ba6
pushing to other
searching for changes
+ pre-close-tip:e7ec4e813ba6 draft
transaction abort!
rollback completed
abort: b2x-pretransactionclose.failpush hook exited with status 1
@@ -478,6 +497,7 @@
pushing to ssh://user@dummy/other
searching for changes
abort: b2x-pretransactionclose.failpush hook exited with status 1
+ remote: pre-close-tip:e7ec4e813ba6 draft
remote: transaction abort!
remote: rollback completed
[255]