Continued implementing the delayed import.

Sun, 10 Feb 2013 19:17:45 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 10 Feb 2013 19:17:45 +0100
changeset 2405
d4b5f3bd4720
parent 2404
cba0ff902c2b
child 2406
975af671146d

Continued implementing the delayed import.

Plugins/VcsPlugins/vcsMercurial/BookmarksExtension/bookmarks.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/ConfigurationPage/MercurialPage.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/FetchExtension/fetch.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/GpgExtension/gpg.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgClient.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgStatusDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgStatusMonitorThread.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/ProjectBrowserHelper.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/PurgeExtension/purge.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/RebaseExtension/rebase.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/TransplantExtension/transplant.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/hg.py file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsMercurial/BookmarksExtension/bookmarks.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/BookmarksExtension/bookmarks.py	Sun Feb 10 19:17:45 2013 +0100
@@ -15,11 +15,6 @@
 from ..HgExtension import HgExtension
 from ..HgDialog import HgDialog
 
-from .HgBookmarksListDialog import HgBookmarksListDialog
-from .HgBookmarkDialog import HgBookmarkDialog
-from .HgBookmarkRenameDialog import HgBookmarkRenameDialog
-from .HgBookmarksInOutDialog import HgBookmarksInOutDialog
-
 import Preferences
 
 
@@ -56,6 +51,7 @@
         """
         self.bookmarksList = []
         
+        from .HgBookmarksListDialog import HgBookmarksListDialog
         self.bookmarksListDlg = HgBookmarksListDialog(self.vcs)
         self.bookmarksListDlg.show()
         self.bookmarksListDlg.start(path, self.bookmarksList)
@@ -112,6 +108,7 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
         
+        from .HgBookmarkDialog import HgBookmarkDialog
         dlg = HgBookmarkDialog(HgBookmarkDialog.DEFINE_MODE,
                                self.vcs.hgGetTagsList(repodir),
                                self.vcs.hgGetBranchesList(repodir),
@@ -174,6 +171,7 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
         
+        from .HgBookmarkRenameDialog import HgBookmarkRenameDialog
         dlg = HgBookmarkRenameDialog(self.hgGetBookmarksList(repodir))
         if dlg.exec_() == QDialog.Accepted:
             newName, oldName = dlg.getData()
@@ -202,6 +200,7 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
         
+        from .HgBookmarkDialog import HgBookmarkDialog
         dlg = HgBookmarkDialog(HgBookmarkDialog.MOVE_MODE,
                                self.vcs.hgGetTagsList(repodir),
                                self.vcs.hgGetBranchesList(repodir),
@@ -228,6 +227,7 @@
         
         @param name file/directory name (string)
         """
+        from .HgBookmarksInOutDialog import HgBookmarksInOutDialog
         self.bookmarksInOutDlg = HgBookmarksInOutDialog(
             self.vcs, HgBookmarksInOutDialog.INCOMING)
         self.bookmarksInOutDlg.show()
@@ -239,6 +239,7 @@
         
         @param name file/directory name (string)
         """
+        from .HgBookmarksInOutDialog import HgBookmarksInOutDialog
         self.bookmarksInOutDlg = HgBookmarksInOutDialog(
             self.vcs, HgBookmarksInOutDialog.OUTGOING)
         self.bookmarksInOutDlg.show()
@@ -313,8 +314,9 @@
             args.append('--bookmark')
             args.append(bookmark)
             
-            dia = HgDialog(self.trUtf8('Pulling bookmark from a remote Mercurial repository'),
-                           self.vcs)
+            dia = HgDialog(self.trUtf8(
+                    'Pulling bookmark from a remote Mercurial repository'),
+                self.vcs)
             res = dia.startProcess(args, repodir)
             if res:
                 dia.exec_()
@@ -346,8 +348,9 @@
             args.append('--bookmark')
             args.append(bookmark)
             
-            dia = HgDialog(self.trUtf8('Pushing bookmark to a remote Mercurial repository'),
-                           self.vcs)
+            dia = HgDialog(self.trUtf8(
+                    'Pushing bookmark to a remote Mercurial repository'),
+                self.vcs)
             res = dia.startProcess(args, repodir)
             if res:
                 dia.exec_()
--- a/Plugins/VcsPlugins/vcsMercurial/ConfigurationPage/MercurialPage.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/ConfigurationPage/MercurialPage.py	Sun Feb 10 19:17:45 2013 +0100
@@ -11,8 +11,6 @@
 
 from PyQt4.QtCore import pyqtSlot
 
-from QScintilla.MiniEditor import MiniEditor
-
 from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase
 from .Ui_MercurialPage import Ui_MercurialPage
 
@@ -61,6 +59,7 @@
         """
         Private slot to edit the (per user) Mercurial configuration file.
         """
+        from QScintilla.MiniEditor import MiniEditor
         cfgFile = self.__plugin.getConfigPath()
         if not os.path.exists(cfgFile):
             try:
--- a/Plugins/VcsPlugins/vcsMercurial/FetchExtension/fetch.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/FetchExtension/fetch.py	Sun Feb 10 19:17:45 2013 +0100
@@ -14,8 +14,6 @@
 from ..HgExtension import HgExtension
 from ..HgDialog import HgDialog
 
-from .HgFetchDialog import HgFetchDialog
-
 
 class Fetch(HgExtension):
     """
