src/eric7/Plugins/VcsPlugins/vcsGit/git.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9573
9960d19d66b5
--- a/src/eric7/Plugins/VcsPlugins/vcsGit/git.py	Sun Nov 06 11:22:39 2022 +0100
+++ b/src/eric7/Plugins/VcsPlugins/vcsGit/git.py	Mon Nov 07 17:19:58 2022 +0100
@@ -12,6 +12,7 @@
 import pathlib
 import re
 import shutil
+import sys
 
 from PyQt6.QtCore import QProcess, pyqtSignal
 from PyQt6.QtWidgets import QApplication, QDialog, QInputDialog, QLineEdit
@@ -357,11 +358,11 @@
         @param commitAll flag indicating to commit all local changes (boolean)
         @param amend flag indicating to amend the HEAD commit (boolean)
         """
+        from .GitCommitDialog import GitCommitDialog
+
         if not noDialog:
             # call CommitDialog and get message from there
             if self.__commitDialog is None:
-                from .GitCommitDialog import GitCommitDialog
-
                 self.__commitDialog = GitCommitDialog(
                     self, message, amend, commitAll, self.__ui
                 )
@@ -713,6 +714,8 @@
         @param noDialog flag indicating quiet operations
         @return flag indicating successful operation (boolean)
         """
+        from .GitCopyDialog import GitCopyDialog
+
         isDir = os.path.isdir(name)
 
         res = False
@@ -722,8 +725,6 @@
             force = True
             accepted = True
         else:
-            from .GitCopyDialog import GitCopyDialog
-
             dlg = GitCopyDialog(name, None, True)
             accepted = dlg.exec() == QDialog.DialogCode.Accepted
             if accepted:
@@ -775,9 +776,9 @@
         @param isFile flag indicating log for a file is to be shown
             (boolean)
         """
+        from .GitLogBrowserDialog import GitLogBrowserDialog
+
         if self.logBrowser is None:
-            from .GitLogBrowserDialog import GitLogBrowserDialog
-
             self.logBrowser = GitLogBrowserDialog(self)
         self.logBrowser.show()
         self.logBrowser.raise_()
@@ -789,9 +790,9 @@
 
         @param projectDir name of the project directory (string)
         """
+        from .GitReflogBrowserDialog import GitReflogBrowserDialog
+
         if self.reflogBrowser is None:
-            from .GitReflogBrowserDialog import GitReflogBrowserDialog
-
             self.reflogBrowser = GitReflogBrowserDialog(self)
         self.reflogBrowser.show()
         self.reflogBrowser.raise_()
@@ -809,6 +810,8 @@
 
         @param name file/directory name to be diffed (string)
         """
+        from .GitDiffDialog import GitDiffDialog
+
         names = name[:] if isinstance(name, list) else [name]
         for nam in names:
             if os.path.isfile(nam):
@@ -820,8 +823,6 @@
                 if nam == project.ppath and not project.saveAllScripts():
                     return
         if self.diff is None:
-            from .GitDiffDialog import GitDiffDialog
-
             self.diff = GitDiffDialog(self)
         self.diff.show()
         self.diff.raise_()
@@ -836,9 +837,9 @@
         @param name file/directory name(s) to show the status of
             (string or list of strings)
         """
+        from .GitStatusDialog import GitStatusDialog
+
         if self.status is None:
-            from .GitStatusDialog import GitStatusDialog
-
             self.status = GitStatusDialog(self)
         self.status.show()
         self.status.raise_()
@@ -891,6 +892,8 @@
             or delete
         @rtype bool
         """
+        from eric7.UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
+
         args = self.initCommand("checkout")
         args.append("--")
         if isinstance(name, list):
@@ -912,10 +915,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"),
@@ -953,6 +952,8 @@
 
         @param name file/directory name to be merged (string)
         """
+        from .GitMergeDialog import GitMergeDialog
+
         dname, fname = self.splitPath(name)
 
         # find the root of the repo
@@ -962,8 +963,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
 
