Comments
Patch
@@ -1404,12 +1404,20 @@
$ cat << EOF >> .hg/hgrc
> [hooks]
> pre-version.testing-default=echo '### default ###' plain: \$HGPLAIN
+ > pre-version.testing-yes=echo '### yes #######' plain: \$HGPLAIN
+ > pre-version.testing-yes:run-with-plain=yes
+ > pre-version.testing-no=echo '### no ########' plain: \$HGPLAIN
+ > pre-version.testing-no:run-with-plain=no
> EOF
$ (unset HGPLAIN; hg version --quiet)
### default ### plain: 1
+ ### yes ####### plain: 1
+ ### no ######## plain:
Mercurial Distributed SCM (*) (glob)
$ HGPLAIN=1 hg version --quiet
### default ### plain: 1
+ ### yes ####### plain: 1
+ ### no ######## plain:
Mercurial Distributed SCM (*) (glob)
@@ -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'] = procutil.UNSET_ENV
for k, v in pycompat.iteritems(args):
# transaction changes can accumulate MBs of data, so skip it
@@ -1315,6 +1315,12 @@
generic=True,
)
coreconfigitem(
+ b'hooks',
+ b'.*:run-with-plain',
+ default=True,
+ generic=True,
+)
+coreconfigitem(
b'hgweb-paths',
b'.*',
default=list,