Source

thg-qt-mq / email-bundle.diff

# HG changeset patch
# Parent 8e6596fa3c0dd9a7918cff0633d2f1d97a42b8f9
diff --git a/tortoisehg/hgqt/hgemail.py b/tortoisehg/hgqt/hgemail.py
--- a/tortoisehg/hgqt/hgemail.py
+++ b/tortoisehg/hgqt/hgemail.py
@@ -25,11 +25,11 @@ class EmailDialog(QDialog):
 
         self._qui = Ui_EmailDialog()
         self._qui.setupUi(self)
-        self._qui.bundle_radio.setEnabled(False)  # TODO: bundle support
 
         self._initchangesets(revs)
         self._initpreviewtab()
         self._initenvelopebox()
+        self._qui.bundle_radio.toggled.connect(self._updateforms)
         self._initintrobox()
         self._readhistory()
         self._filldefaults()
@@ -175,6 +175,11 @@ class EmailDialog(QDialog):
 
         opts.update(self.getextraopts())
 
+        if self._qui.bundle_radio.isChecked():
+            opts['bundle'] = True
+            opts['base'] = [str(self._revs[0])]  # XXX
+            opts['rev'] = [str(self._revs[-1])]  # XXX
+
         def writetempfile(s):
             fd, fname = tempfile.mkstemp(prefix='thg_emaildesc_')
             try:
@@ -261,7 +266,7 @@ class EmailDialog(QDialog):
 
     def _introrequired(self):
         """Is intro message required?"""
-        return len(self._revs) > 1
+        return len(self._revs) > 1 or self._qui.bundle_radio.isChecked()
 
     def _initpreviewtab(self):
         def initqsci(w):