changeset 14373:a599431b0ab6

ui: enable alias exception when reading config in plain mode When in plain mode with "alias" present in the exception list, keep the aliases. This will be used later to enable auto-completion. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
date Tue, 17 May 2011 00:17:52 +0200
parents be0daa0eeb3e
children 51f444e85734
files mercurial/ui.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ui.py	Tue May 17 00:08:51 2011 +0200
+++ b/mercurial/ui.py	Tue May 17 00:17:52 2011 +0200
@@ -82,10 +82,12 @@
                       'traceback', 'verbose'):
                 if k in cfg['ui']:
                     del cfg['ui'][k]
+            for k, v in cfg.items('defaults'):
+                del cfg['defaults'][k]
+        # Don't remove aliases from the configuration if in the exceptionlist
+        if self.plain('alias'):
             for k, v in cfg.items('alias'):
                 del cfg['alias'][k]
-            for k, v in cfg.items('defaults'):
-                del cfg['defaults'][k]
 
         if trusted:
             self._tcfg.update(cfg)