Page MenuHomePhabricator

stringutil: improve check for failed mailmap line parsing

Authored by sheehan on Mar 31 2018, 4:37 PM.



The existing check for a bad mailmap file entry fails with inputs
like b'>@<'. This commit adds a function to check if a sufficient
amount of information has been parsed from a mailmap file entry.

At minimum, one email must be found (assumed to be the commit email).
If email is not empty and no names are found, then there must be
two emails. If there are at least one email and name, the mapping
is valid.

Diff Detail

rHG Mercurial
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

sheehan created this revision.Mar 31 2018, 4:37 PM
yuja accepted this revision.Mar 31 2018, 9:27 PM
This revision is now accepted and ready to land.Mar 31 2018, 9:27 PM
yuja added a comment.Mar 31 2018, 9:29 PM

Queued the series, thanks.


I renamed this to _ismailmaplineinvalid since this will never be
publicly used.

This revision was automatically updated to reflect the committed changes.