HomePhabricator

match: let regex match function return a boolean

Authored by dlax.

Description

match: let regex match function return a boolean

Match function for regex pattern kind is built through
_buildregexmatch() and _buildmatch() using _rematcher() that returns a
re.match function, which either returns a match object or None. This
does not conform to Mercurial's matcher interface for call() or
exact(), which are expected to return a boolean value. We fix this by
building a lambda around _rematcher() in _buildregexmatch().

Accordingly, we update doctest examples to remove bool() calls that are
now useless.

Details

Committed
dlaxApr 7 2019, 10:53 AM
Parents
rHG1721b92f2b5e: match: make arguments of _expandsets() optional
Branches
Unknown
Tags
Unknown