Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

changeset 201
a434e007ab9a
parent 198
7ab8e126f404
child 203
0bd3912f3c5f
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat Apr 24 17:33:05 2010 +0000
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat Apr 24 18:05:15 2010 +0000
@@ -698,8 +698,7 @@
             self.__resizeColumnsFiles()
             self.__resortFiles()
         
-        self.diffPreviousButton.setEnabled(
-            current != self.logTree.topLevelItem(self.logTree.topLevelItemCount() - 1))
+        self.diffPreviousButton.setEnabled(current is not None)
     
     @pyqtSlot()
     def on_logTree_itemSelectionChanged(self):
@@ -729,9 +728,12 @@
         
         itm = self.logTree.topLevelItem(self.logTree.indexOfTopLevelItem(itm) + 1)
         if itm is None:
-            self.diffPreviousButton.setEnabled(False)
-            return
-        rev1 = int(itm.text(self.RevisionColumn).split(":")[0])
+            rev1 = rev2 - 1
+            if rev1 < 0:
+                self.diffPreviousButton.setEnabled(False)
+                return
+        else:
+            rev1 = int(itm.text(self.RevisionColumn).split(":")[0])
         
         self.__diffRevisions(rev1, rev2)
     

eric ide

mercurial