[PATCH 3 of 5 paths v3] ui.paths: filter config options containing "." (BC)

Gregory Szorc gregory.szorc at gmail.com
Sun Mar 15 00:18:27 CDT 2015

On Wed, Mar 11, 2015 at 3:55 PM, Matt Mackall <mpm at selenic.com> wrote:

> I agree that the odds of people having foo.bar paths is probably 100%:
> it is after all how DNS names are structured. Unfortunately it's also
> how our config namespace is structured.

I think it is important to distinguish between option names, option values,
and command line arguments.

For option values and command line arguments, absolutely we'll have periods
because of hostnames. However, I believe our logic there is to first
attempt to parse those values as URLs, then fall back to a filesystem-local
path if a scheme isn't present. (Follow-up idea: have Mercurial store URLs
in more situations because bare strings are more ambiguous.)

If we limit discussion to option values, I'm still not convinced supporting
periods is important.

> > I think a clean, one-time break is better.
> I greatly prefer zero-time breaks, but I don't have a great alternative
> suggestion. We do have a bit of precedent in the [auth] section though.
> Perhaps we can do:
> [paths]
> old.style = some/path
> new.style.path = some/other/pass
> new.style.option = foo
> bogus.option = foo
> Here, hg paths would list:
> old.style
> new.style
> bogus.option
> (..and we'd also change clone to make the default path setting
> "default.path".)

This is an interesting idea. I like how it avoids ambiguity between whether
an entry is a path or isn't. However, it still has concerns:

* Long-term Mercurial users now have to convert to a new config style to
use advanced options.
* Potential for collision between user-defined path names and per-path

I imagine a user will see they can add ".pushrev" to a path and produce a
snippet like:

central = https://hg.mozilla.org/mozilla-central
central.pushrev = .

Without the ".path", this situation is ambiguous. Do we then have to
examine common option prefixes and do some kind of disambiguation to figure
out the user's intent? What about something like this:

repo.prod = https://prod.hg.example.com/repo
repo.prod.pushrev = .
repo.dev = https://dev.hg.example.com/repo

I still think unsupported periods in path names is looking pretty
reasonable. So does separate [path.x] sections.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150314/4ea7d509/attachment.html>

More information about the Mercurial-devel mailing list