@@ -43,6 +41,7 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return False
         
+        from .HgFetchDialog import HgFetchDialog
         res = False
         dlg = HgFetchDialog()
         if dlg.exec_() == QDialog.Accepted:
--- a/Plugins/VcsPlugins/vcsMercurial/GpgExtension/gpg.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/GpgExtension/gpg.py	Sun Feb 10 19:17:45 2013 +0100
@@ -15,9 +15,6 @@
 from ..HgDialog import HgDialog
 from ..HgRevisionSelectionDialog import HgRevisionSelectionDialog
 
-from .HgGpgSignaturesDialog import HgGpgSignaturesDialog
-from .HgGpgSignDialog import HgGpgSignDialog
-
 
 class Gpg(HgExtension):
     """
@@ -46,6 +43,7 @@
         
         @param path directory name of the project (string)
         """
+        from .HgGpgSignaturesDialog import HgGpgSignaturesDialog
         self.gpgSignaturesDialog = HgGpgSignaturesDialog(self.vcs)
         self.gpgSignaturesDialog.show()
         self.gpgSignaturesDialog.show()
@@ -107,6 +105,7 @@
                 self.vcs.getExtensionObject("bookmarks").hgGetBookmarksList(repodir)
         else:
             bookmarksList = None
+        from .HgGpgSignDialog import HgGpgSignDialog
         dlg = HgGpgSignDialog(self.vcs.hgGetTagsList(repodir),
                               self.vcs.hgGetBranchesList(repodir),
                               bookmarksList)
--- a/Plugins/VcsPlugins/vcsMercurial/HgClient.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgClient.py	Sun Feb 10 19:17:45 2013 +0100
@@ -14,8 +14,6 @@
     QCoreApplication, QThread
 from PyQt4.QtGui import QDialog
 
-from .HgClientPromptDialog import HgClientPromptDialog
-
 import Preferences
 
 
@@ -281,6 +279,7 @@
         @param size maximum length of the requested input (integer)
         @param message message sent by the server (string)
         """
+        from .HgClientPromptDialog import HgClientPromptDialog
         input = ""
         dlg = HgClientPromptDialog(size, message)
         if dlg.exec_() == QDialog.Accepted:
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sun Feb 10 19:17:45 2013 +0100
@@ -19,7 +19,6 @@
 from E5Gui import E5MessageBox
 
 from .Ui_HgLogBrowserDialog import Ui_HgLogBrowserDialog
-from .HgDiffDialog import HgDiffDialog
 
 import Preferences
 
@@ -939,6 +938,7 @@
         @param rev2 second revision number (integer)
         """
         if self.diff is None:
+            from .HgDiffDialog import HgDiffDialog
             self.diff = HgDiffDialog(self.vcs)
         self.diff.show()
         self.diff.start(self.filename, [rev1, rev2], self.bundle)
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py	Sun Feb 10 19:17:45 2013 +0100
@@ -17,7 +17,6 @@
 from E5Gui import E5MessageBox
 
 from .Ui_HgLogDialog import Ui_HgLogDialog
-from .HgDiffDialog import HgDiffDialog
 
 import Utilities
 import Preferences
@@ -443,6 +442,7 @@
         self.contents.scrollToAnchor(ver)
         
         if self.diff is None:
+            from .HgDiffDialog import HgDiffDialog
             self.diff = HgDiffDialog(self.vcs)
         self.diff.show()
         self.diff.start(filename, [v1, v2], self.bundle)
--- a/Plugins/VcsPlugins/vcsMercurial/HgStatusDialog.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgStatusDialog.py	Sun Feb 10 19:17:45 2013 +0100
@@ -16,8 +16,6 @@
 from E5Gui.E5Application import e5App
 from E5Gui import E5MessageBox
 
-from .HgDiffDialog import HgDiffDialog
-
 from .Ui_HgStatusDialog import Ui_HgStatusDialog
 
 import Preferences
