eric7/VCS/VersionControl.py

branch
eric7
changeset 8620
84f7f7867b5f
parent 8358
144a6b854f70
child 8621
8c9f41115c04
equal deleted inserted replaced
8619:2dc55ddafc68 8620:84f7f7867b5f
27 VCS interfaces. 27 VCS interfaces.
28 28
29 It defines the vcs interface to be implemented by subclasses 29 It defines the vcs interface to be implemented by subclasses
30 and the common methods. 30 and the common methods.
31 31
32 @signal committed() emitted after the commit action has completed
32 @signal vcsStatusMonitorData(list of str) emitted to update the VCS status 33 @signal vcsStatusMonitorData(list of str) emitted to update the VCS status
34 @signal vcsStatusMonitorAllData(dict) emitted to signal all VCS status
35 (key is project relative file name, value is status)
33 @signal vcsStatusMonitorStatus(str, str) emitted to signal the status of 36 @signal vcsStatusMonitorStatus(str, str) emitted to signal the status of
34 the monitoring thread (ok, nok, op, off) and a status message 37 the monitoring thread (ok, nok, op, off) and a status message
35 @signal vcsStatusMonitorInfo(str) emitted to signal some info of the 38 @signal vcsStatusMonitorInfo(str) emitted to signal some info of the
36 monitoring thread 39 monitoring thread
37 @signal vcsStatusChanged() emitted to indicate a change of the overall 40 @signal vcsStatusChanged() emitted to indicate a change of the overall
38 VCS status 41 VCS status
39 """ 42 """
43 committed = pyqtSignal()
40 vcsStatusMonitorData = pyqtSignal(list) 44 vcsStatusMonitorData = pyqtSignal(list)
45 vcsStatusMonitorAllData = pyqtSignal(dict)
41 vcsStatusMonitorStatus = pyqtSignal(str, str) 46 vcsStatusMonitorStatus = pyqtSignal(str, str)
42 vcsStatusMonitorInfo = pyqtSignal(str) 47 vcsStatusMonitorInfo = pyqtSignal(str)
43 vcsStatusChanged = pyqtSignal() 48 vcsStatusChanged = pyqtSignal()
44 49
45 canBeCommitted = 1 # Indicates that a file/directory is in the vcs. 50 canBeCommitted = 1 # Indicates that a file/directory is in the vcs.
683 self.vcsStatusMonitorStatus.emit(status, statusMsg) 688 self.vcsStatusMonitorStatus.emit(status, statusMsg)
684 QCoreApplication.processEvents() 689 QCoreApplication.processEvents()
685 690
686 def __statusMonitorData(self, statusList): 691 def __statusMonitorData(self, statusList):
687 """ 692 """
688 Private method to receive the status monitor status. 693 Private method to receive the status monitor data update.
689 694
690 It simply re-emits the received status list. 695 It simply re-emits the received status list.
691 696
692 @param statusList list of status records 697 @param statusList list of status records
693 @type list of str 698 @type list of str
694 """ 699 """
695 self.vcsStatusMonitorData.emit(statusList) 700 self.vcsStatusMonitorData.emit(statusList)
701 QCoreApplication.processEvents()
702
703 def __statusMonitorAllData(self, statusDict):
704 """
705 Private method to receive all status monitor data.
706
707 It simply re-emits the received status list.
708
709 @param statusDict dictionary of status records
710 @type dict
711 """
712 self.vcsStatusMonitorAllData.emit(statusDict)
696 QCoreApplication.processEvents() 713 QCoreApplication.processEvents()
697 714
698 def __statusMonitorInfo(self, info): 715 def __statusMonitorInfo(self, info):
699 """ 716 """
700 Private slot to receive the status monitor info message. 717 Private slot to receive the status monitor info message.
723 self.statusMonitorThread = self._createStatusMonitorThread( 740 self.statusMonitorThread = self._createStatusMonitorThread(
724 vcsStatusMonitorInterval, project) 741 vcsStatusMonitorInterval, project)
725 if self.statusMonitorThread is not None: 742 if self.statusMonitorThread is not None:
726 self.statusMonitorThread.vcsStatusMonitorData.connect( 743 self.statusMonitorThread.vcsStatusMonitorData.connect(
727 self.__statusMonitorData, 744 self.__statusMonitorData,
745 Qt.ConnectionType.QueuedConnection)
746 self.statusMonitorThread.vcsStatusMonitorAllData.connect(
747 self.__statusMonitorAllData,
728 Qt.ConnectionType.QueuedConnection) 748 Qt.ConnectionType.QueuedConnection)
729 self.statusMonitorThread.vcsStatusMonitorStatus.connect( 749 self.statusMonitorThread.vcsStatusMonitorStatus.connect(
730 self.__statusMonitorStatus, 750 self.__statusMonitorStatus,
731 Qt.ConnectionType.QueuedConnection) 751 Qt.ConnectionType.QueuedConnection)
732 self.statusMonitorThread.vcsStatusMonitorInfo.connect( 752 self.statusMonitorThread.vcsStatusMonitorInfo.connect(
745 """ 765 """
746 if self.statusMonitorThread is not None: 766 if self.statusMonitorThread is not None:
747 self.__statusMonitorData(["--RESET--"]) 767 self.__statusMonitorData(["--RESET--"])
748 self.statusMonitorThread.vcsStatusMonitorData.disconnect( 768 self.statusMonitorThread.vcsStatusMonitorData.disconnect(
749 self.__statusMonitorData) 769 self.__statusMonitorData)
770 self.statusMonitorThread.vcsStatusMonitorAllData.disconnect(
771 self.__statusMonitorAllData)
750 self.statusMonitorThread.vcsStatusMonitorStatus.disconnect( 772 self.statusMonitorThread.vcsStatusMonitorStatus.disconnect(
751 self.__statusMonitorStatus) 773 self.__statusMonitorStatus)
752 self.statusMonitorThread.vcsStatusMonitorInfo.disconnect( 774 self.statusMonitorThread.vcsStatusMonitorInfo.disconnect(
753 self.__statusMonitorInfo) 775 self.__statusMonitorInfo)
754 self.statusMonitorThread.stop() 776 self.statusMonitorThread.stop()

eric ide

mercurial