changeset 13849 | 9f97de157aad |
parent 11403 | f7d7de6eccc8 |
child 14975 | b64538363dbe |
--- a/mercurial/i18n.py Thu Mar 31 17:37:33 2011 -0700 +++ b/mercurial/i18n.py Wed Jan 05 00:18:36 2011 +1100 @@ -51,7 +51,13 @@ # An unknown encoding results in a LookupError. return message -if 'HGPLAIN' in os.environ: +def _plain(): + if 'HGPLAIN' not in os.environ and 'HGPLAINEXCEPT' not in os.environ: + return False + exceptions = os.environ.get('HGPLAINEXCEPT', '').strip().split(',') + return 'i18n' not in exceptions + +if _plain(): _ = lambda message: message else: _ = gettext