[PATCH 1 of 2] patchbomb: Add option to send intro email for a single patch (issue1120)
Chris Winter
elwintro at gmail.com
Wed Nov 12 16:13:26 CST 2008
# HG changeset patch
# User Chris Winter <elwintro at gmail.com>
# Date 1226507162 21600
# Node ID 34cdc416220151edaaa5fc4e2fc529936f75009c
# Parent b0fa5dbd9cdd7e6caaa07c5b2acd42465e3c1298
patchbomb: Add option to send intro email for a single patch (issue1120)
diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -172,7 +172,7 @@ def makepatch(ui, repo, patch, opts, _ch
msg = mail.mimetextpatch(body, display=opts.get('test'))
subj = desc[0].strip().rstrip('. ')
- if total == 1:
+ if total == 1 and not opts.get('intro'):
subj = '[PATCH] ' + (opts.get('subject') or subj)
else:
tlen = len(str(total))
@@ -316,7 +316,7 @@ def patchbomb(ui, repo, *revs, **opts):
len(patches), name)
msgs.append(msg)
- if len(patches) > 1:
+ if len(patches) > 1 or opts.get('intro'):
tlen = len(str(len(patches)))
subj = '[PATCH %0*d of %d] %s' % (
@@ -481,6 +481,8 @@ cmdtable = {
_('run even when remote repository is unrelated (with -b)')),
('', 'base', [],
_('a base changeset to specify instead of a destination (with -b)')),
+ ('', 'intro', None,
+ _('send an introduction email for a single patch')),
] + emailopts + commands.remoteopts,
_('hg email [OPTION]... [DEST]...'))
}
More information about the Mercurial-devel
mailing list