@@ -667,6 +665,7 @@
             return
         
         if self.diff is None:
+            from .HgDiffDialog import HgDiffDialog
             self.diff = HgDiffDialog(self.vcs)
         self.diff.show()
         self.diff.start(names)
--- a/Plugins/VcsPlugins/vcsMercurial/HgStatusMonitorThread.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgStatusMonitorThread.py	Sun Feb 10 19:17:45 2013 +0100
@@ -10,7 +10,6 @@
 from PyQt4.QtCore import QProcess
 
 from VCS.StatusMonitorThread import VcsStatusMonitorThread
-from .HgClient import HgClient
 
 import Preferences
 
@@ -62,6 +61,7 @@
             if self.vcs.version >= (2, 9, 9):
                 # versions below that have a bug causing a second
                 # instance to not recognize changes to the status
+                from .HgClient import HgClient
                 client = HgClient(self.projectDir, "utf-8")
                 ok, err = client.startServer()
                 if ok:
--- a/Plugins/VcsPlugins/vcsMercurial/ProjectBrowserHelper.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/ProjectBrowserHelper.py	Sun Feb 10 19:17:45 2013 +0100
@@ -15,7 +15,6 @@
 
 from VCS.ProjectBrowserHelper import VcsProjectBrowserHelper
 
-from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
 import UI.PixmapCache
 
 
@@ -604,6 +603,7 @@
         Private slot called by the context menu to remove the selected file from the
         Mercurial repository leaving a copy in the project directory.
         """
+        from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
         if self.isTranslationsBrowser:
             items = self.browser.getSelectedItems([ProjectBrowserFileItem])
             names = [itm.fileName() for itm in items]
--- a/Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py	Sun Feb 10 19:17:45 2013 +0100
@@ -16,14 +16,6 @@
 
 from VCS.ProjectHelper import VcsProjectHelper
 
-from .BookmarksExtension.ProjectHelper import BookmarksProjectHelper
-from .QueuesExtension.ProjectHelper import QueuesProjectHelper
-from .FetchExtension.ProjectHelper import FetchProjectHelper
-from .PurgeExtension.ProjectHelper import PurgeProjectHelper
-from .GpgExtension.ProjectHelper import GpgProjectHelper
-from .TransplantExtension.ProjectHelper import TransplantProjectHelper
-from .RebaseExtension.ProjectHelper import RebaseProjectHelper
-
 from E5Gui.E5Action import E5Action
 
 import UI.PixmapCache
@@ -46,6 +38,13 @@
         VcsProjectHelper.__init__(self, vcsObject, projectObject, parent, name)
         
         # instantiate the extensions
+        from .BookmarksExtension.ProjectHelper import BookmarksProjectHelper
+        from .QueuesExtension.ProjectHelper import QueuesProjectHelper
+        from .FetchExtension.ProjectHelper import FetchProjectHelper
+        from .PurgeExtension.ProjectHelper import PurgeProjectHelper
+        from .GpgExtension.ProjectHelper import GpgProjectHelper
+        from .TransplantExtension.ProjectHelper import TransplantProjectHelper
+        from .RebaseExtension.ProjectHelper import RebaseProjectHelper
         self.__extensions = {
             "bookmarks": BookmarksProjectHelper(),
             "mq": QueuesProjectHelper(),
--- a/Plugins/VcsPlugins/vcsMercurial/PurgeExtension/purge.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/PurgeExtension/purge.py	Sun Feb 10 19:17:45 2013 +0100
@@ -15,10 +15,6 @@
 from ..HgExtension import HgExtension
 from ..HgDialog import HgDialog
 
-from .HgPurgeListDialog import HgPurgeListDialog
-
-from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
-
 import Preferences
 
 
@@ -102,6 +98,7 @@
             message = self.trUtf8("""Do really want to delete files not tracked by"""
                                   """ Mercurial?""")
         entries = self.__getEntries(repodir, all)
+        from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
         dlg = DeleteFilesConfirmationDialog(None, title, message, entries)
         if dlg.exec_() == QDialog.Accepted:
             args = []
@@ -130,5 +127,6 @@
                 return False
         
         entries = self.__getEntries(repodir, all)
+        from .HgPurgeListDialog import HgPurgeListDialog
         self.purgeListDialog = HgPurgeListDialog(entries)
         self.purgeListDialog.show()
--- a/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py	Sun Feb 10 19:17:45 2013 +0100
@@ -16,18 +16,6 @@
 
 from ..HgExtension import HgExtension
 from ..HgDialog import HgDialog
-from ..HgDiffDialog import HgDiffDialog
-
-from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog
-from .HgQueuesListDialog import HgQueuesListDialog
-from .HgQueuesRenamePatchDialog import HgQueuesRenamePatchDialog
-from .HgQueuesFoldDialog import HgQueuesFoldDialog
-from .HgQueuesHeaderDialog import HgQueuesHeaderDialog
-from .HgQueuesListGuardsDialog import HgQueuesListGuardsDialog
-from .HgQueuesListAllGuardsDialog import HgQueuesListAllGuardsDialog
-from .HgQueuesDefineGuardsDialog import HgQueuesDefineGuardsDialog
-from .HgQueuesGuardsSelectionDialog import HgQueuesGuardsSelectionDialog
-from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog
 
 import Preferences
 
@@ -249,6 +237,7 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
         
+        from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog
         dlg = HgQueuesNewPatchDialog(HgQueuesNewPatchDialog.NEW_MODE)
         if dlg.exec_() == QDialog.Accepted:
             name, message, (userData, currentUser, userName), \
@@ -299,6 +288,7 @@
         
         if editMessage:
             currentMessage = self.__getCommitMessage(repodir)
+            from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog
             dlg = HgQueuesNewPatchDialog(HgQueuesNewPatchDialog.REFRESH_MODE,
                                          currentMessage)
             if dlg.exec_() == QDialog.Accepted:
@@ -334,6 +324,7 @@
         
         @param name file/directory name (string)
         """
