Search code examples
mercurial

Mercurial template filters: user vs. emailuser?


What are the exact semantic differences between the user and emailuser template filters?

If my ~/.hgrc looks like this:

[ui]
username = First Last <[email protected]>

and then I use hg log -T {author|user} I get "first", whereas if I use hg log -T {author|emailuser} I get "first.last". Is the primary difference just how the email field is parsed, and whether non-alphabetical characters are included?


Solution

  • It depends.

    Mainly from style of username, for long dot-separated names you'll see difference in these two filters. For example, if I have changeset with author Dan Villiom Podlaski Christiansen <dan.villiom.podlaski.christiansen@domain> I got

    >hg log -T "{node|short} - {author|user} {author|emailuser}\n" -r 981e
    >981e4f6d2c08 - dan dan.villiom.podlaski.christiansen