Show More
@@ -1338,6 +1338,12 b' coreconfigitem(' | |||
|
1338 | 1338 | generic=True, |
|
1339 | 1339 | ) |
|
1340 | 1340 | coreconfigitem( |
|
1341 | b'hooks', | |
|
1342 | b'.*:run-with-plain', | |
|
1343 | default=True, | |
|
1344 | generic=True, | |
|
1345 | ) | |
|
1346 | coreconfigitem( | |
|
1341 | 1347 | b'hgweb-paths', |
|
1342 | 1348 | b'.*', |
|
1343 | 1349 | default=list, |
@@ -1027,6 +1027,11 b' Example ``.hg/hgrc``::' | |||
|
1027 | 1027 | incoming.autobuild = /my/build/hook |
|
1028 | 1028 | # force autobuild hook to run before other incoming hooks |
|
1029 | 1029 | priority.incoming.autobuild = 1 |
|
1030 | ### control HGPLAIN setting when running autobuild hook | |
|
1031 | # HGPLAIN always set (default from Mercurial 5.7) | |
|
1032 | incoming.autobuild:run-with-plain = yes | |
|
1033 | # HGPLAIN never set | |
|
1034 | incoming.autobuild:run-with-plain = no | |
|
1030 | 1035 | |
|
1031 | 1036 | Most hooks are run with environment variables set that give useful |
|
1032 | 1037 | additional information. For each hook below, the environment variables |
@@ -157,7 +157,12 b' def _exthook(ui, repo, htype, name, cmd,' | |||
|
157 | 157 | env[b'HG_PENDING'] = repo.root |
|
158 | 158 | env[b'HG_HOOKTYPE'] = htype |
|
159 | 159 | env[b'HG_HOOKNAME'] = name |
|
160 | env[b'HGPLAIN'] = b'1' | |
|
160 | ||
|
161 | plain = ui.configbool(b'hooks', b'%s:run-with-plain' % name) | |
|
162 | if plain: | |
|
163 | env[b'HGPLAIN'] = b'1' | |
|
164 | else: | |
|
165 | env[b'HGPLAIN'] = b'' | |
|
161 | 166 | |
|
162 | 167 | for k, v in pycompat.iteritems(args): |
|
163 | 168 | # transaction changes can accumulate MBs of data, so skip it |
@@ -1407,13 +1407,21 b' HGPLAIN setting in hooks' | |||
|
1407 | 1407 | |
|
1408 | 1408 | $ cat << EOF >> .hg/hgrc |
|
1409 | 1409 | > [hooks] |
|
1410 | > pre-version.testing-default=echo '### default ###' plain: \$HGPLAIN | |
|
1410 | > pre-version.testing-default=echo '### default ###' plain: \${HGPLAIN:-'<unset>'} | |
|
1411 | > pre-version.testing-yes=echo '### yes #######' plain: \${HGPLAIN:-'<unset>'} | |
|
1412 | > pre-version.testing-yes:run-with-plain=yes | |
|
1413 | > pre-version.testing-no=echo '### no ########' plain: \${HGPLAIN:-'<unset>'} | |
|
1414 | > pre-version.testing-no:run-with-plain=no | |
|
1411 | 1415 | > EOF |
|
1412 | 1416 | |
|
1413 | 1417 | $ (unset HGPLAIN; hg version --quiet) |
|
1414 | 1418 | ### default ### plain: 1 |
|
1419 | ### yes ####### plain: 1 | |
|
1420 | ### no ######## plain: <unset> | |
|
1415 | 1421 | Mercurial Distributed SCM (*) (glob) |
|
1416 | 1422 | |
|
1417 | 1423 | $ HGPLAIN=1 hg version --quiet |
|
1418 | 1424 | ### default ### plain: 1 |
|
1425 | ### yes ####### plain: 1 | |
|
1426 | ### no ######## plain: <unset> | |
|
1419 | 1427 | Mercurial Distributed SCM (*) (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now