Mercurial > hg
comparison tests/test-hook.t @ 24792:7d0421de8de3
hooks: add a 'txnabort' hook
This hook will be called whenever a transaction is aborted. This will make it
easy for people to clean up temporary content they may have created during a
transaction.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 16 Apr 2015 05:36:49 -0400 |
parents | d283517b260b |
children | 57f1dbc99631 |
comparison
equal
deleted
inserted
replaced
24791:89c5881d692c | 24792:7d0421de8de3 |
---|---|
13 > pre-cat = python "$TESTDIR/printenv.py" pre-cat | 13 > pre-cat = python "$TESTDIR/printenv.py" pre-cat |
14 > post-cat = python "$TESTDIR/printenv.py" post-cat | 14 > post-cat = python "$TESTDIR/printenv.py" post-cat |
15 > pretxnopen = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" pretxnopen" | 15 > pretxnopen = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" pretxnopen" |
16 > pretxnclose = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" pretxnclose" | 16 > pretxnclose = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" pretxnclose" |
17 > txnclose = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" txnclose" | 17 > txnclose = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" txnclose" |
18 > txnabort = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" txnabort" | |
18 > EOF | 19 > EOF |
19 $ echo a > a | 20 $ echo a > a |
20 $ hg add a | 21 $ hg add a |
21 $ hg commit -m a | 22 $ hg commit -m a |
22 precommit hook: HG_PARENT1=0000000000000000000000000000000000000000 | 23 precommit hook: HG_PARENT1=0000000000000000000000000000000000000000 |
159 pretxncommit hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a | 160 pretxncommit hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a |
160 5:6f611f8018c1 | 161 5:6f611f8018c1 |
161 5:6f611f8018c1 | 162 5:6f611f8018c1 |
162 pretxncommit.forbid hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a | 163 pretxncommit.forbid hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a |
163 transaction abort! | 164 transaction abort! |
165 txnabort hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob) | |
164 rollback completed | 166 rollback completed |
165 abort: pretxncommit.forbid1 hook exited with status 1 | 167 abort: pretxncommit.forbid1 hook exited with status 1 |
166 [255] | 168 [255] |
167 $ hg -q tip | 169 $ hg -q tip |
168 4:539e4b31b6dc | 170 4:539e4b31b6dc |