[PATCH abc] Allow specifying default --flag options via config

Yuya Nishihara yuya at tcha.org
Wed Feb 22 09:41:21 EST 2017


On Wed, 22 Feb 2017 18:23:46 +0530, Pulkit Goyal wrote:
> On Wed, Feb 22, 2017 at 5:57 PM, rishi shah <rishiloyola98245 at gmail.com>
> > diff -r 3844b3299a53 -r 035603e2e432 hgext/patchbomb.py
> > --- a/hgext/patchbomb.py        Thu Feb 16 10:33:59 2017 -0800
> > +++ b/hgext/patchbomb.py        Tue Feb 21 18:23:42 2017 +0530
> > @@ -31,6 +31,7 @@
> >    cc = cc1, cc2, ...
> >    bcc = bcc1, bcc2, ...
> >    reply-to = address1, address2, ...
> > +  flag = ...
> >
> >  Use ``[patchbomb]`` as configuration section name if you need to
> >  override global ``[email]`` address settings.
> > @@ -202,7 +203,11 @@
> >      else:
> >          msg = mail.mimetextpatch(body, display=opts.get('test'))
> >
> > -    flag = ' '.join(opts.get('flag'))
> > +    if opts.get('flag') == "":
> > +        flag = (ui.config('email', 'flag') or ui.config('patchbomb',
> > 'flag'))
> > +    else:
> > +        flag = ' '.join(opts.get('flag'))
> > +
> >      if flag:
> >          flag = ' ' + flag
> >
> 
> ​There can be situations where we need to use flags from both config and
> command line, like "evolve" from config and 'V2' from command line. So we
> need to implement that also.​

Yep.

And I wanna do something like 'flag = "{ifeq(branch, "default", "", branch)}"'
to get "--flag stable" automatically. I'll send V2 of the old RFC patch in
a few days.

https://www.mercurial-scm.org/pipermail/mercurial-devel/2015-April/068094.html


More information about the Mercurial-devel mailing list