src/eric7/Plugins/VcsPlugins/vcsPySvn/SvnLogBrowserDialog.py

branch
eric7
changeset 10438
4cd7e5a8b3cf
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
equal deleted inserted replaced
10437:2f70ca07f0af 10438:4cd7e5a8b3cf
39 def __init__(self, vcs, parent=None): 39 def __init__(self, vcs, parent=None):
40 """ 40 """
41 Constructor 41 Constructor
42 42
43 @param vcs reference to the vcs object 43 @param vcs reference to the vcs object
44 @param parent parent widget (QWidget) 44 @type Subversion
45 @param parent parent widget
46 @type QWidget
45 """ 47 """
46 super().__init__(parent) 48 super().__init__(parent)
47 self.setupUi(self) 49 self.setupUi(self)
48 SvnDialogMixin.__init__(self) 50 SvnDialogMixin.__init__(self)
49 51
101 103
102 def closeEvent(self, e): 104 def closeEvent(self, e):
103 """ 105 """
104 Protected slot implementing a close event handler. 106 Protected slot implementing a close event handler.
105 107
106 @param e close event (QCloseEvent) 108 @param e close event
109 @type QCloseEvent
107 """ 110 """
108 self.__position = self.pos() 111 self.__position = self.pos()
109 112
110 e.accept() 113 e.accept()
111 114
183 186
184 def __generateLogItem(self, author, date, message, revision, changedPaths): 187 def __generateLogItem(self, author, date, message, revision, changedPaths):
185 """ 188 """
186 Private method to generate a log tree entry. 189 Private method to generate a log tree entry.
187 190
188 @param author author info (string) 191 @param author author info
189 @param date date info (integer) 192 @type str
190 @param message text of the log message (string) 193 @param date date info
191 @param revision revision info (string or pysvn.opt_revision_kind) 194 @type int
195 @param message text of the log message
196 @type str
197 @param revision revision info
198 @type str or pysvn.opt_revision_kind
192 @param changedPaths list of pysvn dictionary like objects containing 199 @param changedPaths list of pysvn dictionary like objects containing
193 info about the changed files/directories 200 info about the changed files/directories
194 @return reference to the generated item (QTreeWidgetItem) 201 @type dict like
202 @return reference to the generated item
203 @rtype QTreeWidgetItem
195 """ 204 """
196 if revision == "": 205 if revision == "":
197 rev = "" 206 rev = ""
198 self.__lastRev = 0 207 self.__lastRev = 0
199 else: 208 else:
240 def __generateFileItem(self, action, path, copyFrom, copyRev): 249 def __generateFileItem(self, action, path, copyFrom, copyRev):
241 """ 250 """
242 Private method to generate a changed files tree entry. 251 Private method to generate a changed files tree entry.
243 252
244 @param action indicator for the change action ("A", "D" or "M") 253 @param action indicator for the change action ("A", "D" or "M")
245 @param path path of the file in the repository (string) 254 @type str
246 @param copyFrom path the file was copied from (None, string) 255 @param path path of the file in the repository
247 @param copyRev revision the file was copied from (None, string) 256 @type str
248 @return reference to the generated item (QTreeWidgetItem) 257 @param copyFrom path the file was copied from
258 @type str
259 @param copyRev revision the file was copied from
260 @type str
261 @return reference to the generated item
262 @rtype QTreeWidgetItem
249 """ 263 """
250 itm = QTreeWidgetItem( 264 itm = QTreeWidgetItem(
251 self.filesTree, [self.flags[action], path, copyFrom, copyRev] 265 self.filesTree, [self.flags[action], path, copyFrom, copyRev]
252 ) 266 )
253 267
257 271
258 def __getLogEntries(self, startRev=None): 272 def __getLogEntries(self, startRev=None):
259 """ 273 """
260 Private method to retrieve log entries from the repository. 274 Private method to retrieve log entries from the repository.
261 275
262 @param startRev revision number to start from (integer, string) 276 @param startRev revision number to start from
277 @type tuple of (int, str)
263 """ 278 """
264 fetchLimit = 10 279 fetchLimit = 10
265 self._reset() 280 self._reset()
266 281
267 limit = self.limitSpinBox.value() 282 limit = self.limitSpinBox.value()
344 359
345 def start(self, fn, isFile=False): 360 def start(self, fn, isFile=False):
346 """ 361 """
347 Public slot to start the svn log command. 362 Public slot to start the svn log command.
348 363
349 @param fn filename to show the log for (string) 364 @param fn filename to show the log for
365 @type str
350 @param isFile flag indicating log for a file is to be shown 366 @param isFile flag indicating log for a file is to be shown
351 (boolean) 367 @type bool
352 """ 368 """
353 self.sbsCheckBox.setEnabled(isFile) 369 self.sbsCheckBox.setEnabled(isFile)
354 self.sbsCheckBox.setVisible(isFile) 370 self.sbsCheckBox.setVisible(isFile)
355 371
356 self.__initData() 372 self.__initData()
377 393
378 def __diffRevisions(self, rev1, rev2, peg_rev): 394 def __diffRevisions(self, rev1, rev2, peg_rev):
379 """ 395 """
380 Private method to do a diff of two revisions. 396 Private method to do a diff of two revisions.
381 397
382 @param rev1 first revision number (integer) 398 @param rev1 first revision number
383 @param rev2 second revision number (integer) 399 @type int
384 @param peg_rev revision number to use as a reference (integer) 400 @param rev2 second revision number
401 @type int
402 @param peg_rev revision number to use as a reference
403 @type int
385 """ 404 """
386 from .SvnDiffDialog import SvnDiffDialog 405 from .SvnDiffDialog import SvnDiffDialog
387 406
388 if self.sbsCheckBox.isEnabled() and self.sbsCheckBox.isChecked(): 407 if self.sbsCheckBox.isEnabled() and self.sbsCheckBox.isChecked():
389 self.vcs.vcsSbsDiff(self.filename, revisions=(str(rev1), str(rev2))) 408 self.vcs.vcsSbsDiff(self.filename, revisions=(str(rev1), str(rev2)))
397 416
398 def on_buttonBox_clicked(self, button): 417 def on_buttonBox_clicked(self, button):
399 """ 418 """
400 Private slot called by a button of the button box clicked. 419 Private slot called by a button of the button box clicked.
401 420
402 @param button button that was clicked (QAbstractButton) 421 @param button button that was clicked
422 @type QAbstractButton
403 """ 423 """
404 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): 424 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close):
405 self.close() 425 self.close()
406 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): 426 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel):
407 self.cancelled = True 427 self.cancelled = True
410 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem) 430 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem)
411 def on_logTree_currentItemChanged(self, current, previous): 431 def on_logTree_currentItemChanged(self, current, previous):
412 """ 432 """
413 Private slot called, when the current item of the log tree changes. 433 Private slot called, when the current item of the log tree changes.
414 434
415 @param current reference to the new current item (QTreeWidgetItem) 435 @param current reference to the new current item
416 @param previous reference to the old current item (QTreeWidgetItem) 436 @type QTreeWidgetItem
437 @param previous reference to the old current item
438 @type QTreeWidgetItem
417 """ 439 """
418 if current is not None: 440 if current is not None:
419 self.messageEdit.setPlainText(current.data(0, self.__messageRole)) 441 self.messageEdit.setPlainText(current.data(0, self.__messageRole))
420 442
421 self.filesTree.clear() 443 self.filesTree.clear()
509 531
510 def __showError(self, msg): 532 def __showError(self, msg):
511 """ 533 """
512 Private slot to show an error message. 534 Private slot to show an error message.
513 535
514 @param msg error message to show (string) 536 @param msg error message to show
537 @type str
515 """ 538 """
516 EricMessageBox.critical(self, self.tr("Subversion Error"), msg) 539 EricMessageBox.critical(self, self.tr("Subversion Error"), msg)
517 540
518 @pyqtSlot(QDate) 541 @pyqtSlot(QDate)
519 def on_fromDate_dateChanged(self, date): 542 def on_fromDate_dateChanged(self, date):
520 """ 543 """
521 Private slot called, when the from date changes. 544 Private slot called, when the from date changes.
522 545
523 @param date new date (QDate) 546 @param date new date
547 @type QDate
524 """ 548 """
525 self.__filterLogs() 549 self.__filterLogs()
526 550
527 @pyqtSlot(QDate) 551 @pyqtSlot(QDate)
528 def on_toDate_dateChanged(self, date): 552 def on_toDate_dateChanged(self, date):
529 """ 553 """
530 Private slot called, when the from date changes. 554 Private slot called, when the from date changes.
531 555
532 @param date new date (QDate) 556 @param date new date
557 @type QDate
533 """ 558 """
534 self.__filterLogs() 559 self.__filterLogs()
535 560
536 @pyqtSlot(int) 561 @pyqtSlot(int)
537 def on_fieldCombo_activated(self, index): 562 def on_fieldCombo_activated(self, index):
546 @pyqtSlot(str) 571 @pyqtSlot(str)
547 def on_rxEdit_textChanged(self, txt): 572 def on_rxEdit_textChanged(self, txt):
548 """ 573 """
549 Private slot called, when a filter expression is entered. 574 Private slot called, when a filter expression is entered.
550 575
551 @param txt filter expression (string) 576 @param txt filter expression
577 @type str
552 """ 578 """
553 self.__filterLogs() 579 self.__filterLogs()
554 580
555 def __filterLogs(self): 581 def __filterLogs(self):
556 """ 582 """
594 @pyqtSlot(bool) 620 @pyqtSlot(bool)
595 def on_stopCheckBox_clicked(self, checked): 621 def on_stopCheckBox_clicked(self, checked):
596 """ 622 """
597 Private slot called, when the stop on copy/move checkbox is clicked. 623 Private slot called, when the stop on copy/move checkbox is clicked.
598 624
599 @param checked flag indicating the check box state (boolean) 625 @param checked flag indicating the check box state
626 @type bool
600 """ 627 """
601 self.vcs.getPlugin().setPreferences( 628 self.vcs.getPlugin().setPreferences(
602 "StopLogOnCopy", int(self.stopCheckBox.isChecked()) 629 "StopLogOnCopy", int(self.stopCheckBox.isChecked())
603 ) 630 )
604 self.nextButton.setEnabled(True) 631 self.nextButton.setEnabled(True)

eric ide

mercurial