Fixed an issue in the Mercurial log browser setting the correct state of the phase button in 'incoming' and 'outgoing' mode.

Sat, 13 Apr 2013 13:06:39 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 13 Apr 2013 13:06:39 +0200
changeset 2569
0fff8dc5d472
parent 2567
f70f3103c927
child 2570
a2de94bae41b

Fixed an issue in the Mercurial log browser setting the correct state of the phase button in 'incoming' and 'outgoing' mode.
(grafted from b66f1577c6b9015fc01760c79a5c96fd9b0cd855)

Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat Apr 13 12:38:48 2013 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat Apr 13 13:06:39 2013 +0200
@@ -903,6 +903,9 @@
         
         self.__filterLogsEnabled = True
         self.__filterLogs()
+        
+        self.__updateDiffButtons()
+        self.__updatePhaseButton()
     
     def __readStdout(self):
         """
@@ -1002,24 +1005,27 @@
         """
         Private slot to update the status of the phase button.
         """
-        # step 1: count entries with changeable phases
-        secret = 0
-        draft = 0
-        public = 0
-        for itm in self.logTree.selectedItems():
-            phase = itm.text(self.PhaseColumn)
-            if phase == "draft":
-                draft += 1
-            elif phase == "secret":
-                secret += 1
+        if self.initialCommandMode == "log":
+            # step 1: count entries with changeable phases
+            secret = 0
+            draft = 0
+            public = 0
+            for itm in self.logTree.selectedItems():
+                phase = itm.text(self.PhaseColumn)
+                if phase == "draft":
+                    draft += 1
+                elif phase == "secret":
+                    secret += 1
+                else:
+                    public += 1
+            
+            # step 2: set the status of the phase button
+            if public == 0 and \
+               ((secret > 0 and draft == 0) or \
+                (secret == 0 and draft > 0)):
+                self.phaseButton.setEnabled(True)
             else:
-                public += 1
-        
-        # step 2: set the status of the phase button
-        if public == 0 and \
-           ((secret > 0 and draft == 0) or \
-            (secret == 0 and draft > 0)):
-            self.phaseButton.setEnabled(True)
+                self.phaseButton.setEnabled(False)
         else:
             self.phaseButton.setEnabled(False)
     

eric ide

mercurial