This is an archive of the discontinued Mercurial Phabricator instance.

stringutil: improve check for failed mailmap line parsing
ClosedPublic

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

Details

Summary

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

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

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.

mercurial/utils/stringutil.py
169

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

This revision was automatically updated to reflect the committed changes.