quoting of names in .hgrc

Matt Mackall mpm at selenic.com
Mon Sep 5 19:11:23 CDT 2005

On Mon, Sep 05, 2005 at 01:20:30PM +0200, Stefan van der Walt wrote:
> Hi,
> I often forget that strings arn't quoted in .hgrc.  My username then
> is parsed as "blah at blah.com" instead of blah at blah.com.
> Would it be viable to run the user string through two simple regular
> expressions first, in order to remove quote marks?  Something like
> import re
> q1 = re.compile('^"[^"]*"$')
> q2 = re.compile("^'[^']*'$")
> if (re.match(q1, name) or re.match(q2, name)):
>     name = name[1:-1]
> This way, names like Me "Nickname" <...> or "Me" Myself "I" are left
> intact, but the quotes are removed from names like "asdads
> <blah at blah.com>".

Making this specific to the username setting is too obscure and
special-case. Making it generic obviously keeps us from putting quotes
around other things.

Mathematics is the supreme nostalgia of our time.

More information about the Mercurial mailing list