[PATCH 2 of 3] ui: enable alias exception when reading config in plain mode

Yann E. MORIN yann.morin.1998 at anciens.enib.fr
Mon May 16 17:54:08 CDT 2011


# HG changeset patch
# User "Yann E. MORIN" <yann.morin.1998 at anciens.enib.fr>
# Date 1305584272 -7200
# Node ID 81f26696042e079100c0bbcc886a1369b2da9a7e
# Parent  2e0bfc555cc8395dfbc5e59c8e036266655dc77f
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 at anciens.enib.fr>

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -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)


More information about the Mercurial-devel mailing list