comparison tests/test-hook.t @ 46491:0760282995cf stable

hooks: add some test about HGPLAIN setting and hooks In Mercurial 5.7, hooks are now ran with HGPLAIN set, which is a behavior change in. I could not find explicit test about it so I am adding one. The next changesets will introduce more change to help user mitigate the behavior change when needed. Differential Revision: https://phab.mercurial-scm.org/D9979
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 10 Feb 2021 22:43:16 +0100
parents 95c4cca641f6
children 7289eac777ec
comparison
equal deleted inserted replaced
46490:86b019899737 46491:0760282995cf
1388 tag: tip 1388 tag: tip
1389 user: test 1389 user: test
1390 date: Thu Jan 01 00:00:00 1970 +0000 1390 date: Thu Jan 01 00:00:00 1970 +0000
1391 summary: a 1391 summary: a
1392 1392
1393
1394 unsetup the test
1395 ----------------
1396
1397 # touch the file to unconfuse chg with a diffrent mtime
1398 $ sleep 1
1399 $ touch $TESTTMP/untrusted.py
1400 $ cat << EOF >> $HGRCPATH
1401 > [extensions]
1402 > untrusted=!
1403 > EOF
1404
1405 HGPLAIN setting in hooks
1406 ========================
1407
1408 $ cat << EOF >> .hg/hgrc
1409 > [hooks]
1410 > pre-version.testing-default=echo '### default ###' plain: \$HGPLAIN
1411 > EOF
1412
1413 $ (unset HGPLAIN; hg version --quiet)
1414 ### default ### plain: 1
1415 Mercurial Distributed SCM (*) (glob)
1416
1417 $ HGPLAIN=1 hg version --quiet
1418 ### default ### plain: 1
1419 Mercurial Distributed SCM (*) (glob)