[Request] [+ ] D9605: hook: set `HGPLAIN=1` for external hooks

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Tue Dec 15 00:37:53 UTC 2020


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

REVISION SUMMARY
  External hooks will probably turn around and run hg commands, so this seems like
  a reasonable convenience for people who miss it in the documentation.
  
  There are no test changes because `printenv.py` filters out anything without a
  "HG_" prefix.  It wouldn't be a useful test anyway, because this is already
  inherited from the test environment.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/hook.py

CHANGE DETAILS

diff --git a/mercurial/hook.py b/mercurial/hook.py
--- a/mercurial/hook.py
+++ b/mercurial/hook.py
@@ -157,6 +157,7 @@
             env[b'HG_PENDING'] = repo.root
     env[b'HG_HOOKTYPE'] = htype
     env[b'HG_HOOKNAME'] = name
+    env[b'HGPLAIN'] = b'1'
 
     for k, v in pycompat.iteritems(args):
         # transaction changes can accumulate MBs of data, so skip it



To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20201215/6addb64b/attachment.html>


More information about the Mercurial-patches mailing list