##// END OF EJS Templates
templates/filters: strip quotes from {author|person}...
templates/filters: strip quotes from {author|person} RFC5322 (Internet Message Format) [0] says that the 'display name' of an internet address [1] (what Mercurial calls 'person') can be quoted with DQUOTE (ASCII 34: ") if it contains non-atom characters [2]. For example, dot '.' is a non-atom character. Also, DQUOTEs in a quoted string will be escaped using "\" [2][3]. The current {author|person} template+filter just extracts the part before an email address as-is. This can look ugly, especially on the web interface, or when generating output for post-processing... Moreover, as an example, the Mercurial repository has a bunch of incoherent uses of DQUOTES in author names. As per Matt's digging: $ hg log --template "{author|person}\n" | grep '"' | sort | uniq "Andrei Vermel "Aurelien Jacobs "Daniel Santa Cruz "Hidetaka Iwai "Hiroshi Funai" "Mathieu Clabaut "Paul Moore "Peter Arrenbrecht" "Rafael Villar Burke "Shun-ichi GOTO" "Wallace, Eric S" "Yann E. MORIN" Josef "Jeff" Sipek Radoslaw "AstralStorm" Szkodzinski Fix the 'person' filter to remove leading and trailing DQUOTES, and unescape remaining DQUOTES. Given this author: "J. \"random\" DOE" <john@doe.net> before: {author|person} : "J. \"random\" DOE" after: {author|person} : J. "random" DOE For the Mercurial repository, that leaves us with two authors with DQUOTES, in acceptable positions: $ hg log --template "{author|person}\n" | grep '"' | sort | uniq Josef "Jeff" Sipek Radoslaw "AstralStorm" Szkodzinski [0] https://tools.ietf.org/html/rfc5322 [1] https://tools.ietf.org/html/rfc5322#section-3.4 [2] https://tools.ietf.org/html/rfc5322#section-3.2.4 [3] https://tools.ietf.org/html/rfc5322#section-3.2.1 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
"Yann E. MORIN" -
r16235:eb39bbda default
Show More
Name Size Modified Last Commit Author
contrib
doc
hgext
i18n
mercurial
tests
.hgignore Loading ...
.hgsigs Loading ...
.hgtags Loading ...
CONTRIBUTORS Loading ...
COPYING Loading ...
Makefile Loading ...
README Loading ...
hg Loading ...
hgeditor Loading ...
hgweb.cgi Loading ...
setup.py Loading ...

Mercurial
=========

Mercurial is a fast, easy to use, distributed revision control tool
for software developers.

Basic install:

$ make # see install targets
$ make install # do a system-wide install
$ hg debuginstall # sanity-check setup
$ hg # see help

Running without installing:

$ make local # build for inplace usage
$ ./hg --version # should show the latest version

See http://mercurial.selenic.com/ for detailed installation
instructions, platform-specific notes, and Mercurial user information.