Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

changeset 5444
4799e2cf8401
parent 5389
9b1c800daff3
child 5445
b24720037f1f
equal deleted inserted replaced
5443:3ef014765648 5444:4799e2cf8401
772 copyfrom, 772 copyfrom,
773 ]) 773 ])
774 774
775 return itm 775 return itm
776 776
777 def __getLogEntries(self, startRev=None): 777 def __getLogEntries(self, startRev=None, noEntries=0):
778 """ 778 """
779 Private method to retrieve log entries from the repository. 779 Private method to retrieve log entries from the repository.
780 780
781 @param startRev revision number to start from (integer, string) 781 @param startRev revision number to start from (integer, string)
782 @keyparam noEntries number of entries to get (0 = default) (int)
782 """ 783 """
783 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) 784 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
784 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True) 785 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True)
785 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) 786 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
786 QApplication.processEvents() 787 QApplication.processEvents()
790 791
791 self.buf = [] 792 self.buf = []
792 self.cancelled = False 793 self.cancelled = False
793 self.errors.clear() 794 self.errors.clear()
794 self.intercept = False 795 self.intercept = False
796
797 if noEntries == 0:
798 noEntries = self.limitSpinBox.value()
795 799
796 preargs = [] 800 preargs = []
797 args = self.vcs.initCommand(self.commandMode) 801 args = self.vcs.initCommand(self.commandMode)
798 args.append('--verbose') 802 args.append('--verbose')
799 if self.commandMode not in ("incoming", "outgoing"): 803 if self.commandMode not in ("incoming", "outgoing"):
800 args.append('--limit') 804 args.append('--limit')
801 args.append(str(self.limitSpinBox.value())) 805 args.append(str(noEntries))
802 if self.commandMode in ("incoming", "outgoing"): 806 if self.commandMode in ("incoming", "outgoing"):
803 args.append("--newest-first") 807 args.append("--newest-first")
804 if self.vcs.hasSubrepositories(): 808 if self.vcs.hasSubrepositories():
805 args.append("--subrepos") 809 args.append("--subrepos")
806 if startRev is not None: 810 if startRev is not None:
886 'Ensure, that it is in the search path.' 890 'Ensure, that it is in the search path.'
887 ).format('hg')) 891 ).format('hg'))
888 else: 892 else:
889 self.__finish() 893 self.__finish()
890 894
891 def start(self, fn, bundle=None, isFile=False): 895 def start(self, fn, bundle=None, isFile=False, noEntries=0):
892 """ 896 """
893 Public slot to start the hg log command. 897 Public slot to start the hg log command.
894 898
895 @param fn filename to show the log for (string) 899 @param fn filename to show the log for (string)
896 @keyparam bundle name of a bundle file (string) 900 @keyparam bundle name of a bundle file (string)
897 @keyparam isFile flag indicating log for a file is to be shown 901 @keyparam isFile flag indicating log for a file is to be shown
898 (boolean) 902 (boolean)
903 @keyparam noEntries number of entries to get (0 = default) (int)
899 """ 904 """
900 self.__bundle = bundle 905 self.__bundle = bundle
901 self.__isFile = isFile 906 self.__isFile = isFile
902 907
903 self.sbsCheckBox.setEnabled(isFile) 908 self.sbsCheckBox.setEnabled(isFile)
925 930
926 self.logTree.clear() 931 self.logTree.clear()
927 self.__started = True 932 self.__started = True
928 self.__identifyProject() 933 self.__identifyProject()
929 self.__getClosedBranches() 934 self.__getClosedBranches()
930 self.__getLogEntries() 935 self.__getLogEntries(noEntries=noEntries)
931 936
932 def __procFinished(self, exitCode, exitStatus): 937 def __procFinished(self, exitCode, exitStatus):
933 """ 938 """
934 Private slot connected to the finished signal. 939 Private slot connected to the finished signal.
935 940
1370 def on_nextButton_clicked(self): 1375 def on_nextButton_clicked(self):
1371 """ 1376 """
1372 Private slot to handle the Next button. 1377 Private slot to handle the Next button.
1373 """ 1378 """
1374 if self.__lastRev > 0: 1379 if self.__lastRev > 0:
1375 self.__getLogEntries(self.__lastRev - 1) 1380 self.__getLogEntries(startRev=self.__lastRev - 1)
1376 1381
1377 @pyqtSlot() 1382 @pyqtSlot()
1378 def on_diffP1Button_clicked(self): 1383 def on_diffP1Button_clicked(self):
1379 """ 1384 """
1380 Private slot to handle the Diff to Parent 1 button. 1385 Private slot to handle the Diff to Parent 1 button.
1603 else: 1608 else:
1604 self.nextButton.setEnabled(True) 1609 self.nextButton.setEnabled(True)
1605 self.limitSpinBox.setEnabled(True) 1610 self.limitSpinBox.setEnabled(True)
1606 1611
1607 self.commandMode = self.initialCommandMode 1612 self.commandMode = self.initialCommandMode
1608 self.start(self.__filename, isFile=self.__isFile) 1613 self.start(self.__filename, isFile=self.__isFile,
1614 noEntries=self.logTree.topLevelItemCount())
1609 1615
1610 def on_passwordCheckBox_toggled(self, isOn): 1616 def on_passwordCheckBox_toggled(self, isOn):
1611 """ 1617 """
1612 Private slot to handle the password checkbox toggled. 1618 Private slot to handle the password checkbox toggled.
1613 1619

eric ide

mercurial