--- a/src/eric7/Plugins/VcsPlugins/vcsSubversion/subversion.py Sun Nov 06 11:22:39 2022 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsSubversion/subversion.py Mon Nov 07 17:19:58 2022 +0100 @@ -19,6 +19,7 @@ from eric7 import Preferences, Utilities from eric7.EricWidgets import EricMessageBox from eric7.EricWidgets.EricApplication import ericApp +from eric7.UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog from eric7.VCS.VersionControl import VersionControl from .SvnDialog import SvnDialog @@ -455,13 +456,13 @@ @param message message for this operation (string) @param noDialog flag indicating quiet operations """ + from .SvnCommitDialog import SvnCommitDialog + msg = message if not noDialog and not msg: # call CommitDialog and get message from there if self.__commitDialog is None: - from .SvnCommitDialog import SvnCommitDialog - self.__commitDialog = SvnCommitDialog(self, self.__ui) self.__commitDialog.accepted.connect(self.__vcsCommit_Step2) self.__commitDialog.show() @@ -874,6 +875,8 @@ @param noDialog flag indicating quiet operations @return flag indicating successfull operation (boolean) """ + from .SvnCopyDialog import SvnCopyDialog + rx_prot = re.compile("(file:|svn:|svn+ssh:|http:|https:).+") opts = self.options["global"][:] force = "--force" in opts @@ -887,8 +890,6 @@ force = True accepted = True else: - from .SvnCopyDialog import SvnCopyDialog - dlg = SvnCopyDialog(name, None, True, force) accepted = dlg.exec() == QDialog.DialogCode.Accepted if accepted: @@ -944,6 +945,8 @@ @param name file/directory name to be diffed (string) """ + from .SvnDiffDialog import SvnDiffDialog + names = name[:] if isinstance(name, list) else [name] for nam in names: if os.path.isfile(nam): @@ -955,8 +958,6 @@ if nam == project.ppath and not project.saveAllScripts(): return if self.diff is None: - from .SvnDiffDialog import SvnDiffDialog - self.diff = SvnDiffDialog(self) self.diff.show() self.diff.raise_() @@ -971,9 +972,9 @@ @param name file/directory name(s) to show the status of (string or list of strings) """ + from .SvnStatusDialog import SvnStatusDialog + if self.status is None: - from .SvnStatusDialog import SvnStatusDialog - self.status = SvnStatusDialog(self) self.status.show() self.status.raise_() @@ -986,6 +987,8 @@ @param name file/directory name to be tagged (string) """ + from .SvnTagDialog import SvnTagDialog + dname, fname = self.splitPath(name) reposURL = self.svnGetReposName(dname) @@ -1004,8 +1007,6 @@ url = ( None if self.otherData["standardLayout"] else self.svnNormalizeURL(reposURL) ) - from .SvnTagDialog import SvnTagDialog - dlg = SvnTagDialog( self.allTagsBranchesList, url, self.otherData["standardLayout"] ) @@ -1089,10 +1090,6 @@ project = ericApp().getObject("Project") names = [project.getRelativePath(nam) for nam in names] if names[0]: - from eric7.UI.DeleteFilesConfirmationDialog import ( - DeleteFilesConfirmationDialog, - ) - dlg = DeleteFilesConfirmationDialog( self.parent(), self.tr("Revert changes"), @@ -1140,6 +1137,8 @@ @param name directory name to be switched (string) @return flag indicating added or changed files (boolean) """ + from .SvnSwitchDialog import SvnSwitchDialog + dname, fname = self.splitPath(name) reposURL = self.svnGetReposName(dname) @@ -1158,8 +1157,6 @@ url = ( None if self.otherData["standardLayout"] else self.svnNormalizeURL(reposURL) ) - from .SvnSwitchDialog import SvnSwitchDialog - dlg = SvnSwitchDialog( self.allTagsBranchesList, url, self.otherData["standardLayout"] ) @@ -1221,6 +1218,8 @@ @param name file/directory name to be merged (string) """ + from .SvnMergeDialog import SvnMergeDialog + dname, fname = self.splitPath(name) opts = self.options["global"][:] @@ -1228,8 +1227,6 @@ if force: del opts[opts.index("--force")] - from .SvnMergeDialog import SvnMergeDialog - dlg = SvnMergeDialog( self.mergeList[0], self.mergeList[1], self.mergeList[2], force ) @@ -1800,9 +1797,9 @@ @param name file/directory name (string or list of strings) @param recursive flag indicating a recursive list is requested """ + from .SvnPropListDialog import SvnPropListDialog + if self.propList is None: - from .SvnPropListDialog import SvnPropListDialog - self.propList = SvnPropListDialog(self) self.propList.show() self.propList.raise_() @@ -1900,9 +1897,9 @@ @param tags flag indicating listing of branches or tags (False = branches, True = tags) """ + from .SvnTagBranchListDialog import SvnTagBranchListDialog + if self.tagbranchList is None: - from .SvnTagBranchListDialog import SvnTagBranchListDialog - self.tagbranchList = SvnTagBranchListDialog(self) self.tagbranchList.show() self.tagbranchList.raise_() @@ -1931,9 +1928,9 @@ @param name file name to show the blame for (string) """ + from .SvnBlameDialog import SvnBlameDialog + if self.blame is None: - from .SvnBlameDialog import SvnBlameDialog - self.blame = SvnBlameDialog(self) self.blame.show() self.blame.raise_() @@ -1953,6 +1950,9 @@ @param name file/directory name to be diffed (string) """ + from .SvnDiffDialog import SvnDiffDialog + from .SvnRevisionSelectionDialog import SvnRevisionSelectionDialog + names = name[:] if isinstance(name, list) else [name] for nam in names: if os.path.isfile(nam): @@ -1963,13 +1963,9 @@ project = ericApp().getObject("Project") if nam == project.ppath and not project.saveAllScripts(): return - from .SvnRevisionSelectionDialog import SvnRevisionSelectionDialog - dlg = SvnRevisionSelectionDialog() if dlg.exec() == QDialog.DialogCode.Accepted: revisions = dlg.getRevisions() - from .SvnDiffDialog import SvnDiffDialog - self.diff = SvnDiffDialog(self) self.diff.show() self.diff.start(name, revisions) @@ -1988,6 +1984,9 @@ @param name file/directory name to be diffed (string) """ + from .SvnDiffDialog import SvnDiffDialog + from .SvnUrlSelectionDialog import SvnUrlSelectionDialog + names = name[:] if isinstance(name, list) else [name] for nam in names: if os.path.isfile(nam): @@ -2001,13 +2000,9 @@ dname = self.splitPath(names[0])[0] - from .SvnUrlSelectionDialog import SvnUrlSelectionDialog - dlg = SvnUrlSelectionDialog(self, self.tagsList, self.branchesList, dname) if dlg.exec() == QDialog.DialogCode.Accepted: urls, summary = dlg.getURLs() - from .SvnDiffDialog import SvnDiffDialog - self.diff = SvnDiffDialog(self) self.diff.show() QApplication.processEvents() @@ -2070,12 +2065,14 @@ @param revisions tuple of two revisions (tuple of strings) @exception ValueError raised to indicate an illegal name parameter type """ + from eric7.UI.CompareDialog import CompareDialog + + from .SvnRevisionSelectionDialog import SvnRevisionSelectionDialog + if isinstance(name, list): raise ValueError("Wrong parameter type") if extended: - from .SvnRevisionSelectionDialog import SvnRevisionSelectionDialog - dlg = SvnRevisionSelectionDialog() if dlg.exec() == QDialog.DialogCode.Accepted: rev1, rev2 = dlg.getRevisions() @@ -2122,8 +2119,6 @@ return if self.sbsDiff is None: - from eric7.UI.CompareDialog import CompareDialog - self.sbsDiff = CompareDialog() self.sbsDiff.show() self.sbsDiff.raise_() @@ -2137,9 +2132,9 @@ @param name file/directory name to show the log of (string) @param isFile flag indicating log for a file is to be shown (boolean) """ + from .SvnLogBrowserDialog import SvnLogBrowserDialog + if self.logBrowser is None: - from .SvnLogBrowserDialog import SvnLogBrowserDialog - self.logBrowser = SvnLogBrowserDialog(self) self.logBrowser.show() self.logBrowser.raise_() @@ -2230,6 +2225,8 @@ @param projectPath path name of the project (string) """ + from .SvnRepoBrowserDialog import SvnRepoBrowserDialog + url = self.svnGetReposName(projectPath) if projectPath else None if url is None: @@ -2243,8 +2240,6 @@ return if self.repoBrowser is None: - from .SvnRepoBrowserDialog import SvnRepoBrowserDialog - self.repoBrowser = SvnRepoBrowserDialog(self) self.repoBrowser.show() self.repoBrowser.raise_()