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

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 13 Apr 2013 13:06:39 +0200
branch
5_3_x
changeset 2568
b66f1577c6b9
parent 2566
a410f3ced3ea
child 2582
d56b8f649745

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

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
@@ -893,6 +893,9 @@
         
         self.__filterLogsEnabled = True
         self.__filterLogs()
+        
+        self.__updateDiffButtons()
+        self.__updatePhaseButton()
     
     def __readStdout(self):
         """
@@ -991,24 +994,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