# HG changeset patch
# User Simon Heimberg <[email protected]>
# Date 1237390492 -3600
# Node ID 1c61eacc2d9c39ad56539555eb9b87a2756e5f55
# Parent  bd7b0a6044c6db590c4b58be1f1a50fd8f56a3d7
history: allow to send bundles and mails from a range

diff -r bd7b0a6044c6 -r 1c61eacc2d9c hggtk/history.py
--- a/hggtk/history.py  Mit Mär 18 16:31:31 2009 +0100
+++ b/hggtk/history.py  Mit Mär 18 16:34:52 2009 +0100
@@ -341,6 +341,8 @@
         _menu.append(create_menu('_diff with selected', self._diff_revs))
         _menu.append(create_menu('visual diff with selected',
                 self._vdiff_selected))
+        _menu.append(create_menu('email from here to selected', 
self._email_revs))
+        _menu.append(create_menu('bundle from here to selected', 
self._bundle_revs))
         _menu.connect_after('selection-done', self._restore_original_selection)
         _menu.show_all()
         return _menu
@@ -477,6 +479,38 @@
         self.opts['rev'] = ["%s:%s" % (rev0, rev1)]
         self._diff_file(None, '')
 
+    def _email_revs(self, menuitem):
+        from hgemail import EmailDialog
+        revs = list(self._revs)
+        revs.sort()
+        opts = ['--rev', str(revs[0]) + ':' + str(revs[1])]
+        dlg = EmailDialog(self.repo.root, opts)
+        dlg.set_transient_for(self)
+        dlg.show_all()
+        dlg.present()
+        dlg.set_transient_for(None)
+
+    def _bundle_revs(self, menuitem):
+        revs = list(self._revs)
+        revs.sort()
+        parent = self.repo[revs[0]].parents()[0].rev()
+        # Special case for revision 0's parent.
+        if parent == -1: parent = 'null'
+
+        filename = "%s_rev%d_to_rev%s.hg" % (os.path.basename(self.repo.root),
+                   revs[0], revs[1])
+        result = NativeSaveFileDialogWrapper(Title = "Write bundle to",
+                                         InitialDir=self.repo.root,
+                                         FileName=filename).run()
+        if result:
+            from hgcmd import CmdDialog
+            cmdline = ['hg', 'bundle', '--base', str(parent),
+                      '--rev', str(revs[1]), result]
+            dlg = CmdDialog(cmdline)
+            dlg.show_all()
+            dlg.run()
+            dlg.hide()
+
     def _add_tag(self, menuitem):
         from tagadd import TagAddDialog
 

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to