Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py

changeset 199
675623ee5d7d
parent 198
7ab8e126f404
child 202
6854bb0beda5
diff -r 7ab8e126f404 -r 675623ee5d7d Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py
--- a/Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py	Sat Apr 24 13:56:43 2010 +0000
+++ b/Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py	Sat Apr 24 17:32:07 2010 +0000
@@ -567,6 +567,34 @@
         ))
         self.connect(self.hgCreateIgnoreAct, SIGNAL('triggered()'), self.__hgCreateIgnore)
         self.actions.append(self.hgCreateIgnoreAct)
+        
+        self.hgBundleAct = E5Action(self.trUtf8('Create changegroup'),
+                self.trUtf8('Create changegroup...'),
+                0, 0, self, 'mercurial_bundle')
+        self.hgBundleAct.setStatusTip(self.trUtf8(
+            'Create changegroup file collecting changesets'
+        ))
+        self.hgBundleAct.setWhatsThis(self.trUtf8(
+            """<b>Create changegroup</b>"""
+            """<p>This creates a changegroup file collecting selected changesets"""
+            """ (hg bundle).</p>"""
+        ))
+        self.connect(self.hgBundleAct, SIGNAL('triggered()'), self.__hgBundle)
+        self.actions.append(self.hgBundleAct)
+        
+        self.hgUnbundleAct = E5Action(self.trUtf8('Apply changegroups'),
+                self.trUtf8('Apply changegroups...'),
+                0, 0, self, 'mercurial_unbundle')
+        self.hgUnbundleAct.setStatusTip(self.trUtf8(
+            'Apply one or several changegroup files'
+        ))
+        self.hgUnbundleAct.setWhatsThis(self.trUtf8(
+            """<b>Apply changegroups</b>"""
+            """<p>This applies one or several changegroup files generated by"""
+            """ the 'Create changegroup' action (hg unbundle).</p>"""
+        ))
+        self.connect(self.hgUnbundleAct, SIGNAL('triggered()'), self.__hgUnbundle)
+        self.actions.append(self.hgUnbundleAct)
     
     def initMenu(self, menu):
         """
@@ -592,6 +620,10 @@
         adminMenu.addSeparator()
         adminMenu.addAction(self.hgVerifyAct)
         
+        bundleMenu = QMenu(self.trUtf8("Changegroup Management"), menu)
+        bundleMenu.addAction(self.hgBundleAct)
+        bundleMenu.addAction(self.hgUnbundleAct)
+        
         act = menu.addAction(
             UI.PixmapCache.getIcon(
                 os.path.join("VcsPlugins", "vcsMercurial", "icons", "mercurial.png")), 
@@ -609,6 +641,8 @@
         menu.addAction(self.hgOutgoingAct)
         menu.addAction(self.hgPushAct)
         menu.addSeparator()
+        menu.addMenu(bundleMenu)
+        menu.addSeparator()
         menu.addAction(self.vcsNewAct)
         menu.addAction(self.vcsExportAct)
         menu.addSeparator()
@@ -781,3 +815,15 @@
         Protected slot used to create a .hgignore file for the project.
         """
         self.vcs.hgCreateIgnoreFile(self.project.ppath, autoAdd = True)
+    
+    def __hgBundle(self):
+        """
+        Protected slot used to create a changegroup file.
+        """
+        self.vcs.hgBundle(self.project.ppath)
+    
+    def __hgUnbundle(self):
+        """
+        Protected slot used to apply changegroup files.
+        """
+        self.vcs.hgUnbundle(self.project.ppath)

eric ide

mercurial