[PATCH 3 of 6] patchbomb: drop internal option for pbranch extension (API)

Yuya Nishihara yuya at tcha.org
Tue Mar 7 09:35:35 EST 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1488014717 -32400
#      Sat Feb 25 18:25:17 2017 +0900
# Node ID 3ce342fc93179cfec1b85722f79d9861cabb52de
# Parent  55baa01cf8615087cdec38e7cae79e09fa9acdd9
patchbomb: drop internal option for pbranch extension (API)

I want to move _getpatches() to _getpatchmsgs() to make sure each patch text
is tied with the corresponding revision number. This helps adding templater
support.

IIRC, the pbranch extension doesn't work with the recent Mercurial versions,
so the removal of this option wouldn't hurt.

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -514,14 +514,12 @@ def email(ui, repo, *revs, **opts):
     mbox = opts.get('mbox')
     outgoing = opts.get('outgoing')
     rev = opts.get('rev')
-    # internal option used by pbranches
-    patches = opts.get('patches')
 
     if not (opts.get('test') or mbox):
         # really sending
         mail.validateconfig(ui)
 
-    if not (revs or rev or outgoing or bundle or patches):
+    if not (revs or rev or outgoing or bundle):
         raise error.Abort(_('specify at least one changeset with -r or -o'))
 
     if outgoing and bundle:
@@ -593,10 +591,7 @@ def email(ui, repo, *revs, **opts):
               ui.config('patchbomb', 'from') or
               prompt(ui, 'From', ui.username()))
 
-    if patches:
-        msgs = _getpatchmsgs(repo, sender, patches, opts.get('patchnames'),
-                             **opts)
-    elif bundle:
+    if bundle:
         bundledata = _getbundle(repo, dest, **opts)
         bundleopts = opts.copy()
         bundleopts.pop('bundle', None)  # already processed


More information about the Mercurial-devel mailing list