--- a/src/eric7/VCS/VersionControl.py Mon Jan 08 11:14:48 2024 +0100 +++ b/src/eric7/VCS/VersionControl.py Mon Jan 08 11:50:27 2024 +0100 @@ -9,6 +9,7 @@ """ import contextlib +import enum import json import os @@ -29,6 +30,15 @@ from eric7.EricWidgets.EricApplication import ericApp +class VersionControlState(enum.Enum): + """ + Class defining the global VCS states of files and directories. + """ + + Controlled = 0 + Uncontrolled = 1 + + class VersionControl(QObject): """ Class implementing an abstract base class to be subclassed by all specific @@ -56,10 +66,6 @@ vcsStatusMonitorInfo = pyqtSignal(str) vcsStatusChanged = pyqtSignal() - # TODO: change this to an enum - canBeCommitted = 1 # Indicates that a file/directory is in the vcs. - canBeAdded = 2 # Indicates that a file/directory is not in vcs. - commitHistoryLock = "commitHistory.lock" commitHistoryData = "commitHistory.json" @@ -563,8 +569,8 @@ @param name filename to check @type str - @return registered state (one of canBeCommited and canBeAdded) - @rtype int + @return registered state + @rtype VersionControlState @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -581,8 +587,8 @@ @type dict @param dname directory to check in @type str - @return the received dictionary completed with a combination of - canBeCommited and canBeAdded or None in order to signal an error + @return the received dictionary completed with the VCS state or None in + order to signal an error @rtype dict @exception NotImplementedError to indicate that this method must be implemented by a subclass