diff mercurial/dispatch.py @ 14992:188936b334b1 stable

dispatch: make sure global options on the command line take precedence So if a user has verbose=True somewhere in his .hgrc files, giving -q on the command line will override that. This basically reverts 1b8c70c9f47c.
author Idan Kamara <idankk86@gmail.com>
date Sat, 30 Jul 2011 21:04:14 +0300
parents 41c3a71c318d
children f6a737357195 f4b7be3f8430
line wrap: on
line diff
--- a/mercurial/dispatch.py	Wed Jul 27 18:35:35 2011 -0500
+++ b/mercurial/dispatch.py	Sat Jul 30 21:04:14 2011 +0300
@@ -608,11 +608,15 @@
         for cfg in cfgs:
             req.repo.ui.setconfig(*cfg)
 
-    for opt in ('verbose', 'debug', 'quiet', 'traceback'):
-        val = bool(options[opt])
-        if val:
+    if options['verbose'] or options['debug'] or options['quiet']:
+        for opt in ('verbose', 'debug', 'quiet'):
+            val = str(bool(options[opt]))
             for ui_ in uis:
-                ui_.setconfig('ui', opt, str(val))
+                ui_.setconfig('ui', opt, val)
+
+    if options['traceback']:
+        for ui_ in uis:
+            ui_.setconfig('ui', 'traceback', 'on')
 
     if options['noninteractive']:
         for ui_ in uis: