[PATCH] patchbomb: don't prompt for cc when cc is set without value

Christian Ebert blacktrash at gmx.net
Fri Jan 22 06:20:12 CST 2010


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1264162615 -3600
# Node ID b2ef6908c0dbe57a20725286311084bf172dcc4a
# Parent  e898bc7810ad08affd99d4420c89165252db194c
patchbomb: don't prompt for cc when cc is set without value

diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt
--- a/doc/hgrc.5.txt
+++ b/doc/hgrc.5.txt
@@ -302,7 +302,8 @@
     Optional. Comma-separated list of recipients' email addresses.
 ``cc``
     Optional. Comma-separated list of carbon copy recipients'
-    email addresses.
+    email addresses. The prompt for carbon copy recipients can be
+    turned off by setting this option without value.
 ``bcc``
     Optional. Comma-separated list of blind carbon copy recipients'
     email addresses. Cannot be set interactively.
diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -385,7 +385,9 @@
         if opts.get(opt):
             return mail.addrlistencode(ui, opts.get(opt), _charsets,
                                        opts.get('test'))
-
+        # do not prompt for Cc when it is configured explicitly empty
+        if opt == 'cc' and ui.config('email', opt) == '':
+            prpt = None
         addrs = (ui.config('email', opt) or
                  ui.config('patchbomb', opt) or '')
         if not addrs and prpt:


More information about the Mercurial-devel mailing list