Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

changeset 2570
a2de94bae41b
parent 2569
0fff8dc5d472
child 2581
a3498dcc75cc
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat Apr 13 13:06:39 2013 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat Apr 13 13:10:43 2013 +0200
@@ -906,6 +906,7 @@
         
         self.__updateDiffButtons()
         self.__updatePhaseButton()
+        self.__updateGraftButton()
     
     def __readStdout(self):
         """
@@ -1034,15 +1035,18 @@
         Private slot to update the status of the graft button.
         """
         if self.graftButton.isVisible():
-            # step 1: count selected entries not belonging to the current branch
-            otherBranches = 0
-            for itm in self.logTree.selectedItems():
-                branch = itm.text(self.BranchColumn)
-                if branch != self.__projectBranch:
-                    otherBranches += 1
-            
-            # step 2: set the status of the graft button
-            self.graftButton.setEnabled(otherBranches > 0)
+            if self.initialCommandMode == "log":
+                # step 1: count selected entries not belonging to the current branch
+                otherBranches = 0
+                for itm in self.logTree.selectedItems():
+                    branch = itm.text(self.BranchColumn)
+                    if branch != self.__projectBranch:
+                        otherBranches += 1
+                
+                # step 2: set the status of the graft button
+                self.graftButton.setEnabled(otherBranches > 0)
+            else:
+                self.graftButton.setEnabled(False)
     
     def __updateGui(self, itm):
         """

eric ide

mercurial