+        from ..HgDiffDialog import HgDiffDialog
         self.qdiffDialog = HgDiffDialog(self.vcs)
         self.qdiffDialog.show()
         QApplication.processEvents()
@@ -345,6 +336,7 @@
         
         @param name file/directory name (string)
         """
+        from .HgQueuesHeaderDialog import HgQueuesHeaderDialog
         self.qheaderDialog = HgQueuesHeaderDialog(self.vcs)
         self.qheaderDialog.show()
         QApplication.processEvents()
@@ -423,6 +415,7 @@
         
         @param name file/directory name (string)
         """
+        from .HgQueuesListDialog import HgQueuesListDialog
         self.queuesListDialog = HgQueuesListDialog(self.vcs)
         self.queuesListDialog.show()
         self.queuesListDialog.start(name)
@@ -469,6 +462,7 @@
         if patchnames:
             currentPatch = self.__getCurrentPatch(repodir)
             if currentPatch:
+                from .HgQueuesRenamePatchDialog import HgQueuesRenamePatchDialog
                 dlg = HgQueuesRenamePatchDialog(currentPatch, patchnames)
                 if dlg.exec_() == QDialog.Accepted:
                     newName, selectedPatch = dlg.getData()
@@ -534,6 +528,7 @@
         patchnames = sorted(
             self.__getPatchesList(repodir, Queues.UNAPPLIED_LIST, withSummary=True))
         if patchnames:
+            from .HgQueuesFoldDialog import HgQueuesFoldDialog
             dlg = HgQueuesFoldDialog(patchnames)
             if dlg.exec_() == QDialog.Accepted:
                 message, patchesList = dlg.getData()
@@ -572,6 +567,7 @@
         patchnames = sorted(
             self.__getPatchesList(repodir, Queues.SERIES_LIST))
         if patchnames:
+            from .HgQueuesListGuardsDialog import HgQueuesListGuardsDialog
             self.queuesListGuardsDialog = HgQueuesListGuardsDialog(self.vcs, patchnames)
             self.queuesListGuardsDialog.show()
             self.queuesListGuardsDialog.start(name)
