diff mercurial/i18n.py @ 10455:40dfd46d098f

ui: add HGPLAIN environment variable for easier scripting If HGPLAIN is set, the following settings are ignored when read from hgrc files: - ui.debug - ui.fallbackencoding - ui.quiet - ui.traceback - ui.verbose - defaults.* Localization is also disabled. Equivalent options set via command line are honored.
author Brodie Rao <me+hg@dackz.net>
date Sun, 07 Feb 2010 14:56:18 +0100
parents 25e572394f5c
children 11cd65611f3f
line wrap: on
line diff
--- a/mercurial/i18n.py	Sat Feb 13 23:24:27 2010 -0600
+++ b/mercurial/i18n.py	Sun Feb 07 14:56:18 2010 +0100
@@ -48,5 +48,8 @@
         # An unknown encoding results in a LookupError.
         return message
 
-_ = gettext
+if 'HGPLAIN' in os.environ:
+    _ = lambda message: message
+else:
+    _ = gettext