src/eric7/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py	Sun Nov 06 11:22:39 2022 +0100
+++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py	Mon Nov 07 17:19:58 2022 +0100
@@ -216,12 +216,12 @@
         @param editMessage flag indicating to edit the current
             commit message (boolean)
         """
+        from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog
+
         args = self.vcs.initCommand("qrefresh")
 
         if editMessage:
             currentMessage = self.__getCommitMessage()
-            from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog
-
             dlg = HgQueuesNewPatchDialog(
                 HgQueuesNewPatchDialog.REFRESH_MODE, currentMessage
             )
@@ -373,13 +373,13 @@
         """
         Public method to rename the current or a selected patch.
         """
+        from .HgQueuesRenamePatchDialog import HgQueuesRenamePatchDialog
+
         args = self.vcs.initCommand("qrename")
         patchnames = sorted(self.__getPatchesList(Queues.SERIES_LIST))
         if patchnames:
             currentPatch = self.__getCurrentPatch()
             if currentPatch:
-                from .HgQueuesRenamePatchDialog import HgQueuesRenamePatchDialog
-
                 dlg = HgQueuesRenamePatchDialog(currentPatch, patchnames)
                 if dlg.exec() == QDialog.DialogCode.Accepted:
                     newName, selectedPatch = dlg.getData()
@@ -423,13 +423,13 @@
         """
         Public method to fold patches into the current patch.
         """
+        from .HgQueuesFoldDialog import HgQueuesFoldDialog
+
         args = self.vcs.initCommand("qfold")
         patchnames = sorted(
             self.__getPatchesList(Queues.UNAPPLIED_LIST, withSummary=True)
         )
         if patchnames:
-            from .HgQueuesFoldDialog import HgQueuesFoldDialog
-
             dlg = HgQueuesFoldDialog(patchnames)
             if dlg.exec() == QDialog.DialogCode.Accepted:
                 message, patchesList = dlg.getData()
@@ -460,10 +460,10 @@
         """
         Public method to list the guards for the current or a named patch.
         """
+        from .HgQueuesListGuardsDialog import HgQueuesListGuardsDialog
+
         patchnames = sorted(self.__getPatchesList(Queues.SERIES_LIST))
         if patchnames:
-            from .HgQueuesListGuardsDialog import HgQueuesListGuardsDialog
-
             self.queuesListGuardsDialog = HgQueuesListGuardsDialog(self.vcs, patchnames)
             self.queuesListGuardsDialog.show()
             self.queuesListGuardsDialog.start()
@@ -488,10 +488,10 @@
         """
         Public method to define guards for the current or a named patch.
         """
+        from .HgQueuesDefineGuardsDialog import HgQueuesDefineGuardsDialog
+
         patchnames = sorted(self.__getPatchesList(Queues.SERIES_LIST))
         if patchnames:
-            from .HgQueuesDefineGuardsDialog import HgQueuesDefineGuardsDialog
-
             self.queuesDefineGuardsDialog = HgQueuesDefineGuardsDialog(
                 self.vcs, self, patchnames
             )
@@ -540,11 +540,11 @@
         """
         Public method to set the active guards.
         """
+        from .HgQueuesGuardsSelectionDialog import HgQueuesGuardsSelectionDialog
+
         guardsList = self.getGuardsList()
         if guardsList:
             activeGuardsList = self.getGuardsList(allGuards=False)
-            from .HgQueuesGuardsSelectionDialog import HgQueuesGuardsSelectionDialog
-
             dlg = HgQueuesGuardsSelectionDialog(
                 guardsList, activeGuards=activeGuardsList, listOnly=False
             )
@@ -582,10 +582,10 @@
         """
         Public method to list all active guards.
         """
+        from .HgQueuesGuardsSelectionDialog import HgQueuesGuardsSelectionDialog
+
         guardsList = self.getGuardsList(allGuards=False)
         if guardsList:
-            from .HgQueuesGuardsSelectionDialog import HgQueuesGuardsSelectionDialog
-
             dlg = HgQueuesGuardsSelectionDialog(guardsList, listOnly=True)
             dlg.exec()
 
@@ -640,6 +640,8 @@
             Queues.QUEUE_PURGE, Queues.QUEUE_ACTIVATE)
         @exception ValueError raised to indicate an invalid operation
         """
+        from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog
+
         if operation not in (
             Queues.QUEUE_PURGE,
             Queues.QUEUE_DELETE,
@@ -654,8 +656,6 @@
         else:
             title = self.tr("Activate Queue")
 
-        from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog
-
         dlg = HgQueuesQueueManagementDialog(
             HgQueuesQueueManagementDialog.QUEUE_INPUT, title, True, self.vcs
         )

eric ide

mercurial