@@ -586,6 +582,7 @@
         
         @param name file/directory name (string)
         """
+        from .HgQueuesListAllGuardsDialog import HgQueuesListAllGuardsDialog
         self.queuesListAllGuardsDialog = HgQueuesListAllGuardsDialog(self.vcs)
         self.queuesListAllGuardsDialog.show()
         self.queuesListAllGuardsDialog.start(name)
@@ -606,6 +603,7 @@
         patchnames = sorted(
             self.__getPatchesList(repodir, Queues.SERIES_LIST))
         if patchnames:
+            from .HgQueuesDefineGuardsDialog import HgQueuesDefineGuardsDialog
             self.queuesDefineGuardsDialog = HgQueuesDefineGuardsDialog(
                 self.vcs, self, patchnames)
             self.queuesDefineGuardsDialog.show()
@@ -676,6 +674,7 @@
         guardsList = self.getGuardsList(repodir)
         if guardsList:
             activeGuardsList = self.getGuardsList(repodir, all=False)
+            from .HgQueuesGuardsSelectionDialog import HgQueuesGuardsSelectionDialog
             dlg = HgQueuesGuardsSelectionDialog(
                 guardsList, activeGuards=activeGuardsList, listOnly=False)
             if dlg.exec_() == QDialog.Accepted:
@@ -732,6 +731,7 @@
         
         guardsList = self.getGuardsList(repodir, all=False)
         if guardsList:
+            from .HgQueuesGuardsSelectionDialog import HgQueuesGuardsSelectionDialog
             dlg = HgQueuesGuardsSelectionDialog(guardsList, listOnly=True)
             dlg.exec_()
     
@@ -753,6 +753,7 @@
             title = self.trUtf8("Create New Queue")
         else:
             title = self.trUtf8("Rename Active Queue")
+        from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog
         dlg = HgQueuesQueueManagementDialog(HgQueuesQueueManagementDialog.NAME_INPUT,
             title, False, repodir, self.vcs)
         if dlg.exec_() == QDialog.Accepted:
@@ -824,6 +825,7 @@
         else:
             raise ValueError("illegal value for operation")
         
+        from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog
         dlg = HgQueuesQueueManagementDialog(HgQueuesQueueManagementDialog.QUEUE_INPUT,
             title, True, repodir, self.vcs)
         if dlg.exec_() == QDialog.Accepted:
@@ -884,6 +886,7 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
         
+        from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog
         self.queuesListQueuesDialog = HgQueuesQueueManagementDialog(
             HgQueuesQueueManagementDialog.NO_INPUT,
             self.trUtf8("Available Queues"),
--- a/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/rebase.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/rebase.py	Sun Feb 10 19:17:45 2013 +0100
@@ -14,8 +14,6 @@
 from ..HgExtension import HgExtension
 from ..HgDialog import HgDialog
 
-from .HgRebaseDialog import HgRebaseDialog
-
 
 class Rebase(HgExtension):
     """
@@ -49,6 +47,7 @@
                 self.vcs.getExtensionObject("bookmarks").hgGetBookmarksList(repodir)
         else:
             bookmarksList = None
+        from .HgRebaseDialog import HgRebaseDialog
         dlg = HgRebaseDialog(self.vcs.hgGetTagsList(repodir),
                              self.vcs.hgGetBranchesList(repodir),
                              bookmarksList)
--- a/Plugins/VcsPlugins/vcsMercurial/TransplantExtension/transplant.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/TransplantExtension/transplant.py	Sun Feb 10 19:17:45 2013 +0100
@@ -14,8 +14,6 @@
 from ..HgExtension import HgExtension
 from ..HgDialog import HgDialog
 
