diff tests/test-hook.t @ 24821:57f1dbc99631 stable

afterlock: add the callback to the top level lock (issue4608) If 'wlock' is taken, we should add 'afterlock' callback to the 'wlock' instead. Otherwise, running post transaction hook after 'lock' is release but 'wlock' is still taken lead to a deadlock (eg: 'hg update' during a hook). This situation is much more common since: 5dc5cd7abbf5 push: acquire local 'wlock' if "pushback" is expected (BC) (issue4596)
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 20 Apr 2015 15:27:55 +0200
parents 7d0421de8de3
children 2f2de8a7f97f
line wrap: on
line diff
--- a/tests/test-hook.t	Mon Apr 20 16:05:32 2015 +0200
+++ b/tests/test-hook.t	Mon Apr 20 15:27:55 2015 +0200
@@ -1,4 +1,5 @@
 commit hooks can see env vars
+(and post-transaction one are run unlocked)
 
   $ hg init a
   $ cd a
@@ -16,6 +17,7 @@
   > pretxnclose = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" pretxnclose"
   > txnclose = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" txnclose"
   > txnabort = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" txnabort"
+  > txnclose.checklock = hg debuglock > /dev/null
   > EOF
   $ echo a > a
   $ hg add a