-        from .GitMergeDialog import GitMergeDialog
-
         dlg = GitMergeDialog(
             self.gitGetTagsList(repodir),
             self.gitGetBranchesList(repodir, withMaster=True),
@@ -1005,6 +1004,8 @@
         @return flag indicating, that the switch contained an add
             or delete (boolean)
         """
+        from .GitRevisionSelectionDialog import GitRevisionSelectionDialog
+
         dname, fname = self.splitPath(name)
 
         # find the root of the repo
@@ -1014,8 +1015,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return False
 
-        from .GitRevisionSelectionDialog import GitRevisionSelectionDialog
-
         dlg = GitRevisionSelectionDialog(
             self.gitGetTagsList(repodir),
             self.gitGetBranchesList(repodir),
@@ -1552,9 +1551,9 @@
         @param skiplist name of a skip list file
         @type str
         """
+        from .GitBlameDialog import GitBlameDialog
+
         if self.blame is None:
-            from .GitBlameDialog import GitBlameDialog
-
             self.blame = GitBlameDialog(self)
         self.blame.show()
         self.blame.raise_()
@@ -1574,6 +1573,9 @@
 
         @param name file/directory name to be diffed (string)
         """
+        from .GitDiffDialog import GitDiffDialog
+        from .GitRevisionsSelectionDialog import GitRevisionsSelectionDialog
+
         if isinstance(name, list):
             dname, fnames = self.splitPathList(name)
             names = name[:]
@@ -1597,16 +1599,12 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
 
-        from .GitRevisionsSelectionDialog import GitRevisionsSelectionDialog
-
         dlg = GitRevisionsSelectionDialog(
             self.gitGetTagsList(repodir), self.gitGetBranchesList(repodir)
         )
         if dlg.exec() == QDialog.DialogCode.Accepted:
             revisions = dlg.getRevisions()
             if self.diff is None:
-                from .GitDiffDialog import GitDiffDialog
-
                 self.diff = GitDiffDialog(self)
             self.diff.show()
             self.diff.raise_()
@@ -1675,6 +1673,10 @@
         @param revisions tuple of two revisions (tuple of strings)
         @exception ValueError raised to indicate an invalid name parameter
         """
+        from eric7.UI.CompareDialog import CompareDialog
+
+        from .GitRevisionsSelectionDialog import GitRevisionsSelectionDialog
+
         if isinstance(name, list):
             raise ValueError("Wrong parameter type")
 
@@ -1686,8 +1688,6 @@
                 if os.path.splitdrive(repodir)[1] == os.sep:
                     return
 
-            from .GitRevisionsSelectionDialog import GitRevisionsSelectionDialog
-
             dlg = GitRevisionsSelectionDialog(
                 self.gitGetTagsList(repodir), self.gitGetBranchesList(repodir)
             )
@@ -1733,8 +1733,6 @@
                 return
 
         if self.sbsDiff is None:
-            from eric7.UI.CompareDialog import CompareDialog
-
             self.sbsDiff = CompareDialog()
         self.sbsDiff.show()
         self.sbsDiff.raise_()
@@ -1746,6 +1744,8 @@
 
         @param name directory name (string)
         """
+        from .GitFetchDialog import GitFetchDialog
+
         # find the root of the repo
         repodir = self.splitPath(name)[0]
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -1753,8 +1753,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
 
-        from .GitFetchDialog import GitFetchDialog
-
         dlg = GitFetchDialog(self, repodir)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             (
@@ -1796,6 +1794,8 @@
         @return flag indicating, that the update contained an add
             or delete (boolean)
         """
+        from .GitPullDialog import GitPullDialog
+
         # find the root of the repo
         repodir = self.splitPath(name)[0]
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -1803,8 +1803,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return False
 
-        from .GitPullDialog import GitPullDialog
-
         dlg = GitPullDialog(self, repodir)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             remote, url, branches, pullAll, prune = dlg.getData()
@@ -1836,6 +1834,8 @@
 
         @param name directory name of the project to be pushed from (string)
         """
+        from .GitPushDialog import GitPushDialog
+
         # find the root of the repo
         repodir = self.splitPath(name)[0]
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -1843,8 +1843,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
 
-        from .GitPushDialog import GitPushDialog
-
         dlg = GitPushDialog(self, repodir)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             remote, refspecs, tags, tracking, submodule = dlg.getData()
@@ -1882,8 +1880,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
 
-        import sys
-
         editor = sys.argv[0].replace(".py", "_editor.py")
         env = {"GIT_EDITOR": "{0} {1}".format(Globals.getPythonExecutable(), editor)}
 
@@ -1959,6 +1955,8 @@
         @param projectDir directory name of the project (string)
         @param check flag indicating to perform a check operation (boolean)
         """
+        from .GitPatchFilesDialog import GitPatchFilesDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -1966,8 +1964,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
 
-        from .GitPatchFilesDialog import GitPatchFilesDialog
-
         dlg = GitPatchFilesDialog(repodir, self.__patchCheckData)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             patchFilesList, stripCount, inaccurateEof, recount = dlg.getData()
@@ -2005,9 +2001,9 @@
 
         @param projectDir directory name of the project (string)
         """
+        from .GitPatchStatisticsDialog import GitPatchStatisticsDialog
+
         if self.patchStatisticsDialog is None:
-            from .GitPatchStatisticsDialog import GitPatchStatisticsDialog
-
             self.patchStatisticsDialog = GitPatchStatisticsDialog(self)
         self.patchStatisticsDialog.show()
         self.patchStatisticsDialog.raise_()
@@ -2028,6 +2024,8 @@
         @param tagName name of the tag (string)
         @return flag indicating a performed tag action (boolean)
         """
+        from .GitTagDialog import GitTagDialog
+
         dname, fname = self.splitPath(name)
 
         # find the root of the repo
@@ -2037,8 +2035,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return False
 
-        from .GitTagDialog import GitTagDialog
-
         dlg = GitTagDialog(self.gitGetTagsList(repodir), revision, tagName)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             tag, revision, tagOp, tagType, force = dlg.getParameters()
@@ -2119,9 +2115,9 @@
         @param merged flag indicating to show only merged or non-merged
             branches (boolean)
         """
+        from .GitTagBranchListDialog import GitTagBranchListDialog
+
         if self.tagbranchList is None:
-            from .GitTagBranchListDialog import GitTagBranchListDialog
-
             self.tagbranchList = GitTagBranchListDialog(self)
         self.tagbranchList.show()
         self.tagbranchList.raise_()
@@ -2230,6 +2226,8 @@
             a flag indicating, that the branch operation contained an add
             or delete (boolean)
         """
+        from .GitBranchDialog import GitBranchDialog
+
         dname, fname = self.splitPath(name)
 
         # find the root of the repo
@@ -2239,8 +2237,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return False, False
 
-        from .GitBranchDialog import GitBranchDialog
-
         dlg = GitBranchDialog(
             self.gitGetBranchesList(repodir, allBranches=True),
             revision,
@@ -2334,6 +2330,8 @@
 
         @param name file/directory name (string)
         """
+        from .GitBranchPushDialog import GitBranchPushDialog
+
         dname, fname = self.splitPath(name)
 
         # find the root of the repo
@@ -2343,8 +2341,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
 
-        from .GitBranchPushDialog import GitBranchPushDialog
-
         dlg = GitBranchPushDialog(
             self.gitGetBranchesList(repodir),
             self.gitGetRemotesList(repodir),
@@ -2396,6 +2392,8 @@
 
         @param projectDir name of the project directory (string)
         """
+        from .GitBundleDialog import GitBundleDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -2403,8 +2401,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
 
-        from .GitBundleDialog import GitBundleDialog
-
         dlg = GitBundleDialog(
             self.gitGetTagsList(repodir), self.gitGetBranchesList(repodir)
         )
@@ -2557,6 +2553,8 @@
 
         @param projectDir name of the project directory (string)
         """
+        from .GitApplyBundleDataDialog import GitApplyBundleDataDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -2573,8 +2571,6 @@
         if fname:
             self.__lastBundlePath = os.path.dirname(fname)
 
-            from .GitApplyBundleDataDialog import GitApplyBundleDataDialog
-
             dlg = GitApplyBundleDataDialog(
                 self.gitGetBundleHeads(repodir, fname), self.gitGetBranchesList(repodir)
             )
@@ -2605,6 +2601,8 @@
         @return flag indicating, that the update contained an add
             or delete (boolean)
         """
+        from .GitApplyBundleDataDialog import GitApplyBundleDataDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -2622,8 +2620,6 @@
         if fname:
             self.__lastBundlePath = os.path.dirname(fname)
 
-            from .GitApplyBundleDataDialog import GitApplyBundleDataDialog
-
             dlg = GitApplyBundleDataDialog(
                 self.gitGetBundleHeads(repodir, fname), self.gitGetBranchesList(repodir)
             )
@@ -2662,6 +2658,9 @@
             or delete (boolean)
         @exception ValueError raised to indicate an invalid bisect subcommand
         """
+        from .GitBisectStartDialog import GitBisectStartDialog
+        from .GitRevisionSelectionDialog import GitRevisionSelectionDialog
+
         if subcommand not in (
             "start",
             "start_extended",
@@ -2686,8 +2685,6 @@
         if subcommand in ("good", "bad", "skip", "reset"):
             showBranches = subcommand == "reset"
             showHead = subcommand == "reset"
-            from .GitRevisionSelectionDialog import GitRevisionSelectionDialog
-
             dlg = GitRevisionSelectionDialog(
                 self.gitGetTagsList(repodir),
                 self.gitGetBranchesList(repodir),
@@ -2701,8 +2698,6 @@
 
         args = self.initCommand("bisect")
         if subcommand == "start_extended":
-            from .GitBisectStartDialog import GitBisectStartDialog
-
             dlg = GitBisectStartDialog()
             if dlg.exec() == QDialog.DialogCode.Accepted:
                 bad, good, noCheckout = dlg.getData()
@@ -2735,9 +2730,9 @@
 
         @param projectDir name of the project directory (string)
         """
+        from .GitBisectLogBrowserDialog import GitBisectLogBrowserDialog
+
         if self.bisectlogBrowser is None:
-            from .GitBisectLogBrowserDialog import GitBisectLogBrowserDialog
-
             self.bisectlogBrowser = GitBisectLogBrowserDialog(self)
         self.bisectlogBrowser.show()
         self.bisectlogBrowser.raise_()
@@ -3058,9 +3053,9 @@
 
         @param projectDir name of the project directory (string)
         """
+        from .GitRemoteRepositoriesDialog import GitRemoteRepositoriesDialog
+
         if self.remotesDialog is None:
-            from .GitRemoteRepositoriesDialog import GitRemoteRepositoriesDialog
-
             self.remotesDialog = GitRemoteRepositoriesDialog(self)
         self.remotesDialog.show()
         self.remotesDialog.raise_()
@@ -3072,6 +3067,8 @@
 
         @param projectDir name of the project directory (string)
         """
+        from .GitAddRemoteDialog import GitAddRemoteDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -3079,8 +3076,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
 
-        from .GitAddRemoteDialog import GitAddRemoteDialog
-
         dlg = GitAddRemoteDialog()
         if dlg.exec() == QDialog.DialogCode.Accepted:
             name, url = dlg.getData()
@@ -3130,6 +3125,8 @@
         @param remoteUrl URL of the remote repository
         @type str
         """
+        from .GitChangeRemoteUrlDialog import GitChangeRemoteUrlDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -3140,8 +3137,6 @@
         if not remoteUrl:
             remoteUrl = self.gitGetRemoteUrl(repodir, remoteName)
 
-        from .GitChangeRemoteUrlDialog import GitChangeRemoteUrlDialog
-
         dlg = GitChangeRemoteUrlDialog(remoteName, remoteUrl)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             name, url = dlg.getData()
@@ -3166,6 +3161,8 @@
         @param remoteUrl URL of the remote repository
         @type str
         """
+        from .GitRemoteCredentialsDialog import GitRemoteCredentialsDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -3176,8 +3173,6 @@
         if not remoteUrl:
             remoteUrl = self.gitGetRemoteUrl(repodir, remoteName)
 
-        from .GitRemoteCredentialsDialog import GitRemoteCredentialsDialog
-
         dlg = GitRemoteCredentialsDialog(remoteName, remoteUrl)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             name, url = dlg.getData()
@@ -3266,9 +3261,9 @@
         @param commits list of commits to start the search from
             (list of strings)
         """
+        from .GitDescribeDialog import GitDescribeDialog
+
         if self.describeDialog is None:
-            from .GitDescribeDialog import GitDescribeDialog
-
             self.describeDialog = GitDescribeDialog(self)
         self.describeDialog.show()
         self.describeDialog.raise_()
@@ -3287,6 +3282,8 @@
         @param commits list of commits to be applied (list of strings)
         @return flag indicating that the project should be reread (boolean)
         """
+        from .GitCherryPickDialog import GitCherryPickDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -3296,8 +3293,6 @@
 
         res = False
 
-        from .GitCherryPickDialog import GitCherryPickDialog
-
         dlg = GitCherryPickDialog(commits)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             commits, cherrypickInfo, signoff, nocommit = dlg.getData()
@@ -3335,8 +3330,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return False
 
-        import sys
-
         editor = sys.argv[0].replace(".py", "_editor.py")
         env = {"GIT_EDITOR": "{0} {1}".format(Globals.getPythonExecutable(), editor)}
 
@@ -3452,6 +3445,8 @@
         @return flag indicating, that the save contained an add
             or delete (boolean)
         """
+        from .GitStashDataDialog import GitStashDataDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -3460,8 +3455,6 @@
                 return False
 
         res = False
-        from .GitStashDataDialog import GitStashDataDialog
-
         dlg = GitStashDataDialog()
         if dlg.exec() == QDialog.DialogCode.Accepted:
             message, keepIndex, untracked = dlg.getData()
@@ -3490,9 +3483,9 @@
 
         @param projectDir name of the project directory (string)
         """
+        from .GitStashBrowserDialog import GitStashBrowserDialog
+
         if self.stashBrowser is None:
-            from .GitStashBrowserDialog import GitStashBrowserDialog
-
             self.stashBrowser = GitStashBrowserDialog(self)
         self.stashBrowser.show()
         self.stashBrowser.raise_()
@@ -3505,6 +3498,8 @@
         @param projectDir name of the project directory (string)
         @param stashName name of a stash (string)
         """
+        from .GitDiffDialog import GitDiffDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -3526,8 +3521,6 @@
                 return
 
         if self.diff is None:
-            from .GitDiffDialog import GitDiffDialog
-
             self.diff = GitDiffDialog(self)
         self.diff.show()
         self.diff.raise_()
@@ -3770,12 +3763,11 @@
         """
         Public method used to edit the user configuration file.
         """
+        from .GitUserConfigDataDialog import GitUserConfigDataDialog
         from .GitUtilities import getConfigPath
 
         cfgFile = getConfigPath()
         if not os.path.exists(cfgFile):
-            from .GitUserConfigDataDialog import GitUserConfigDataDialog
-
             dlg = GitUserConfigDataDialog()
             if dlg.exec() == QDialog.DialogCode.Accepted:
                 firstName, lastName, email = dlg.getData()
@@ -3984,6 +3976,8 @@
 
         @param projectDir name of the project directory (string)
         """
+        from .GitArchiveDataDialog import GitArchiveDataDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -3991,8 +3985,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
 
-        from .GitArchiveDataDialog import GitArchiveDataDialog
-
         dlg = GitArchiveDataDialog(
             self.gitGetTagsList(repodir),
             self.gitGetBranchesList(repodir, withMaster=True),
@@ -4026,6 +4018,8 @@
         @param projectDir name of the project directory
         @type str
         """
+        from .GitSubmoduleAddDialog import GitSubmoduleAddDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -4033,8 +4027,6 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
 
-        from .GitSubmoduleAddDialog import GitSubmoduleAddDialog
-
         dlg = GitSubmoduleAddDialog(self, repodir)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             repo, branch, name, path, force = dlg.getData()
@@ -4104,6 +4096,8 @@
         @param projectDir name of the project directory
         @type str
         """
+        from .GitSubmodulesListDialog import GitSubmodulesListDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -4113,8 +4107,6 @@
 
         submodulesList = self.__gitSubmodulesList(repodir)
         if submodulesList:
-            from .GitSubmodulesListDialog import GitSubmodulesListDialog
-
             dlg = GitSubmodulesListDialog(submodulesList)
             dlg.exec()
         else:
@@ -4159,10 +4151,10 @@
             a cancellation
         @rtype tuple of (list of str, bool)
         """
+        from .GitListDialog import GitListDialog
+
         paths = [submodule["path"] for submodule in self.__gitSubmodulesList(repodir)]
 
-        from .GitListDialog import GitListDialog
-
         dlg = GitListDialog(sorted(paths))
         if dlg.exec() == QDialog.DialogCode.Accepted:
             selectedPaths = dlg.getSelection()
@@ -4202,6 +4194,8 @@
         @param projectDir name of the project directory
         @type str
         """
+        from .GitSubmodulesDeinitDialog import GitSubmodulesDeinitDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -4211,8 +4205,6 @@
 
         paths = [submodule["path"] for submodule in self.__gitSubmodulesList(repodir)]
 
-        from .GitSubmodulesDeinitDialog import GitSubmodulesDeinitDialog
-
         dlg = GitSubmodulesDeinitDialog(paths)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             deinitAll, submodulePaths, force = dlg.getData()
@@ -4271,6 +4263,8 @@
         @param projectDir name of the project directory
         @type str
         """
+        from .GitSubmodulesUpdateOptionsDialog import GitSubmodulesUpdateOptionsDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -4280,8 +4274,6 @@
 
         paths = [submodule["path"] for submodule in self.__gitSubmodulesList(repodir)]
 
-        from .GitSubmodulesUpdateOptionsDialog import GitSubmodulesUpdateOptionsDialog
-
         dlg = GitSubmodulesUpdateOptionsDialog(paths)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             procedure, init, remote, noFetch, force, submodulePaths = dlg.getData()
@@ -4311,6 +4303,8 @@
         @param projectDir name of the project directory
         @type str
         """
+        from .GitSubmodulesSyncDialog import GitSubmodulesSyncDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -4320,8 +4314,6 @@
 
         paths = [submodule["path"] for submodule in self.__gitSubmodulesList(repodir)]
 
-        from .GitSubmodulesSyncDialog import GitSubmodulesSyncDialog
-
         dlg = GitSubmodulesSyncDialog(paths)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             submodulePaths, recursive = dlg.getData()
@@ -4343,9 +4335,9 @@
         @param projectDir name of the project directory
         @type str
         """
+        from .GitSubmodulesStatusDialog import GitSubmodulesStatusDialog
+
         if self.submoduleStatusDialog is None:
-            from .GitSubmodulesStatusDialog import GitSubmodulesStatusDialog
-
             self.submoduleStatusDialog = GitSubmodulesStatusDialog(self)
         self.submoduleStatusDialog.show()
         self.submoduleStatusDialog.raise_()
@@ -4358,6 +4350,8 @@
         @param projectDir name of the project directory
         @type str
         """
+        from .GitSubmodulesSummaryOptionsDialog import GitSubmodulesSummaryOptionsDialog
+
         # find the root of the repo
         repodir = projectDir
         while not os.path.isdir(os.path.join(repodir, self.adminDir)):
@@ -4367,8 +4361,6 @@
 
         paths = [submodule["path"] for submodule in self.__gitSubmodulesList(repodir)]
 
-        from .GitSubmodulesSummaryOptionsDialog import GitSubmodulesSummaryOptionsDialog
-
         dlg = GitSubmodulesSummaryOptionsDialog(paths)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             submodulePaths, superProject, index, commit, limit = dlg.getData()

eric ide

mercurial