Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

changeset 5501
59ed7b2dd952
parent 5496
d157a2319073
child 5503
20dd5c1e43ec
diff -r 5e723c249586 -r 59ed7b2dd952 Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Thu Feb 09 19:52:17 2017 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Thu Feb 09 20:03:00 2017 +0100
@@ -316,6 +316,23 @@
         
         self.__actionsMenu.addSeparator()
         
+        self.__bundleAct = self.__actionsMenu.addAction(
+            UI.PixmapCache.getIcon("vcsCreateChangegroup.png"),
+            self.tr("Create Changegroup"), self.__bundleActTriggered)
+        self.__bundleAct.setToolTip(self.tr(
+            "Create a changegroup file containing the selected changesets"))
+        self.__bundleAct.setWhatsThis(self.tr(
+            """<b>Create Changegroup</b>\n<p>This creates a changegroup"""
+            """ file containing the selected revisions. If no revisions"""
+            """ are selected, all changesets will be bundled. If one"""
+            """ revision is selected, it will be interpreted as the base"""
+            """ revision. Otherwise the lowest revision will be used as"""
+            """ the base revision and all other revision will be bundled."""
+            """ If the dialog is showing outgoing changesets, all"""
+            """ selected changesets will be bundled.</p>"""))
+        
+        self.__actionsMenu.addSeparator()
+        
         self.__stripAct = self.__actionsMenu.addAction(
             UI.PixmapCache.getIcon("fileDelete.png"),
             self.tr("Strip Changesets"), self.__stripActTriggered)
@@ -326,7 +343,7 @@
             UI.PixmapCache.getIcon("actionsToolButton.png"))
         self.actionsButton.setMenu(self.__actionsMenu)
     
-    # TODO: add action "Create Changegroup" (>=2 revs, lowest rev is base)
+    # TODO: add action "Create Changegroup" (>=1 revs, lowest rev is base)
     # TODO: add action "Sign Revision" (>= 1 revs) (GPG extension)
     # TODO: add action "Verify Signature" (1 rev) (GPG extension)
     
@@ -1457,9 +1474,12 @@
                 self.vcs.isExtensionActive("strip") and
                 len(self.logTree.selectedItems()) == 1)
             
+            self.__bundleAct.setEnabled(self.logTree.topLevelItemCount() > 0)
+            
             self.actionsButton.setEnabled(True)
         else:
             self.actionsButton.setEnabled(False)
+        # TODO: add code to enable menu in incoming / outgoing mode as well
     
     def __updateDetailsAndFiles(self):
         """
@@ -2134,6 +2154,18 @@
             itm.text(self.RevisionColumn).strip().split(":", 1)[0])
         self.vcs.vcsMerge(self.repodir, rev=rev)
     
+    @pyqtSlot()
+    def __bundleActTriggered(self):
+        """
+        Private slot to create a changegroup file.
+        """
+        if self.initialCommandMode == "log":
+            # TODO: implement bundle
+            pass
+        elif self.initialCommandMode == "outgoing":
+            # TODO: implement bundle for outgoing mode
+            pass
+    
     def __actionMode(self):
         """
         Private method to get the selected action mode.

eric ide

mercurial