changeset 19639:09573ad59f7b

dispatch: move command line --config argument parsing to _runcatch() Previously, command line parsing of --config arguments was done in _dispatch. This means that it takes place after activating the debugger. In an upcoming patch, we will add a ui.debugger setting so we need to have this parsing done before _runcatch.
author Sean Farley <sean.michael.farley@gmail.com>
date Sat, 13 Jul 2013 16:33:07 -0500
parents 20096384754f
children 472fa3b782b1
files mercurial/dispatch.py
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Tue Aug 13 01:38:30 2013 +0200
+++ b/mercurial/dispatch.py	Sat Jul 13 16:33:07 2013 -0500
@@ -88,6 +88,17 @@
 
     try:
         try:
+
+            # read --config before doing anything else
+            # (e.g. to change trust settings for reading .hg/hgrc)
+            cfgs = _parseconfig(req.ui, _earlygetopt(['--config'], req.args))
+
+            if req.repo:
+                # copy configs that were passed on the cmdline (--config) to
+                # the repo ui
+                for cfg in cfgs:
+                    req.repo.ui.setconfig(*cfg)
+
             # enter the debugger before command execution
             if '--debugger' in req.args:
                 ui.warn(_("entering debugger - "
@@ -619,10 +630,6 @@
     args = req.args
     ui = req.ui
 
-    # read --config before doing anything else
-    # (e.g. to change trust settings for reading .hg/hgrc)
-    cfgs = _parseconfig(ui, _earlygetopt(['--config'], args))
-
     # check for cwd
     cwd = _earlygetopt(['--cwd'], args)
     if cwd:
@@ -699,10 +706,6 @@
     if req.repo:
         uis.add(req.repo.ui)
 
-        # copy configs that were passed on the cmdline (--config) to the repo ui
-        for cfg in cfgs:
-            req.repo.ui.setconfig(*cfg)
-
     if options['verbose'] or options['debug'] or options['quiet']:
         for opt in ('verbose', 'debug', 'quiet'):
             val = str(bool(options[opt]))