Create a repo and add some commits $ hg init mm $ cd mm $ echo "Test content" > testfile1 $ hg add testfile1 $ hg commit -m "First commit" -u "Proper " $ echo "Test content 2" > testfile2 $ hg add testfile2 $ hg commit -m "Second commit" -u "Commit Name 2 " $ echo "Test content 3" > testfile3 $ hg add testfile3 $ hg commit -m "Third commit" -u "Commit Name 3 " $ echo "Test content 4" > testfile4 $ hg add testfile4 $ hg commit -m "Fourth commit" -u "Commit Name 4 " Add a .mailmap file with each possible entry type plus comments $ cat > .mailmap << EOF > # Comment shouldn't break anything > # Should update email only > Proper Name 2 # Should update name only > Proper Name 3 # Should update name, email due to email > Proper Name 4 Commit Name 4 # Should update name, email due to name, email > EOF $ hg add .mailmap $ hg commit -m "Add mailmap file" -u "Testuser " Output of commits should be normal without filter $ hg log -T "{author}\n" -r "all()" Proper Commit Name 2 Commit Name 3 Commit Name 4 Testuser Output of commits with filter shows their mailmap values $ hg log -T "{mailmap(author)}\n" -r "all()" Proper Proper Name 2 Proper Name 3 Proper Name 4 Testuser Add new mailmap entry for testuser $ cat >> .mailmap << EOF > > EOF Output of commits with filter shows their updated mailmap values $ hg log -T "{mailmap(author)}\n" -r "all()" Proper Proper Name 2 Proper Name 3 Proper Name 4 Testuser A commit with improperly formatted user field should not break the filter $ echo "some more test content" > testfile1 $ hg commit -m "Commit with improper user field" -u "Improper user" $ hg log -T "{mailmap(author)}\n" -r "all()" Proper Proper Name 2 Proper Name 3 Proper Name 4 Testuser Improper user No TypeError beacause of invalid input $ hg log -T '{mailmap(termwidth)}\n' -r0 80