D9979: hooks: add some test about HGPLAIN setting and hooks

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Wed Feb 10 23:47:20 UTC 2021


marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D9979

AFFECTED FILES
  tests/test-hook.t

CHANGE DETAILS

diff --git a/tests/test-hook.t b/tests/test-hook.t
--- a/tests/test-hook.t
+++ b/tests/test-hook.t
@@ -1390,3 +1390,26 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     a
   
+
+unsetup the test
+----------------
+  $ cat << EOF >> $HGRCPATH
+  > [extensions]
+  > untrusted=!
+  > EOF
+
+HGPLAIN setting in hooks
+========================
+
+  $ cat << EOF >> .hg/hgrc
+  > [hooks]
+  > pre-version.testing-default=echo '### default ###' plain: \$HGPLAIN
+  > EOF
+
+  $ (unset HGPLAIN; hg version --quiet)
+  ### default ### plain: 1
+  Mercurial Distributed SCM (*) (glob)
+
+  $ HGPLAIN=1 hg version --quiet
+  ### default ### plain: 1
+  Mercurial Distributed SCM (*) (glob)



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list