Add global options for setting encoding and encodingmode
authorMatt Mackall <mpm@selenic.com>
Sun, 03 Dec 2006 16:16:33 -0600
changeset 3774 a88e02081a88
parent 3773 b1eeaeb936ae
child 3775 6859d049ed9c
Add global options for setting encoding and encodingmode
mercurial/commands.py
--- a/mercurial/commands.py	Sun Dec 03 16:16:33 2006 -0600
+++ b/mercurial/commands.py	Sun Dec 03 16:16:33 2006 -0600
@@ -2315,6 +2315,8 @@
     ('', 'config', [], _('set/override config option')),
     ('', 'debug', None, _('enable debugging output')),
     ('', 'debugger', None, _('start debugger')),
+    ('', 'encoding', util._encoding, _('set the charset encoding')),
+    ('', 'encodingmode', util._encodingmode, _('set the charset encoding mode')),
     ('', 'lsprof', None, _('print improved command execution profile')),
     ('', 'traceback', None, _('print traceback on exception')),
     ('', 'time', None, _('time how long the command takes')),
@@ -2867,6 +2869,10 @@
 
     try:
         cmd, func, args, options, cmdoptions = parse(u, args)
+        if options["encoding"]:
+            util._encoding = options["encoding"]
+        if options["encodingmode"]:
+            util._encodingmode = options["encodingmode"]
         if options["time"]:
             def get_times():
                 t = os.times()