-from .TransplantDialog import TransplantDialog
-
 
 class Transplant(HgExtension):
     """
@@ -43,6 +41,7 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return False
         
+        from .TransplantDialog import TransplantDialog
         res = False
         dlg = TransplantDialog(self.vcs.hgGetBranchesList(repodir))
         if dlg.exec_() == QDialog.Accepted:
--- a/Plugins/VcsPlugins/vcsMercurial/hg.py	Sun Feb 10 18:53:47 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/hg.py	Sun Feb 10 19:17:45 2013 +0100
@@ -26,46 +26,6 @@
 from VCS.RepositoryInfoDialog import VcsRepositoryInfoDialog
 
 from .HgDialog import HgDialog
-from .HgCommitDialog import HgCommitDialog
-from .HgOptionsDialog import HgOptionsDialog
-from .HgNewProjectOptionsDialog import HgNewProjectOptionsDialog
-from .HgCopyDialog import HgCopyDialog
-from .HgLogDialog import HgLogDialog
-from .HgLogBrowserDialog import HgLogBrowserDialog
-from .HgDiffDialog import HgDiffDialog
-from .HgRevisionsSelectionDialog import HgRevisionsSelectionDialog
-from .HgRevisionSelectionDialog import HgRevisionSelectionDialog
-from .HgMultiRevisionSelectionDialog import HgMultiRevisionSelectionDialog
-from .HgMergeDialog import HgMergeDialog
-from .HgStatusMonitorThread import HgStatusMonitorThread
-from .HgStatusDialog import HgStatusDialog
-from .HgAnnotateDialog import HgAnnotateDialog
-from .HgTagDialog import HgTagDialog
-from .HgTagBranchListDialog import HgTagBranchListDialog
-from .HgCommandDialog import HgCommandDialog
-from .HgBundleDialog import HgBundleDialog
-from .HgBackoutDialog import HgBackoutDialog
-from .HgServeDialog import HgServeDialog
-from .HgUtilities import getConfigPath
-from .HgClient import HgClient
-from .HgImportDialog import HgImportDialog
-from .HgExportDialog import HgExportDialog
-from .HgPhaseDialog import HgPhaseDialog
-from .HgGraftDialog import HgGraftDialog
-from .HgAddSubrepositoryDialog import HgAddSubrepositoryDialog
-from .HgRemoveSubrepositoriesDialog import HgRemoveSubrepositoriesDialog
-
-from .BookmarksExtension.bookmarks import Bookmarks
-from .QueuesExtension.queues import Queues
-from .FetchExtension.fetch import Fetch
-from .PurgeExtension.purge import Purge
-from .GpgExtension.gpg import Gpg
-from .TransplantExtension.transplant import Transplant
-from .RebaseExtension.rebase import Rebase
-
-from .ProjectBrowserHelper import HgProjectBrowserHelper
-
-from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
 
 import Preferences
 import Utilities
@@ -151,6 +111,7 @@
         
         self.__activeExtensions = []
         
+        from .HgUtilities import getConfigPath
         self.__iniWatcher = QFileSystemWatcher(self)
         self.__iniWatcher.fileChanged.connect(self.__iniFileChanged)
         cfgFile = getConfigPath()
@@ -160,6 +121,13 @@
         self.__client = None
         
         # instantiate the extensions
+        from .BookmarksExtension.bookmarks import Bookmarks
+        from .QueuesExtension.queues import Queues
+        from .FetchExtension.fetch import Fetch
+        from .PurgeExtension.purge import Purge
+        from .GpgExtension.gpg import Gpg
+        from .TransplantExtension.transplant import Transplant
+        from .RebaseExtension.rebase import Rebase
         self.__extensions = {
             "bookmarks": Bookmarks(self),
             "mq": Queues(self),
@@ -410,6 +378,7 @@
         if not noDialog and not msg:
             # call CommitDialog and get message from there
             if self.__commitDialog is None:
+                from .HgCommitDialog import HgCommitDialog
                 self.__commitDialog = HgCommitDialog(self, self.__ui)
                 self.__commitDialog.accepted.connect(self.__vcsCommit_Step2)
             self.__commitDialog.show()
@@ -721,6 +690,7 @@
             force = True
             accepted = True
         else:
+            from .HgCopyDialog import HgCopyDialog
             dlg = HgCopyDialog(name, None, True, force)
             accepted = dlg.exec_() == QDialog.Accepted
             if accepted:
@@ -792,6 +762,7 @@
         else:
             bookmarksList = None
         
+        from .HgMultiRevisionSelectionDialog import HgMultiRevisionSelectionDialog
         dlg = HgMultiRevisionSelectionDialog(
                 self.hgGetTagsList(repodir),
                 self.hgGetBranchesList(repodir),
@@ -801,6 +772,7 @@
                 limitDefault=self.getPlugin().getPreferences("LogLimit"))
         if dlg.exec_() == QDialog.Accepted:
             revs, noEntries = dlg.getRevisions()
+            from .HgLogDialog import HgLogDialog
             self.log = HgLogDialog(self)
             self.log.show()
             self.log.start(name, noEntries=noEntries, revisions=revs)
@@ -829,6 +801,7 @@
                 project = e5App().getObject("Project")
                 if nam == project.ppath and not project.saveAllScripts():
                     return
+        from .HgDiffDialog import HgDiffDialog
         self.diff = HgDiffDialog(self)
         self.diff.show()
         QApplication.processEvents()
@@ -842,6 +815,7 @@
         @param name file/directory name(s) to show the status of
             (string or list of strings)
         """
+        from .HgStatusDialog import HgStatusDialog
         self.status = HgStatusDialog(self)
         self.status.show()
         self.status.start(name)
@@ -861,6 +835,7 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
         
+        from .HgTagDialog import HgTagDialog
         dlg = HgTagDialog(self.hgGetTagsList(repodir))
         if dlg.exec_() == QDialog.Accepted:
             tag, tagOp = dlg.getParameters()
@@ -919,6 +894,7 @@
         project = e5App().getObject("Project")
         names = [project.getRelativePath(nam) for nam in names]
         if names[0]:
