Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hook.py @ 46371:b910be772eb9 stable
hooks: add a `auto` value for `hooks.*run-with-plain`
That setting restore the behavior pre-5.6. The current HGPLAIN value is simply
passed to the hooks.
This allow user who needs it to fully mitigate the behavior change introduced
in Mercurial 5.7 by restoring the older behavior.
Differential Revision: https://phab.mercurial-scm.org/D9982
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 10 Feb 2021 23:03:54 +0100 |
parents | 7289eac777ec |
children | d4ba4d51f85f |
comparison
equal
deleted
inserted
replaced
46370:7289eac777ec | 46371:b910be772eb9 |
---|---|
156 if tr and tr.writepending(): | 156 if tr and tr.writepending(): |
157 env[b'HG_PENDING'] = repo.root | 157 env[b'HG_PENDING'] = repo.root |
158 env[b'HG_HOOKTYPE'] = htype | 158 env[b'HG_HOOKTYPE'] = htype |
159 env[b'HG_HOOKNAME'] = name | 159 env[b'HG_HOOKNAME'] = name |
160 | 160 |
161 plain = ui.configbool(b'hooks', b'%s:run-with-plain' % name) | 161 if ui.config(b'hooks', b'%s:run-with-plain' % name) == b'auto': |
162 plain = ui.plain() | |
163 else: | |
164 plain = ui.configbool(b'hooks', b'%s:run-with-plain' % name) | |
162 if plain: | 165 if plain: |
163 env[b'HGPLAIN'] = b'1' | 166 env[b'HGPLAIN'] = b'1' |
164 else: | 167 else: |
165 env[b'HGPLAIN'] = b'' | 168 env[b'HGPLAIN'] = b'' |
166 | 169 |