[PATCH] Allow explicit disabling of extensions

Matt Mackall mpm at selenic.com
Fri Sep 28 16:36:53 CDT 2007


On Tue, Sep 18, 2007 at 07:54:55PM -0500, Steve Borho wrote:
> # HG changeset patch
> # User Steve Borho <steve at borho.org>
> # Date 1190163181 18000
> # Node ID 98203cff47ce85df26094d03eda8c79ab858f2e2
> # Parent  ba3dc78839686ccb285f4227a80356f7b13e6f8f
> Allow explicit disabling of extensions
> 
> If the first character of an extension path is '!', the extension
> is silently skipped.
> 
> diff --git a/mercurial/extensions.py b/mercurial/extensions.py
> --- a/mercurial/extensions.py
> +++ b/mercurial/extensions.py
> @@ -70,6 +70,8 @@ def loadall(ui):
>      result = ui.configitems("extensions")
>      for i, (name, path) in enumerate(result):
>          if path:
> +            if path[0] == '!':
> +                continue
>              path = os.path.expanduser(path)
>          try:
>              load(ui, name, path)

Does this work for extensions specified in .hg/hgrc? There's some
magic there.

Perhaps we want to generalize this to all config options in some fashion?

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial-devel mailing list