ui: enable alias exception when reading config in plain mode
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue, 17 May 2011 00:17:52 +0200
changeset 14373 a599431b0ab6
parent 14372 be0daa0eeb3e
child 14374 51f444e85734
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>
mercurial/ui.py
--- 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)