diff hgext/patchbomb.py @ 26563:d4a1bfe1de63

patchbomb: add a 'bundletype' config under 'patchbomb' patchbomb relies on the 'hg bundle' command to generate an attached bundle using --bundle. However, while 'hg bundle' has a --type option, patchbomb did not. This is becoming very relevant since we are about to issue bundle2 for general-delta repository. This was tracked as issue4863
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 01 Oct 2015 23:13:57 -0700
parents 500386e65759
children 56b2bcea2529
line wrap: on
line diff
--- a/hgext/patchbomb.py	Wed Oct 07 13:05:25 2015 -0700
+++ b/hgext/patchbomb.py	Thu Oct 01 23:13:57 2015 -0700
@@ -223,6 +223,9 @@
     ui = repo.ui
     tmpdir = tempfile.mkdtemp(prefix='hg-email-bundle-')
     tmpfn = os.path.join(tmpdir, 'bundle')
+    btype = ui.config('patchbomb', 'bundletype')
+    if btype:
+        opts['type'] = btype
     try:
         commands.bundle(ui, repo, tmpfn, dest, **opts)
         fp = open(tmpfn, 'rb')
@@ -434,7 +437,8 @@
 
     With -b/--bundle, changesets are selected as for --outgoing, but a
     single email containing a binary Mercurial bundle as an attachment
-    will be sent.
+    will be sent. Use the ``patchbomb.bundletype`` config option to
+    control the bundle type as with :hg:`bundle --type`.
 
     With -m/--mbox, instead of previewing each patchbomb message in a
     pager or sending the messages directly, it will create a UNIX