Adds a function to determine if an author field is formatted
correctly (ie "Contributor Name <something@something.com>")
Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
Comment Actions
We are trying to slim down util.py, do you think it would be possible to put it in a new module, something like utils/authorutil.py?
@pulkit do we need the b prefix when calling re.compile for Python3 compat?
Comment Actions
We are trying to slim down util.py, do you think it would be possible to
put it in a new module, something like utils/authorutil.py?
+1. It could be utils/stringutil.py if "author" is too specific.
Some potential functions that should be moved:
- stringmatcher() (if "stringutil")
- shortuser()
- emailuser()
- email()
- ellipsis() (if "stringutil")
- escapestr() (if "stringutil")
- unescapestr() (if "stringutil")
- forcebytestr() (if "stringutil")
- uirepr() (maybe if "stringutil")
- wrap() (maybe if "stringutil")
Comment Actions
Not necessary, transformer will do that but it will be good adding the b'' prefix.
br'' is preferred here because Python 3 is getting stricter on invalid \<char>
escapes.