diff -r 2f70ca07f0af -r 4cd7e5a8b3cf src/eric7/Plugins/VcsPlugins/vcsPySvn/subversion.py --- a/src/eric7/Plugins/VcsPlugins/vcsPySvn/subversion.py Fri Dec 22 19:45:17 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsPySvn/subversion.py Sat Dec 23 15:40:23 2023 +0100 @@ -45,8 +45,11 @@ Constructor @param plugin reference to the plugin object - @param parent parent widget (QWidget) - @param name name of this object (string) + @type VcsSubversionPlugin + @param parent parent widget + @type QWidget + @param name name of this object + @type str """ VersionControl.__init__(self, parent, name) self.defaultOptions = { @@ -111,7 +114,8 @@ """ Public method to get a reference to the plugin object. - @return reference to the plugin object (VcsPySvnPlugin) + @return reference to the plugin object + @rtype VcsPySvnPlugin """ return self.__plugin @@ -119,7 +123,8 @@ """ Public method to create and initialize the pysvn client object. - @return the pysvn client object (pysvn.Client) + @return the pysvn client object + @rtype pysvn.Client """ configDir = "" authCache = True @@ -166,8 +171,8 @@ """ Public method used to test for the presence of the svn executable. - @return flag indicating the existance (boolean) and an error message - (string) + @return flag indicating the existance and an error message + @rtype tuple of (bool, str) """ self.versionStr = ".".join([str(v) for v in pysvn.svn_version[:-1]]) self.version = pysvn.svn_version[:-1] @@ -181,9 +186,12 @@ because the respective command always works locally. Therefore we always return TRUE without doing anything. - @param vcsDir name of the VCS directory (string) - @param noDialog flag indicating quiet operations (boolean) - @return always TRUE + @param vcsDir name of the VCS directory + @type str + @param noDialog flag indicating quiet operations + @type bool + @return always True + @rtype bool """ return True @@ -262,7 +270,7 @@ @param vcsDataDict dictionary of data required for the import @type dict - @param projectDir project directory (string) + @param projectDir project directory @type str @param noDialog flag indicating quiet operations @type bool @@ -342,9 +350,13 @@ repository. @param vcsDataDict dictionary of data required for the checkout - @param projectDir project directory to create (string) + @type dict + @param projectDir project directory to create + @type str @param noDialog flag indicating quiet operations - @return flag indicating an execution without errors (boolean) + @type bool + @return flag indicating an execution without errors + @rtype bool """ noDialog = False try: @@ -413,8 +425,11 @@ repository. @param vcsDataDict dictionary of data required for the checkout - @param projectDir project directory to create (string) - @return flag indicating an execution without errors (boolean) + @type dict + @param projectDir project directory to create + @type str + @return flag indicating an execution without errors + @rtype bool """ try: tag = vcsDataDict["tag"] @@ -476,10 +491,12 @@ Public method used to make the change of a file/directory permanent in the Subversion repository. - @param name file/directory name to be committed (string or - list of strings) - @param message message for this operation (string) + @param name file/directory name to be committed + @type str or list of str + @param message message for this operation + @type str @param noDialog flag indicating quiet operations + @type bool """ from .SvnCommitDialog import SvnCommitDialog @@ -662,11 +679,12 @@ Public method used to update a file/directory with the Subversion repository. - @param name file/directory name to be updated (string or list of - strings) - @param noDialog flag indicating quiet operations (boolean) - @return flag indicating, that the update contained an add - or delete (boolean) + @param name file/directory name to be updated + @type (str or list of str + @param noDialog flag indicating quiet operations + @type bool + @return flag indicating, that the update contained an add or delete + @rtype bool """ if isinstance(name, list): dname, fnames = self.splitPathList(name) @@ -708,9 +726,12 @@ Public method used to add a file/directory to the Subversion repository. - @param name file/directory name to be added (string) - @param isDir flag indicating name is a directory (boolean) - @param noDialog flag indicating quiet operations (boolean) + @param name file/directory name to be added + @type str + @param isDir flag indicating name is a directory + @type bool + @param noDialog flag indicating quiet operations + @type bool """ if isinstance(name, list): if isDir: @@ -815,8 +836,10 @@ Public method used to add a file/directory in binary mode to the Subversion repository. - @param name file/directory name to be added (string) - @param isDir flag indicating name is a directory (boolean) + @param name file/directory name to be added + @type str + @param isDir flag indicating name is a directory + @type bool """ self.vcsAdd(name, isDir) @@ -825,8 +848,8 @@ Public method to add a directory tree rooted at path to the Subversion repository. - @param path root directory of the tree to be added (string or list of - strings)) + @param path root directory of the tree to be added + @type str or list of str """ tree = [] if isinstance(path, list): @@ -922,12 +945,14 @@ The default operation is to remove the local copy as well. - @param name file/directory name to be removed (string or list of - strings)) - @param project flag indicating deletion of a project tree (boolean) - (not needed) + @param name file/directory name to be removed + @type str or list of str + @param project flag indicating deletion of a project tree + @type bool @param noDialog flag indicating quiet operations - @return flag indicating successfull operation (boolean) + @type bool + @return flag indicating successfull operation + @rtype bool """ if not isinstance(name, list): name = [name] @@ -959,11 +984,16 @@ """ Public method used to move a file/directory. - @param name file/directory name to be moved (string) + @param name file/directory name to be moved + @type str @param project reference to the project object - @param target new name of the file/directory (string) + @type Project + @param target new name of the file/directory + @type str @param noDialog flag indicating quiet operations - @return flag indicating successfull operation (boolean) + @type bool + @return flag indicating successfull operation + @rtype bool """ from .SvnCopyDialog import SvnCopyDialog @@ -1040,7 +1070,8 @@ being edited and has unsaved modification, they can be saved or the operation may be aborted. - @param name file/directory name to be diffed (string) + @param name file/directory name to be diffed + @type str """ from .SvnDiffDialog import SvnDiffDialog @@ -1067,7 +1098,7 @@ Subversion repository. @param name file/directory name(s) to show the status of - (string or list of strings) + @type str or list of str """ from .SvnStatusDialog import SvnStatusDialog @@ -1083,7 +1114,8 @@ Public method used to set the tag of a file/directory in the Subversion repository. - @param name file/directory name to be tagged (string) + @param name file/directory name to be tagged + @type str """ from .SvnTagDialog import SvnTagDialog @@ -1250,9 +1282,10 @@ """ Public method used to switch a directory to a different tag/branch. - @param name directory name to be switched (string) - @return flag indicating, that the switch contained an add - or delete (boolean) + @param name directory name to be switched + @type str + @return flag indicating, that the switch contained an add or delete + @rtype bool """ from .SvnSwitchDialog import SvnSwitchDialog @@ -1336,7 +1369,8 @@ """ Public method used to merge a URL/revision into the local project. - @param name file/directory name to be merged (string) + @param name file/directory name to be merged + @type str """ from .SvnMergeDialog import SvnMergeDialog @@ -1447,8 +1481,10 @@ """ Public method used to get the registered state of a file in the vcs. - @param name filename to check (string) - @return a combination of canBeCommited and canBeAdded + @param name filename to check + @type str + @return registered state (one of canBeCommited and canBeAdded) + @rtype int """ if self.__wcng: return self.__vcsRegisteredState_wcng(name) @@ -1462,8 +1498,10 @@ This is the variant for subversion installations using the new working copy meta-data format. - @param name filename to check (string) - @return a combination of canBeCommited and canBeAdded + @param name filename to check + @type str + @return registered state (one of canBeCommited and canBeAdded) + @rtype int """ if name.endswith(os.sep): name = name[:-1] @@ -1491,8 +1529,10 @@ This is the variant for subversion installations using the old working copy meta-data format. - @param name filename to check (string) - @return a combination of canBeCommited and canBeAdded + @param name filename to check + @type str + @return registered state (one of canBeCommited and canBeAdded) + @rtype int """ dname, fname = self.splitPath(name) @@ -1520,10 +1560,14 @@ that the states for all files has been populated by the previous run. @param names dictionary with all filenames to be checked as keys - @param dname directory to check in (string) - @param shortcut flag indicating a shortcut should be taken (boolean) + @type dict + @param dname directory to check in + @type str + @param shortcut flag indicating a shortcut should be taken + @type bool @return the received dictionary completed with a combination of canBeCommited and canBeAdded or None in order to signal an error + @rtype dict """ if self.__wcng: return self.__vcsAllRegisteredStates_wcng(names, dname, shortcut) @@ -1543,10 +1587,14 @@ that the states for all files has been populated by the previous run. @param names dictionary with all filenames to be checked as keys - @param dname directory to check in (string) - @param shortcut flag indicating a shortcut should be taken (boolean) + @type dict + @param dname directory to check in + @type str + @param shortcut flag indicating a shortcut should be taken + @type bool @return the received dictionary completed with a combination of canBeCommited and canBeAdded or None in order to signal an error + @rtype dict """ from .SvnDialogMixin import SvnDialogMixin @@ -1621,10 +1669,14 @@ that the states for all files has been populated by the previous run. @param names dictionary with all filenames to be checked as keys - @param dname directory to check in (string) - @param shortcut flag indicating a shortcut should be taken (boolean) + @type dict + @param dname directory to check in + @type str + @param shortcut flag indicating a shortcut should be taken + @type bool @return the received dictionary completed with a combination of canBeCommited and canBeAdded or None in order to signal an error + @rtype dict """ from .SvnDialogMixin import SvnDialogMixin @@ -1671,8 +1723,10 @@ Private method to check, if the given status indicates a versioned state. - @param status status object to check (pysvn.PysvnStatus) - @return flag indicating a versioned state (boolean) + @param status status object to check + @type pysvn.PysvnStatus + @return flag indicating a versioned state + @rtype bool """ return status["text_status"] in [ pysvn.wc_status_kind.normal, @@ -1698,7 +1752,8 @@ This method ensures, that eric specific files and directories are ignored. - @param project reference to the project (Project) + @param project reference to the project + @type Project """ configPath = getConfigPath() if os.path.exists(configPath): @@ -1710,7 +1765,8 @@ """ Public method returning the name of the vcs. - @return always 'Subversion' (string) + @return always 'Subversion' + @rtype str """ return "Subversion" @@ -1718,7 +1774,8 @@ """ Public method used to cleanup the working copy. - @param name directory name to be cleaned up (string) + @param name directory name to be cleaned up + @type str """ client = self.getClient() dlg = SvnDialog( @@ -1737,7 +1794,8 @@ """ Public method used to execute arbitrary subversion commands. - @param name directory name of the working directory (string) + @param name directory name of the working directory + @type str """ from eric7.Plugins.VcsPlugins.vcsSubversion.SvnDialog import ( SvnDialog as SvnProcessDialog, @@ -1774,11 +1832,15 @@ Public method to get a dialog to enter repository info. @param project reference to the project object - @param archive name of the project in the repository (string) + @type Project + @param archive name of the project in the repository + @type str @param editable flag indicating that the project name is editable - (boolean) - @param parent parent widget (QWidget) - @return reference to the instantiated options dialog (SvnOptionsDialog) + @type bool + @param parent parent widget + @type QWidget + @return reference to the instantiated options dialog + @rtype SvnOptionsDialog """ from .SvnOptionsDialog import SvnOptionsDialog @@ -1789,9 +1851,10 @@ Public method to get a dialog to enter repository info for getting a new project. - @param parent parent widget (QWidget) + @param parent parent widget + @type QWidget @return reference to the instantiated options dialog - (SvnNewProjectOptionsDialog) + @rtype SvnNewProjectOptionsDialog """ from .SvnNewProjectOptionsDialog import SvnNewProjectOptionsDialog @@ -1801,8 +1864,10 @@ """ Public method to retrieve information about the repository. - @param ppath local path to get the repository infos (string) - @return string with ready formated info for display (string) + @param ppath local path to get the repository infos + @type str + @return string with ready formated info for display + @rtype str """ try: entry = self.getClient().info(ppath) @@ -1854,8 +1919,10 @@ Public method used to retrieve the URL of the subversion repository path. - @param path local path to get the svn repository path for (string) + @param path local path to get the svn repository path for + @type str @return string with the repository path URL + @rtype str """ client = pysvn.Client() try: @@ -1870,7 +1937,8 @@ """ Public method used to resolve conflicts of a file/directory. - @param name file/directory name to be resolved (string) + @param name file/directory name to be resolved + @type str """ if isinstance(name, list): dname, fnames = self.splitPathList(name) @@ -1906,9 +1974,12 @@ """ Public method used to copy a file/directory. - @param name file/directory name to be copied (string) + @param name file/directory name to be copied + @type str @param project reference to the project object - @return flag indicating successfull operation (boolean) + @type Project + @return flag indicating successfull operation + @rtype bool """ from .SvnCopyDialog import SvnCopyDialog @@ -1957,8 +2028,10 @@ """ Public method used to list the properties of a file/directory. - @param name file/directory name (string or list of strings) + @param name file/directory name + @type str or list of str @param recursive flag indicating a recursive list is requested + @type bool """ from .SvnPropListDialog import SvnPropListDialog @@ -1973,8 +2046,10 @@ """ Public method used to add a property to a file/directory. - @param name file/directory name (string or list of strings) + @param name file/directory name + @type str or list of str @param recursive flag indicating a recursive set is requested + @type bool """ from .SvnPropSetDialog import SvnPropSetDialog @@ -2033,8 +2108,10 @@ """ Public method used to delete a property of a file/directory. - @param name file/directory name (string or list of strings) + @param name file/directory name + @type str or list of str @param recursive flag indicating a recursive list is requested + @type bool """ from .SvnPropDelDialog import SvnPropDelDialog @@ -2089,9 +2166,11 @@ """ Public method used to list the available tags or branches. - @param path directory name of the project (string) + @param path directory name of the project + @type str @param tags flag indicating listing of branches or tags (False = branches, True = tags) + @type bool """ from .SvnTagBranchListDialog import SvnTagBranchListDialog @@ -2119,7 +2198,8 @@ """ Public method to show the output of the svn blame command. - @param name file name to show the blame for (string) + @param name file name to show the blame for + @type str """ from .SvnBlameDialog import SvnBlameDialog @@ -2142,7 +2222,8 @@ This method gives the chance to enter the revisions to be compared. - @param name file/directory name to be diffed (string) + @param name file/directory name to be diffed + @type str """ from .SvnDiffDialog import SvnDiffDialog from .SvnRevisionSelectionDialog import SvnRevisionSelectionDialog @@ -2179,7 +2260,8 @@ This method gives the chance to enter the revisions to be compared. - @param name file/directory name to be diffed (string) + @param name file/directory name to be diffed + @type str """ from .SvnDiffDialog import SvnDiffDialog from .SvnUrlSelectionDialog import SvnUrlSelectionDialog @@ -2212,9 +2294,12 @@ Private method to get a file for a specific revision from the repository. - @param name file name to get from the repository (string) - @param rev revision to retrieve (integer or string) - @return contents of the file (string) and an error message (string) + @param name file name to get from the repository + @type str + @param rev revision to retrieve + @type int or str + @return contents of the file (string) and an error message + @rtype str """ output = "" error = "" @@ -2256,9 +2341,12 @@ Public method used to view the difference of a file to the Mercurial repository side-by-side. - @param name file name to be diffed (string) - @param extended flag indicating the extended variant (boolean) - @param revisions tuple of two revisions (tuple of strings) + @param name file name to be diffed + @type str + @param extended flag indicating the extended variant + @type bool + @param revisions tuple of two revisions + @type tuple of (str, str) @exception ValueError raised to indicate an invalid name parameter type """ from eric7.UI.CompareDialog import CompareDialog @@ -2325,8 +2413,10 @@ Public method used to browse the log of a file/directory from the Subversion repository. - @param name file/directory name to show the log of (string) - @param isFile flag indicating log for a file is to be shown (boolean) + @param name file/directory name to show the log of + @type str + @param isFile flag indicating log for a file is to be shown + @type bool """ from .SvnLogBrowserDialog import SvnLogBrowserDialog @@ -2341,11 +2431,12 @@ """ Public method used to lock a file in the Subversion repository. - @param name file/directory name to be locked (string or list of - strings) - @param stealIt flag indicating a forced operation (boolean) + @param name file/directory name to be locked + @type str or list of str + @param stealIt flag indicating a forced operation + @type bool @param parent reference to the parent object of the subversion dialog - (QWidget) + @type QWidget """ comment, ok = QInputDialog.getText( None, @@ -2392,11 +2483,12 @@ """ Public method used to unlock a file in the Subversion repository. - @param name file/directory name to be unlocked (string or list of - strings) - @param breakIt flag indicating a forced operation (boolean) + @param name file/directory name to be unlocked + @type str or list of str + @param breakIt flag indicating a forced operation + @type bool @param parent reference to the parent object of the subversion dialog - (QWidget) + @type QWidget """ if isinstance(name, list): dname, fnames = self.splitPathList(name) @@ -2429,8 +2521,10 @@ """ Public method to show repository information about a file or directory. - @param projectPath path name of the project (string) - @param name file/directory name relative to the project (string) + @param projectPath path name of the project + @type str + @param name file/directory name relative to the project + @type str """ from .SvnInfoDialog import SvnInfoDialog @@ -2442,7 +2536,8 @@ """ Public method to relocate the working copy to a new repository URL. - @param projectPath path name of the project (string) + @param projectPath path name of the project + @type str """ from .SvnRelocateDialog import SvnRelocateDialog @@ -2472,7 +2567,8 @@ """ Public method to open the repository browser. - @param projectPath path name of the project (string) + @param projectPath path name of the project + @type str """ from .SvnRepoBrowserDialog import SvnRepoBrowserDialog @@ -2500,7 +2596,7 @@ Note: Directories will be removed recursively. @param names name or list of names of file or directory to remove - (string) + @type str or list of str """ if not isinstance(names, list): names = [names] @@ -2527,7 +2623,7 @@ Note: Directories will be added recursively. @param names name or list of names of file or directory to add - (string) + @type str or list of str """ if not isinstance(names, list): names = [names] @@ -2563,7 +2659,8 @@ """ Public method used to inspect the change lists defined for the project. - @param path directory name to show change lists for (string) + @param path directory name to show change lists for + @type str """ from .SvnChangeListsDialog import SvnChangeListsDialog @@ -2576,7 +2673,8 @@ """ Public method to get a list of all defined change lists. - @return list of defined change list names (list of strings) + @return list of defined change list names + @rtype list of str """ changelists = [] client = self.getClient() @@ -2596,7 +2694,8 @@ """ Public method to upgrade the working copy format. - @param path directory name to show change lists for (string) + @param path directory name to show change lists for + @type str """ client = self.getClient() dlg = SvnDialog(self.tr("Upgrade"), "upgrade {0}".format(path), client) @@ -2617,8 +2716,10 @@ """ Private method to format a url for subversion. - @param url unformatted url string (string) - @return properly formated url for subversion (string) + @param url unformatted url string + @type str + @return properly formated url for subversion + @rtype str """ url = self.svnNormalizeURL(url) url = url.split(":", 2) @@ -2643,8 +2744,10 @@ """ Public method to normalize a url for subversion. - @param url url string (string) - @return properly normalized url for subversion (string) + @param url url string + @type str + @return properly normalized url for subversion + @rtype str """ protocol, url = url.split("://", 1) if url.startswith("\\\\"): @@ -2670,10 +2773,14 @@ project browsers. @param browser reference to the project browser object + @type ProjectBaseBrowser @param project reference to the project object + @type Project @param isTranslationsBrowser flag indicating, the helper is requested for the translations browser (this needs some special treatment) + @type bool @return the project browser helper object + @rtype SvnProjectBrowserHelper """ from .ProjectBrowserHelper import SvnProjectBrowserHelper @@ -2684,7 +2791,9 @@ Public method to instanciate a helper object for the project. @param project reference to the project object + @type Project @return the project helper object + @rtype PySvnProjectHelper """ helper = self.__plugin.getProjectHelper() helper.setObjects(self, project) @@ -2706,9 +2815,11 @@ thread. @param interval check interval for the monitor thread in seconds - (integer) + @type int @param project reference to the project object - @return reference to the monitor thread (QThread) + @type Project + @return reference to the monitor thread + @rtype SvnStatusMonitorThread """ from .SvnStatusMonitorThread import SvnStatusMonitorThread