Mercurial > hg
comparison tests/test-hook.t @ 27924:24361fb68cba stable
transaction: abort transaction during hook exception
The new transaction context did not handle the case where an exception during
close should still call release. This cause pretxnclose hooks that failed to
cause the transaction to fail without aborting, thus requiring a hg recover.
I've added a test.
author | Durham Goode <durham@fb.com> |
---|---|
date | Tue, 19 Jan 2016 15:18:21 -0800 |
parents | d6d3cf5fda6f |
children | 0c9e914029be |
comparison
equal
deleted
inserted
replaced
27923:f62dea3f3697 | 27924:24361fb68cba |
---|---|
722 tag: tip | 722 tag: tip |
723 user: test | 723 user: test |
724 date: Thu Jan 01 00:00:00 1970 +0000 | 724 date: Thu Jan 01 00:00:00 1970 +0000 |
725 summary: b | 725 summary: b |
726 | 726 |
727 $ cd .. | |
728 | |
729 pretxnclose hook failure should abort the transaction | |
730 | |
731 $ hg init txnfailure | |
732 $ cd txnfailure | |
733 $ touch a && hg commit -Aqm a | |
734 $ cat >> .hg/hgrc <<EOF | |
735 > [hooks] | |
736 > pretxnclose.error = exit 1 | |
737 > EOF | |
738 $ hg strip -r 0 --config extensions.strip= | |
739 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
740 saved backup bundle to * (glob) | |
741 transaction abort! | |
742 rollback completed | |
743 strip failed, full bundle stored in * (glob) | |
744 abort: pretxnclose.error hook exited with status 1 | |
745 [255] | |
746 $ hg recover | |
747 no interrupted transaction available | |
748 [1] |