58 |
58 |
59 self.fromDate.setDisplayFormat("yyyy-MM-dd") |
59 self.fromDate.setDisplayFormat("yyyy-MM-dd") |
60 self.toDate.setDisplayFormat("yyyy-MM-dd") |
60 self.toDate.setDisplayFormat("yyyy-MM-dd") |
61 self.fromDate.setDate(QDate.currentDate()) |
61 self.fromDate.setDate(QDate.currentDate()) |
62 self.toDate.setDate(QDate.currentDate()) |
62 self.toDate.setDate(QDate.currentDate()) |
63 self.fieldCombo.setCurrentIndex(self.fieldCombo.findText(self.trUtf8("Message"))) |
63 self.fieldCombo.setCurrentIndex( |
64 self.limitSpinBox.setValue(self.vcs.getPlugin().getPreferences("LogLimit")) |
64 self.fieldCombo.findText(self.trUtf8("Message"))) |
65 self.stopCheckBox.setChecked(self.vcs.getPlugin().getPreferences("StopLogOnCopy")) |
65 self.limitSpinBox.setValue( |
|
66 self.vcs.getPlugin().getPreferences("LogLimit")) |
|
67 self.stopCheckBox.setChecked( |
|
68 self.vcs.getPlugin().getPreferences("StopLogOnCopy")) |
66 |
69 |
67 self.__messageRole = Qt.UserRole |
70 self.__messageRole = Qt.UserRole |
68 self.__changesRole = Qt.UserRole + 1 |
71 self.__changesRole = Qt.UserRole + 1 |
69 |
72 |
70 self.process = QProcess() |
73 self.process = QProcess() |
72 self.process.readyReadStandardOutput.connect(self.__readStdout) |
75 self.process.readyReadStandardOutput.connect(self.__readStdout) |
73 self.process.readyReadStandardError.connect(self.__readStderr) |
76 self.process.readyReadStandardError.connect(self.__readStderr) |
74 |
77 |
75 self.rx_sep1 = QRegExp('\\-+\\s*') |
78 self.rx_sep1 = QRegExp('\\-+\\s*') |
76 self.rx_sep2 = QRegExp('=+\\s*') |
79 self.rx_sep2 = QRegExp('=+\\s*') |
77 self.rx_rev1 = QRegExp('rev ([0-9]+): ([^|]*) \| ([^|]*) \| ([0-9]+) .*') |
80 self.rx_rev1 = QRegExp( |
|
81 'rev ([0-9]+): ([^|]*) \| ([^|]*) \| ([0-9]+) .*') |
78 # "rev" followed by one or more decimals followed by a colon followed |
82 # "rev" followed by one or more decimals followed by a colon followed |
79 # anything up to " | " (twice) followed by one or more decimals followed |
83 # anything up to " | " (twice) followed by one or more decimals |
80 # by anything |
84 # followed by anything |
81 self.rx_rev2 = QRegExp('r([0-9]+) \| ([^|]*) \| ([^|]*) \| ([0-9]+) .*') |
85 self.rx_rev2 = QRegExp( |
|
86 'r([0-9]+) \| ([^|]*) \| ([^|]*) \| ([0-9]+) .*') |
82 # "r" followed by one or more decimals followed by " | " followed |
87 # "r" followed by one or more decimals followed by " | " followed |
83 # anything up to " | " (twice) followed by one or more decimals followed |
88 # anything up to " | " (twice) followed by one or more decimals |
84 # by anything |
89 # followed by anything |
85 self.rx_flags1 = QRegExp(r""" ([ADM])\s(.*)\s+\(\w+\s+(.*):([0-9]+)\)\s*""") |
90 self.rx_flags1 = QRegExp( |
|
91 r""" ([ADM])\s(.*)\s+\(\w+\s+(.*):([0-9]+)\)\s*""") |
86 # three blanks followed by A or D or M followed by path followed by |
92 # three blanks followed by A or D or M followed by path followed by |
87 # path copied from followed by copied from revision |
93 # path copied from followed by copied from revision |
88 self.rx_flags2 = QRegExp(' ([ADM]) (.*)\\s*') |
94 self.rx_flags2 = QRegExp(' ([ADM]) (.*)\\s*') |
89 # three blanks followed by A or D or M followed by path |
95 # three blanks followed by A or D or M followed by path |
90 |
96 |
285 self.__processBuffer() |
291 self.__processBuffer() |
286 self.__finish() |
292 self.__finish() |
287 |
293 |
288 def __finish(self): |
294 def __finish(self): |
289 """ |
295 """ |
290 Private slot called when the process finished or the user pressed the button. |
296 Private slot called when the process finished or the user pressed the |
|
297 button. |
291 """ |
298 """ |
292 if self.process is not None and \ |
299 if self.process is not None and \ |
293 self.process.state() != QProcess.NotRunning: |
300 self.process.state() != QProcess.NotRunning: |
294 self.process.terminate() |
301 self.process.terminate() |
295 QTimer.singleShot(2000, self.process.kill) |
302 QTimer.singleShot(2000, self.process.kill) |
345 elif self.rx_sep1.exactMatch(s) or self.rx_sep2.exactMatch(s): |
352 elif self.rx_sep1.exactMatch(s) or self.rx_sep2.exactMatch(s): |
346 if len(log) > 1: |
353 if len(log) > 1: |
347 self.__generateLogItem(log["author"], log["date"], |
354 self.__generateLogItem(log["author"], log["date"], |
348 log["message"], log["revision"], changedPaths) |
355 log["message"], log["revision"], changedPaths) |
349 dt = QDate.fromString(log["date"], Qt.ISODate) |
356 dt = QDate.fromString(log["date"], Qt.ISODate) |
350 if not self.__maxDate.isValid() and not self.__minDate.isValid(): |
357 if not self.__maxDate.isValid() and \ |
|
358 not self.__minDate.isValid(): |
351 self.__maxDate = dt |
359 self.__maxDate = dt |
352 self.__minDate = dt |
360 self.__minDate = dt |
353 else: |
361 else: |
354 if self.__maxDate < dt: |
362 if self.__maxDate < dt: |
355 self.__maxDate = dt |
363 self.__maxDate = dt |
420 |
428 |
421 @param rev1 first revision number (integer) |
429 @param rev1 first revision number (integer) |
422 @param rev2 second revision number (integer) |
430 @param rev2 second revision number (integer) |
423 """ |
431 """ |
424 if self.sbsCheckBox.isEnabled() and self.sbsCheckBox.isChecked(): |
432 if self.sbsCheckBox.isEnabled() and self.sbsCheckBox.isChecked(): |
425 self.vcs.svnSbsDiff(self.filename, revisions=(str(rev1), str(rev2))) |
433 self.vcs.svnSbsDiff(self.filename, |
|
434 revisions=(str(rev1), str(rev2))) |
426 else: |
435 else: |
427 if self.diff is None: |
436 if self.diff is None: |
428 from .SvnDiffDialog import SvnDiffDialog |
437 from .SvnDiffDialog import SvnDiffDialog |
429 self.diff = SvnDiffDialog(self.vcs) |
438 self.diff = SvnDiffDialog(self.vcs) |
430 self.diff.show() |
439 self.diff.show() |
463 change["copyfrom_path"], change["copyfrom_revision"]) |
472 change["copyfrom_path"], change["copyfrom_revision"]) |
464 self.__resizeColumnsFiles() |
473 self.__resizeColumnsFiles() |
465 self.__resortFiles() |
474 self.__resortFiles() |
466 |
475 |
467 self.diffPreviousButton.setEnabled( |
476 self.diffPreviousButton.setEnabled( |
468 current != self.logTree.topLevelItem(self.logTree.topLevelItemCount() - 1)) |
477 current != self.logTree.topLevelItem( |
|
478 self.logTree.topLevelItemCount() - 1)) |
469 |
479 |
470 @pyqtSlot() |
480 @pyqtSlot() |
471 def on_logTree_itemSelectionChanged(self): |
481 def on_logTree_itemSelectionChanged(self): |
472 """ |
482 """ |
473 Private slot called, when the selection has changed. |
483 Private slot called, when the selection has changed. |
474 """ |
484 """ |
475 self.diffRevisionsButton.setEnabled(len(self.logTree.selectedItems()) == 2) |
485 self.diffRevisionsButton.setEnabled( |
|
486 len(self.logTree.selectedItems()) == 2) |
476 |
487 |
477 @pyqtSlot() |
488 @pyqtSlot() |
478 def on_nextButton_clicked(self): |
489 def on_nextButton_clicked(self): |
479 """ |
490 """ |
480 Private slot to handle the Next button. |
491 Private slot to handle the Next button. |
491 if itm is None: |
502 if itm is None: |
492 self.diffPreviousButton.setEnabled(False) |
503 self.diffPreviousButton.setEnabled(False) |
493 return |
504 return |
494 rev2 = int(itm.text(0)) |
505 rev2 = int(itm.text(0)) |
495 |
506 |
496 itm = self.logTree.topLevelItem(self.logTree.indexOfTopLevelItem(itm) + 1) |
507 itm = self.logTree.topLevelItem( |
|
508 self.logTree.indexOfTopLevelItem(itm) + 1) |
497 if itm is None: |
509 if itm is None: |
498 self.diffPreviousButton.setEnabled(False) |
510 self.diffPreviousButton.setEnabled(False) |
499 return |
511 return |
500 rev1 = int(itm.text(0)) |
512 rev1 = int(itm.text(0)) |
501 |
513 |
565 searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive) |
577 searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive) |
566 elif txt == self.trUtf8("Revision"): |
578 elif txt == self.trUtf8("Revision"): |
567 fieldIndex = 0 |
579 fieldIndex = 0 |
568 txt = self.rxEdit.text() |
580 txt = self.rxEdit.text() |
569 if txt.startswith("^"): |
581 if txt.startswith("^"): |
570 searchRx = QRegExp("^\s*{0}".format(txt[1:]), Qt.CaseInsensitive) |
582 searchRx = QRegExp( |
|
583 "^\s*{0}".format(txt[1:]), Qt.CaseInsensitive) |
571 else: |
584 else: |
572 searchRx = QRegExp(txt, Qt.CaseInsensitive) |
585 searchRx = QRegExp(txt, Qt.CaseInsensitive) |
573 else: |
586 else: |
574 fieldIndex = 3 |
587 fieldIndex = 3 |
575 searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive) |
588 searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive) |
589 self.filesTree.clear() |
602 self.filesTree.clear() |
590 |
603 |
591 @pyqtSlot(bool) |
604 @pyqtSlot(bool) |
592 def on_stopCheckBox_clicked(self, checked): |
605 def on_stopCheckBox_clicked(self, checked): |
593 """ |
606 """ |
594 Private slot called, when the stop on copy/move checkbox is clicked |
607 Private slot called, when the stop on copy/move checkbox is clicked. |
|
608 |
|
609 @param checked flag indicating the checked state (boolean) |
595 """ |
610 """ |
596 self.vcs.getPlugin().setPreferences("StopLogOnCopy", |
611 self.vcs.getPlugin().setPreferences("StopLogOnCopy", |
597 self.stopCheckBox.isChecked()) |
612 self.stopCheckBox.isChecked()) |
598 self.nextButton.setEnabled(True) |
613 self.nextButton.setEnabled(True) |
599 self.limitSpinBox.setEnabled(True) |
614 self.limitSpinBox.setEnabled(True) |