mercurial/hook.py
branchstable
changeset 46492 7289eac777ec
parent 46490 86b019899737
child 46493 b910be772eb9
--- a/mercurial/hook.py	Wed Feb 10 22:43:16 2021 +0100
+++ b/mercurial/hook.py	Wed Feb 10 23:21:21 2021 +0100
@@ -157,7 +157,12 @@
             env[b'HG_PENDING'] = repo.root
     env[b'HG_HOOKTYPE'] = htype
     env[b'HG_HOOKNAME'] = name
-    env[b'HGPLAIN'] = b'1'
+
+    plain = ui.configbool(b'hooks', b'%s:run-with-plain' % name)
+    if plain:
+        env[b'HGPLAIN'] = b'1'
+    else:
+        env[b'HGPLAIN'] = b''
 
     for k, v in pycompat.iteritems(args):
         # transaction changes can accumulate MBs of data, so skip it