[PATCH 2 of 2] patchbomb: add --no-intro option

Yann E. MORIN yann.morin.1998 at free.fr
Wed Feb 29 16:53:55 CST 2012

# HG changeset patch
# User "Yann E. MORIN" <yann.morin.1998 at free.fr>
# Date 1330467959 -3600
# Node ID 18cdc18bd6cc4bbd9cb9a0512faa6b1151c000e7
# Parent  e6fb31285eabdb9f3092860791be954ea826d82e
patchbomb: add --no-intro option

This flag does the opposite of --intro: it forces to not send an
introduction message, in any case.

This overrides any patchbomb.intro setting in hgrc, it also takes
precedence over any --intro option on the command line (be it
before or after --no-intro).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -75,6 +75,8 @@
 def introwanted(ui, opts, number):
     '''is an introductory message apparently wanted?'''
+    if opts.get('no_intro'):
+        return False
     introcfg = ui.config('patchbomb', 'intro')
     if introcfg in ['always', 'yes'] or opts.get('intro') or opts.get('desc'):
         return True
@@ -190,6 +192,7 @@
     ('', 'base', [], _('a base changeset to specify instead of a destination '
        '(with -b/--bundle)'), _('REV')),
     ('', 'intro', None, _('send an introduction email for a single patch')),
+    ('', 'no-intro', None, _('do not send an introduction email')),
     ] + emailopts + commands.remoteopts,
     _('hg email [OPTION]... [DEST]...'))
 def patchbomb(ui, repo, *revs, **opts):
@@ -203,7 +206,9 @@
     than one out-going changeset, or if the config option ``patchbomb.intro``
     is set to either ``yes`` or ``always``. With --intro, you will be
     prompted for an introductory message, even if there is only one
-    out-going message.
+    out-going message. With --no-intro, no introduction message will be
+    sent, whatever the setting of ``patchbomb.intro``; also, --no-intro
+    overrides --intro.
     Each patch email has a Subject line of "[PATCH M of N] ...", using
     the first line of the changeset description as the subject text.

More information about the Mercurial-devel mailing list