D2904: templatefuncs: add mailmap template function

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Fri Mar 30 21:21:31 EDT 2018


yuja added a comment.


  Queued, thanks. Can you send a followup?

INLINE COMMENTS

> templatefuncs.py:189
> +
> +    return stringutil.mapname(cache['mailmap'], author) or author
> +

Perhaps the last `or author` wouldn't be necessary because that's
the default of `mapname()`.

> stringutil.py:380
> +        # is an improperly formed author field
> +        if line.lstrip().startswith('#') or any(c not in line for c in '<>@'):
> +            continue

An example to make it crash: `b'>@<'` (which is nice emoticon btw.)

Perhaps we can remove this `any(...)` and add `if not email: continue` instead.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2904

To: sheehan, #hg-reviewers, yuja
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list