[PATCH 1 of 2] hgwebdir: read --webdir-conf as actual configuration to ui (issue 1586)

Matt Mackall mpm at selenic.com
Mon Apr 27 17:12:36 CDT 2009


On Mon, 2009-04-27 at 22:25 +0300, Alexander Solovyov wrote:
> # HG changeset patch
> # User Alexander Solovyov <piranha at piranha.org.ua>
> # Date 1240859610 -10800
> # Node ID 0d132beefc842e553ddcbd2bcab7c0698bcd7408
> # Parent  360b7d9990227cd1669656ab792a4f1e26e26acc
> hgwebdir: read --webdir-conf as actual configuration to ui (issue 1586)
> 
> This cleans up code and allows specification of values more globally. For
> example, it's now possible to specify web.contact in webdir-conf for all
> repositories with unspecified contact.

>          if baseui:
>              self.ui = baseui.copy()
> +            # ui will contain 'paths' if they were present in user or
> +            # system-wide config. They should be dropped.
> +            if self.ui.has_section('paths'):
> +                self.ui.remove_section('paths')

I think this is the wrong approach. Various things (like ui.expandpath)
expect particular things from the paths section and we're just asking
for trouble by giving it a special meaning in the hgwebdir context.

A better approach would be to remap the hgweb-specific paths section to
one with a non-colliding name in the merged global config. For instance,
hgwebdir-paths.

-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial-devel mailing list