diff -r 2f70ca07f0af -r 4cd7e5a8b3cf src/eric7/Plugins/VcsPlugins/vcsSubversion/subversion.py --- a/src/eric7/Plugins/VcsPlugins/vcsSubversion/subversion.py Fri Dec 22 19:45:17 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsSubversion/subversion.py Sat Dec 23 15:40:23 2023 +0100 @@ -40,8 +40,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 = { @@ -114,7 +117,8 @@ """ Public method to get a reference to the plugin object. - @return reference to the plugin object (VcsSubversionPlugin) + @return reference to the plugin object + @rtype VcsSubversionPlugin """ return self.__plugin @@ -146,7 +150,8 @@ Public method used to test for the presence of the svn executable. @return flag indicating the existance (boolean) and an error message - (string) + + @rtype str """ self.versionStr = "" errMsg = "" @@ -192,9 +197,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 @@ -273,7 +281,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 @@ -339,9 +347,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: @@ -400,8 +412,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"] @@ -453,10 +468,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 @@ -613,11 +630,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 """ args = [] args.append("update") @@ -650,9 +668,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 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 """ args = [] args.append("add") @@ -745,8 +766,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) @@ -755,8 +778,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 """ args = [] args.append("add") @@ -835,12 +858,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 """ args = [] args.append("delete") @@ -871,11 +896,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 @@ -945,7 +975,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 @@ -972,7 +1003,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 @@ -987,7 +1018,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 @@ -1136,8 +1168,10 @@ """ Public method used to switch a directory to a different tag/branch. - @param name directory name to be switched (string) - @return flag indicating added or changed files (boolean) + @param name directory name to be switched + @type str + @return flag indicating added or changed files + @rtype bool """ from .SvnSwitchDialog import SvnSwitchDialog @@ -1218,7 +1252,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 @@ -1281,8 +1316,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) @@ -1296,8 +1333,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] @@ -1325,8 +1364,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) @@ -1354,10 +1395,14 @@ that the states for all files have 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) @@ -1377,9 +1422,12 @@ 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) + @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 + @rtype dict """ if dname.endswith(os.sep): dname = dname[:-1] @@ -1447,10 +1495,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 not os.path.isdir(os.path.join(dname, self.adminDir)): # not under version control -> do nothing @@ -1514,7 +1566,8 @@ This method ensures, that an ignore file exists. - @param project reference to the project (Project) + @param project reference to the project + @type Project """ configPath = getConfigPath() if os.path.exists(configPath): @@ -1526,7 +1579,8 @@ """ Public method returning the name of the vcs. - @return always 'Subversion' (string) + @return always 'Subversion' + @rtype str """ return "Subversion" @@ -1534,7 +1588,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 """ args = [] args.append("cleanup") @@ -1550,7 +1605,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 .SvnCommandDialog import SvnCommandDialog @@ -1583,11 +1639,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 @@ -1598,9 +1658,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 @@ -1610,8 +1671,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 """ info = { "committed-rev": "", @@ -1698,8 +1761,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 """ ioEncoding = Preferences.getSystem("IOEncoding") @@ -1727,7 +1792,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 """ args = [] if self.version >= (1, 5, 0): @@ -1754,9 +1820,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 @@ -1797,8 +1866,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 @@ -1812,8 +1883,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 list is requested + @type bool """ from .SvnPropSetDialog import SvnPropSetDialog @@ -1853,8 +1926,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 """ propName, ok = QInputDialog.getText( None, @@ -1896,9 +1971,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) + (False = branches, True = tags) + @type bool """ from .SvnTagBranchListDialog import SvnTagBranchListDialog @@ -1929,7 +2006,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 @@ -1951,7 +2029,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 @@ -1985,7 +2064,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 @@ -2016,9 +2096,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 """ args = [] args.append("cat") @@ -2063,9 +2146,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 illegal name parameter type """ from eric7.UI.CompareDialog import CompareDialog @@ -2132,8 +2218,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 @@ -2147,11 +2235,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 """ args = [] args.append("lock") @@ -2174,11 +2263,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 """ args = [] args.append("unlock") @@ -2201,7 +2291,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 @@ -2226,7 +2317,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 @@ -2255,7 +2347,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 """ args = [] args.append("changelist") @@ -2281,7 +2373,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 """ clname, ok = QInputDialog.getItem( None, @@ -2315,7 +2407,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 @@ -2328,7 +2421,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 = [] rx_changelist = re.compile("--- \\S+ .([\\w\\s]+).:\\s*") @@ -2367,7 +2461,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 """ args = [] args.append("upgrade") @@ -2386,8 +2481,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) @@ -2412,8 +2509,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("\\\\"): @@ -2437,10 +2536,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 @@ -2451,7 +2554,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 SvnProjectHelper """ helper = self.__plugin.getProjectHelper() helper.setObjects(self, project) @@ -2473,9 +2578,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