[PATCH 4 of 5] patchbomb: add config option to generate flag by template

Matt Mackall mpm at selenic.com
Wed Apr 1 17:16:09 CDT 2015


On Wed, 2015-04-01 at 22:25 +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1427726446 -32400
> #      Mon Mar 30 23:40:46 2015 +0900
> # Node ID 98290eaf4e6bf993f5e351bd8f954b8f6e99479a
> # Parent  79696ed77d0e958b4291900a831981211e6d6bfe
> patchbomb: add config option to generate flag by template
> 
> This allows us to flag stable patches automatically.
> 
>   [patchbomb]
>   flagtemplate = {ifeq(branch, 'default', '', branch|upper)}

This is a very interesting idea, but it really makes me think we want to
have a more generic facility.

For instance, archive and export both have support for doing %-expansion
in filenames. But they don't know about branches or bookmarks yet. 

I can imagine having a fairly generic function like:

 flag = cmdutil.expandopt(opts.get['flag'], ctx, someval=foo)

..that knows about a bunch of %-style and {}-style replacements and how
to pull the values out of ctxs or kwargs.

(Also, for my purposes, "stable" as a flag is fine)

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list