+            from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
             dlg = DeleteFilesConfirmationDialog(self.parent(),
                 self.trUtf8("Revert changes"),
                 self.trUtf8("Do you really want to revert all changes to these files"
@@ -967,6 +943,7 @@
                 self.getExtensionObject("bookmarks").hgGetBookmarksList(repodir)
         else:
             bookmarksList = None
+        from .HgMergeDialog import HgMergeDialog
         dlg = HgMergeDialog(force, self.hgGetTagsList(repodir),
                             self.hgGetBranchesList(repodir),
                             bookmarksList)
@@ -1012,6 +989,7 @@
                 self.getExtensionObject("bookmarks").hgGetBookmarksList(repodir)
         else:
             bookmarksList = None
+        from .HgRevisionSelectionDialog import HgRevisionSelectionDialog
         dlg = HgRevisionSelectionDialog(self.hgGetTagsList(repodir),
                                         self.hgGetBranchesList(repodir),
                                         bookmarksList)
@@ -1216,6 +1194,7 @@
         
         @param name directory name of the working directory (string)
         """
+        from .HgCommandDialog import HgCommandDialog
         dlg = HgCommandDialog(self.commandHistory, name)
         if dlg.exec_() == QDialog.Accepted:
             command = dlg.getData()
@@ -1251,6 +1230,7 @@
         @param editable flag indicating that the project name is editable (boolean)
         @param parent parent widget (QWidget)
         """
+        from .HgOptionsDialog import HgOptionsDialog
         return HgOptionsDialog(self, project, parent)
     
     def vcsNewProjectOptionsDialog(self, parent=None):
@@ -1259,6 +1239,7 @@
         
         @param parent parent widget (QWidget)
         """
+        from .HgNewProjectOptionsDialog import HgNewProjectOptionsDialog
         return HgNewProjectOptionsDialog(self, parent)
     
     def vcsRepositoryInfos(self, ppath):
@@ -1407,6 +1388,7 @@
         @param project reference to the project object
         @return flag indicating successful operation (boolean)
         """
+        from .HgCopyDialog import HgCopyDialog
         dlg = HgCopyDialog(name)
         res = False
         if dlg.exec_() == QDialog.Accepted:
@@ -1533,6 +1515,7 @@
         @param tags flag indicating listing of branches or tags
                 (False = branches, True = tags)
         """
+        from .HgTagBranchListDialog import HgTagBranchListDialog
         self.tagbranchList = HgTagBranchListDialog(self)
         self.tagbranchList.show()
         if tags:
@@ -1560,6 +1543,7 @@
         
         @param name file name to show the annotations for (string)
         """
+        from .HgAnnotateDialog import HgAnnotateDialog
         self.annotate = HgAnnotateDialog(self)
         self.annotate.show()
         self.annotate.start(name)
@@ -1605,11 +1589,13 @@
                 self.getExtensionObject("bookmarks").hgGetBookmarksList(repodir)
         else:
             bookmarksList = None
+        from .HgRevisionsSelectionDialog import HgRevisionsSelectionDialog
         dlg = HgRevisionsSelectionDialog(self.hgGetTagsList(repodir),
                                          self.hgGetBranchesList(repodir),
                                          bookmarksList)
         if dlg.exec_() == QDialog.Accepted:
             revisions = dlg.getRevisions()
+            from .HgDiffDialog import HgDiffDialog
             self.diff = HgDiffDialog(self)
             self.diff.show()
             self.diff.start(name, revisions)
@@ -1621,6 +1607,7 @@
         
         @param path file/directory name to show the log of (string)
         """
+        from .HgLogBrowserDialog import HgLogBrowserDialog
         self.logBrowser = HgLogBrowserDialog(self)
         self.logBrowser.show()
         self.logBrowser.start(path)
@@ -1633,10 +1620,12 @@
         @param name file/directory name to show the log of (string)
         """
         if self.getPlugin().getPreferences("UseLogBrowser"):
+            from .HgLogBrowserDialog import HgLogBrowserDialog
             self.logBrowser = HgLogBrowserDialog(self, mode="incoming")
             self.logBrowser.show()
             self.logBrowser.start(name)
         else:
+            from .HgLogDialog import HgLogDialog
             self.log = HgLogDialog(self, mode="incoming")
             self.log.show()
             self.log.start(name)
@@ -1649,10 +1638,12 @@
         @param name file/directory name to show the log of (string)
         """
         if self.getPlugin().getPreferences("UseLogBrowser"):
+            from .HgLogBrowserDialog import HgLogBrowserDialog
             self.logBrowser = HgLogBrowserDialog(self, mode="outgoing")
             self.logBrowser.show()
             self.logBrowser.start(name)
         else:
+            from .HgLogDialog import HgLogDialog
             self.log = HgLogDialog(self, mode="outgoing")
             self.log.show()
             self.log.start(name)
@@ -1909,6 +1900,7 @@
         """
         Public method used to edit the user configuration file.
         """
+        from .HgUtilities import getConfigPath
         cfgFile = getConfigPath()
         if not os.path.exists(cfgFile):
             try:
@@ -2139,6 +2131,7 @@
                 self.getExtensionObject("bookmarks").hgGetBookmarksList(repodir)
         else:
             bookmarksList = None
+        from .HgBundleDialog import HgBundleDialog
         dlg = HgBundleDialog(self.hgGetTagsList(repodir),
                              self.hgGetBranchesList(repodir),
                              bookmarksList)
@@ -2215,11 +2208,13 @@
             self.trUtf8("Mercurial Changegroup Files (*.hg);;All Files (*)"))
         if file:
             if self.getPlugin().getPreferences("UseLogBrowser"):
+                from .HgLogBrowserDialog import HgLogBrowserDialog
                 self.logBrowser = \
                     HgLogBrowserDialog(self, mode="incoming", bundle=file)
                 self.logBrowser.show()
                 self.logBrowser.start(name)
             else:
+                from .HgLogDialog import HgLogDialog
                 self.log = HgLogDialog(self, mode="incoming", bundle=file)
                 self.log.show()
                 self.log.start(name)
@@ -2326,6 +2321,7 @@
                     self.getExtensionObject("bookmarks").hgGetBookmarksList(repodir)
             else:
                 bookmarksList = None
+            from .HgRevisionSelectionDialog import HgRevisionSelectionDialog
             dlg = HgRevisionSelectionDialog(self.hgGetTagsList(repodir),
                                             self.hgGetBranchesList(repodir),
                                             bookmarksList,
@@ -2403,6 +2399,7 @@
                 self.getExtensionObject("bookmarks").hgGetBookmarksList(repodir)
         else:
             bookmarksList = None
+        from .HgBackoutDialog import HgBackoutDialog
         dlg = HgBackoutDialog(self.hgGetTagsList(repodir),
                               self.hgGetBranchesList(repodir),
                               bookmarksList)
@@ -2474,6 +2471,7 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
         
+        from .HgServeDialog import HgServeDialog
         self.serveDlg = HgServeDialog(self, repodir)
         self.serveDlg.show()
     
@@ -2494,6 +2492,7 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
         
+        from .HgImportDialog import HgImportDialog
         dlg = HgImportDialog()
         if dlg.exec_() == QDialog.Accepted:
             patchFile, noCommit, message, date, user, stripCount, force = \
@@ -2547,6 +2546,7 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return
         
+        from .HgExportDialog import HgExportDialog
         dlg = HgExportDialog()
         if dlg.exec_() == QDialog.Accepted:
             filePattern, revisions, switchParent, allText, noDates, git = \
@@ -2592,6 +2592,7 @@
                 return False
         
         if data is None:
+            from .HgPhaseDialog import HgPhaseDialog
             dlg = HgPhaseDialog()
             if dlg.exec_() == QDialog.Accepted:
                 data = dlg.getData()
@@ -2638,6 +2639,7 @@
             if os.path.splitdrive(repodir)[1] == os.sep:
                 return False
         
+        from .HgGraftDialog import HgGraftDialog
         res = False
         dlg = HgGraftDialog(self)
         if dlg.exec_() == QDialog.Accepted:
@@ -2727,6 +2729,7 @@
         """
         Public method to add a sub-repository.
         """
+        from .HgAddSubrepositoryDialog import HgAddSubrepositoryDialog
         ppath = self.__projectHelper.getProject().getProjectPath()
         hgsub = self.getHgSubPath()
         dlg = HgAddSubrepositoryDialog(ppath)
@@ -2809,6 +2812,7 @@
                             .format(str(err)))
             return
         
+        from .HgRemoveSubrepositoriesDialog import HgRemoveSubrepositoriesDialog
         dlg = HgRemoveSubrepositoriesDialog(subrepositories)
         if dlg.exec_() == QDialog.Accepted:
             subrepositories, removedSubrepos, deleteSubrepos = dlg.getData()
@@ -2947,6 +2951,7 @@
             translations browser (this needs some special treatment)
         @return the project browser helper object
         """
+        from .ProjectBrowserHelper import HgProjectBrowserHelper
         return HgProjectBrowserHelper(self, browser, project, isTranslationsBrowser)
         
     def vcsGetProjectHelper(self, project):
@@ -2969,6 +2974,7 @@
                     repodir = ""
                     break
             if repodir:
+                from .HgClient import HgClient
                 client = HgClient(repodir, "utf-8", self)
                 ok, err = client.startServer()
                 if ok:
@@ -2993,4 +2999,5 @@
         @param interval check interval for the monitor thread in seconds (integer)
         @return reference to the monitor thread (QThread)
         """
+        from .HgStatusMonitorThread import HgStatusMonitorThread
         return HgStatusMonitorThread(interval, project, self)

eric ide

mercurial