[PATCH 1 of 2] templatefuncs: add regexp search() function that extracts substring

Pulkit Goyal 7895pulkit at gmail.com
Thu Dec 13 12:01:05 EST 2018


On Thu, Dec 13, 2018 at 4:36 PM Yuya Nishihara <yuya at tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1544620797 -32400
> #      Wed Dec 12 22:19:57 2018 +0900
> # Node ID eeb0c3a62092414713689e9dce6e8949bd27692b
> # Parent  a6ba978d9ffb0dc8b0edb8f892a947776b6377c5
> templatefuncs: add regexp search() function that extracts substring
>
> This can be used to extract an issue number from a commit message, for
> example:
>
>   {search(r'\(issue([0-9]*)\)', desc) % '{1}'}
>

Nice, queued the series, many thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20181213/e58aab88/attachment.html>


More information about the Mercurial-devel mailing list