Patchwork Allow specifying default --flag options via config

login
register
mail settings
Submitter rishi shah
Date Feb. 22, 2017, 7:58 a.m.
Message ID <035603e2e432a706555c.1487750298@7.43.168.192.in-addr.arpa>
Download mbox | patch
Permalink /patch/18751/
State Superseded
Headers show

Comments

rishi shah - Feb. 22, 2017, 7:58 a.m.
# HG changeset patch
# User rishi shah <rishiloyola98245@gmail.com>
# Date 1487681622 -19800
#      Tue Feb 21 18:23:42 2017 +0530
# Node ID 035603e2e432a706555c0cd353d74ec0639dd13a
# Parent  3844b3299a53b3746e1a708c84bbd6b83adddb7d
Allow specifying default --flag options via config

Patch

diff -r 3844b3299a53b3746e1a708c84bbd6b83adddb7d -r 035603e2e432a706555c0cd353d74ec0639dd13a 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