hgweb template author name person modifier

Jouni Airaksinen Jouni.Airaksinen at descom.fi
Fri Nov 26 11:44:59 UTC 2010


No problem, I understand why this way and see no reason to change it in 
Mercurial. I did not have the RFC in mind when wondering the issue. I've 
fixed the username issue in the user's end, just has to tell people to use 
correct format.

That said, Git has this handled so that name and email are separated in 
the configuration and those are used to construct properly formatted user 
names for commits.



From:   Mads Kiilerich <mads at kiilerich.com>
To:     Jouni Airaksinen <Jouni.Airaksinen at descom.fi>
Cc:     mercurial at selenic.com
Date:   26.11.2010 13.34
Subject:        Re: hgweb template author name person modifier



On 11/26/2010 10:24 AM, Jouni Airaksinen wrote:
> I was just fixing up an existing theme (monoblue) and noticed the use of
> author|person in the map file. In our repository this results in strange
> thing and I'm not entirely sure now how it should behave. It seems to
> drop too much (or too little) of the author's name in this way:
>
> "Firstname Lastname (emailaddress)" turns into "Firstname"
>
> and for another user it is:
>
> "Firstname Lastname <emailaddress>" turns into "Firstname Lastname"
>
> Probably just issue now with the usage of brackets? Which one is more
> correct now?

RFC 822 defined almost 30 years ago that email addresses (essentially) 
could be written as these examples shows:

some.thing at example.com
Firstname Lastname <some.thing at example.com>
"Firstname Lastname, something" <some.thing at example.com>
(comments)some.(are)thing at example.com(ignored)

The latter form was usually used as "some.thing at example.com (Firstname 
Lastname)", but "nobody" uses that form any more. Mercurial do not 
support parentheses at all.

_If_ Mercurial handled "Firstname Lastname (emailaddress)" it should 
assume that the person name was in the parantheses and yield 
"emailaddress" as the persons name. So no matter what, the format you 
are using is nonstandard and you can't expect that it is handled the way 
you would like to see it handled.

Mercurials extract-person-name-from-email-address functionality is an 
approximation that works fine in most cases but could be improved. It 
could for example handle '<some.thing at example.com>' and '"Firstname 
Lastname" <some.thing at example.com>' better.

The relevant code can be found in templatefilters.person and 
util.shortuser.

/Mads

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20101126/127585c5/attachment.html>


More information about the Mercurial mailing list