hgrc ConfigParser rewrite

Thomas Arendsen Hein thomas at intevation.de
Thu Mar 27 03:18:31 CDT 2008


Hi!

Since mpm is working on a sane replacement for ConfigParser, it may
be time to start a thread about the details:

1. Line continuations are useful, especially with web.description
and hooks, so I'd like to have them in the new implementation, too.

2. The variable subsitution code is supposed to go away (+1 on
that), but yesterday the following showed up in the wiki:

  http://www.selenic.com/mercurial/wiki/index.cgi/TipsAndTricks/Basic
  === Using config substitution and the [DEFAULT] section of hgrc ===
  {{{
  [DEFAULT]
  HOME = /home/myuser

  [ui]
  ignore.mine = %(HOME)s/.hgignore.mine
  style = %(HOME)s/.hg-styles/hg-map-cmdline.color

  [paths]
  dotfiles = %(HOME)s/

  [extensions]
  # Avoid the [DEFAULT] extension bug
  HOME = !
  }}}

Unlike we assumed, we had documented this in the hgrc man page:
"The  optional  values  can  contain format strings which refer to
other values in the same section, or values in a special DEFAULT
section."

But as this example shows: It is broken anyway and we just need to
add support for expanding ~ in all kind of paths (but this isn't the
job of the new config parser, unless you can declare types to
settings and one of these types is "path".

3. Storing the order of entries is useful, e.g. for decode/encode
filters, but I think you're doing this anyway, right?

Regards,
Thomas

-- 
thomas at intevation.de - http://intevation.de/~thomas/ - OpenPGP key: 0x5816791A
Intevation GmbH, Osnabrueck - Register: Amtsgericht Osnabrueck, HR B 18998
Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner


More information about the Mercurial-devel mailing list