Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

changeset 5444
4799e2cf8401
parent 5389
9b1c800daff3
child 5445
b24720037f1f
diff -r 3ef014765648 -r 4799e2cf8401 Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Wed Jan 25 12:48:42 2017 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Wed Jan 25 19:39:09 2017 +0100
@@ -774,11 +774,12 @@
         
         return itm
     
-    def __getLogEntries(self, startRev=None):
+    def __getLogEntries(self, startRev=None, noEntries=0):
         """
         Private method to retrieve log entries from the repository.
         
         @param startRev revision number to start from (integer, string)
+        @keyparam noEntries number of entries to get (0 = default) (int)
         """
         self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
         self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True)
@@ -793,12 +794,15 @@
         self.errors.clear()
         self.intercept = False
         
+        if noEntries == 0:
+            noEntries = self.limitSpinBox.value()
+        
         preargs = []
         args = self.vcs.initCommand(self.commandMode)
         args.append('--verbose')
         if self.commandMode not in ("incoming", "outgoing"):
             args.append('--limit')
-            args.append(str(self.limitSpinBox.value()))
+            args.append(str(noEntries))
         if self.commandMode in ("incoming", "outgoing"):
             args.append("--newest-first")
             if self.vcs.hasSubrepositories():
@@ -888,7 +892,7 @@
             else:
                 self.__finish()
     
-    def start(self, fn, bundle=None, isFile=False):
+    def start(self, fn, bundle=None, isFile=False, noEntries=0):
         """
         Public slot to start the hg log command.
         
@@ -896,6 +900,7 @@
         @keyparam bundle name of a bundle file (string)
         @keyparam isFile flag indicating log for a file is to be shown
             (boolean)
+        @keyparam noEntries number of entries to get (0 = default) (int)
         """
         self.__bundle = bundle
         self.__isFile = isFile
@@ -927,7 +932,7 @@
         self.__started = True
         self.__identifyProject()
         self.__getClosedBranches()
-        self.__getLogEntries()
+        self.__getLogEntries(noEntries=noEntries)
     
     def __procFinished(self, exitCode, exitStatus):
         """
@@ -1372,7 +1377,7 @@
         Private slot to handle the Next button.
         """
         if self.__lastRev > 0:
-            self.__getLogEntries(self.__lastRev - 1)
+            self.__getLogEntries(startRev=self.__lastRev - 1)
     
     @pyqtSlot()
     def on_diffP1Button_clicked(self):
@@ -1605,7 +1610,8 @@
             self.limitSpinBox.setEnabled(True)
         
         self.commandMode = self.initialCommandMode
-        self.start(self.__filename, isFile=self.__isFile)
+        self.start(self.__filename, isFile=self.__isFile,
+                   noEntries=self.logTree.topLevelItemCount())
     
     def on_passwordCheckBox_toggled(self, isOn):
         """

eric ide

mercurial