src/eric7/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/shelve.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
diff -r 0b936ff1bbb9 -r a2bc06a54d9d src/eric7/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/shelve.py
--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/shelve.py	Sun Nov 06 11:22:39 2022 +0100
+++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/shelve.py	Mon Nov 07 17:19:58 2022 +0100
@@ -10,6 +10,7 @@
 from PyQt6.QtWidgets import QDialog
 
 from eric7.EricWidgets import EricMessageBox
+from eric7.UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
 
 from ..HgDialog import HgDialog
 from ..HgExtension import HgExtension
@@ -66,9 +67,9 @@
             or file names (list of string)
         @return flag indicating that the project should be reread (boolean)
         """
-        res = False
         from .HgShelveDataDialog import HgShelveDataDialog
 
+        res = False
         dlg = HgShelveDataDialog(self.vcs.version)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             shelveName, dateTime, message, addRemove, keep = dlg.getData()
@@ -106,9 +107,9 @@
         """
         Public method to show the shelve browser dialog.
         """
+        from .HgShelveBrowserDialog import HgShelveBrowserDialog
+
         if self.__shelveBrowserDialog is None:
-            from .HgShelveBrowserDialog import HgShelveBrowserDialog
-
             self.__shelveBrowserDialog = HgShelveBrowserDialog(self.vcs)
         self.__shelveBrowserDialog.show()
         self.__shelveBrowserDialog.start()
@@ -120,9 +121,9 @@
         @param shelveName name of the shelve to restore (string)
         @return flag indicating that the project should be reread (boolean)
         """
-        res = False
         from .HgUnshelveDataDialog import HgUnshelveDataDialog
 
+        res = False
         dlg = HgUnshelveDataDialog(self.__hgGetShelveNamesList(), shelveName=shelveName)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             shelveName, keep = dlg.getData()
@@ -184,9 +185,9 @@
 
         @param shelveNames name of shelves to delete (list of string)
         """
+        from .HgShelvesSelectionDialog import HgShelvesSelectionDialog
+
         if not shelveNames:
-            from .HgShelvesSelectionDialog import HgShelvesSelectionDialog
-
             dlg = HgShelvesSelectionDialog(
                 self.tr("Select the shelves to be deleted:"),
                 self.__hgGetShelveNamesList(),
@@ -196,8 +197,6 @@
             else:
                 return
 
-        from eric7.UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
-
         dlg = DeleteFilesConfirmationDialog(
             None,
             self.tr("Delete shelves"),

eric ide

mercurial