eric6/Plugins/VcsPlugins/vcsMercurial/RebaseExtension/ProjectHelper.py

Wed, 30 Dec 2020 11:00:44 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 11:00:44 +0100
branch
maintenance
changeset 7924
8a96736d465e
parent 7780
41420f82c0ac
child 7971
ff2971513d6d
permissions
-rw-r--r--

Updated copyright for 2021.

1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7924
8a96736d465e Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2011 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the rebase extension project helper.
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
10 from PyQt5.QtWidgets import QMenu
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 from E5Gui.E5Action import E5Action
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from E5Gui import E5MessageBox
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 from ..HgExtensionProjectHelper import HgExtensionProjectHelper
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 import UI.PixmapCache
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 class RebaseProjectHelper(HgExtensionProjectHelper):
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 Class implementing the rebase extension project helper.
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 """
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 def __init__(self):
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 Constructor
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
28 super(RebaseProjectHelper, self).__init__()
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 def initActions(self):
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 """
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 Public method to generate the action objects.
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 """
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
34 self.hgRebaseAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
35 self.tr('Rebase Changesets'),
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
36 UI.PixmapCache.getIcon("vcsRebase"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
37 self.tr('Rebase Changesets'),
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
38 0, 0, self, 'mercurial_rebase')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
39 self.hgRebaseAct.setStatusTip(self.tr(
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 'Rebase changesets to another branch'
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 ))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
42 self.hgRebaseAct.setWhatsThis(self.tr(
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 """<b>Rebase Changesets</b>"""
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 """<p>This rebases changesets to another branch.</p>"""
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
46 self.hgRebaseAct.triggered.connect(self.__hgRebase)
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 self.actions.append(self.hgRebaseAct)
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 self.hgRebaseContinueAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
50 self.tr('Continue Rebase Session'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
51 self.tr('Continue Rebase Session'),
3036
30c81c9e88b8 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
52 0, 0, self, 'mercurial_rebase_continue')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
53 self.hgRebaseContinueAct.setStatusTip(self.tr(
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 'Continue the last rebase session after repair'
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 ))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
56 self.hgRebaseContinueAct.setWhatsThis(self.tr(
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 """<b>Continue Rebase Session</b>"""
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 """<p>This continues the last rebase session after repair.</p>"""
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
60 self.hgRebaseContinueAct.triggered.connect(self.__hgRebaseContinue)
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 self.actions.append(self.hgRebaseContinueAct)
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 self.hgRebaseAbortAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
64 self.tr('Abort Rebase Session'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
65 self.tr('Abort Rebase Session'),
3036
30c81c9e88b8 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
66 0, 0, self, 'mercurial_rebase_abort')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
67 self.hgRebaseAbortAct.setStatusTip(self.tr(
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 'Abort the last rebase session'
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 ))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
70 self.hgRebaseAbortAct.setWhatsThis(self.tr(
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 """<b>Abort Rebase Session</b>"""
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 """<p>This aborts the last rebase session.</p>"""
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
74 self.hgRebaseAbortAct.triggered.connect(self.__hgRebaseAbort)
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 self.actions.append(self.hgRebaseAbortAct)
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 def initMenu(self, mainMenu):
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 """
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 Public method to generate the extension menu.
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 @param mainMenu reference to the main menu (QMenu)
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 @return populated menu (QMenu)
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 """
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 menu = QMenu(self.menuTitle(), mainMenu)
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
85 menu.setIcon(UI.PixmapCache.getIcon("vcsRebase"))
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 menu.setTearOffEnabled(True)
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 menu.addAction(self.hgRebaseAct)
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 menu.addAction(self.hgRebaseContinueAct)
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 menu.addAction(self.hgRebaseAbortAct)
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 return menu
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 def menuTitle(self):
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 """
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 Public method to get the menu title.
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 @return title of the menu (string)
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 """
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
100 return self.tr("Rebase")
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 def __hgRebase(self):
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 """
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 Private slot used to rebase changesets to another branch.
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 """
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
106 shouldReopen = self.vcs.getExtensionObject("rebase").hgRebase(
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
107 self.project.getProjectPath())
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 if shouldReopen:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
109 res = E5MessageBox.yesNo(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
110 None,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
111 self.tr("Rebase Changesets"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
112 self.tr("""The project should be reread. Do this now?"""),
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 yesDefault=True)
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 if res:
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 self.project.reopenProject()
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 def __hgRebaseContinue(self):
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 """
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 Private slot used to continue the last rebase session after repair.
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 """
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
121 shouldReopen = self.vcs.getExtensionObject("rebase").hgRebaseContinue(
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
122 self.project.getProjectPath())
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 if shouldReopen:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
124 res = E5MessageBox.yesNo(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
125 None,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
126 self.tr("Rebase Changesets (Continue)"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
127 self.tr("""The project should be reread. Do this now?"""),
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 yesDefault=True)
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 if res:
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 self.project.reopenProject()
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 def __hgRebaseAbort(self):
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 """
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 Private slot used to abort the last rebase session.
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 """
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
136 shouldReopen = self.vcs.getExtensionObject("rebase").hgRebaseAbort(
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
137 self.project.getProjectPath())
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 if shouldReopen:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
139 res = E5MessageBox.yesNo(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
140 None,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
141 self.tr("Rebase Changesets (Abort)"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
142 self.tr("""The project should be reread. Do this now?"""),
1093
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 yesDefault=True)
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 if res:
47bc4ef30315 Added support for the Mercurial rebase extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 self.project.reopenProject()

eric ide

mercurial