10 import os |
10 import os |
11 import contextlib |
11 import contextlib |
12 |
12 |
13 from PyQt6.QtCore import QObject, QCoreApplication, QByteArray |
13 from PyQt6.QtCore import QObject, QCoreApplication, QByteArray |
14 |
14 |
15 from EricWidgets.EricApplication import ericApp |
15 from eric7.EricWidgets.EricApplication import ericApp |
16 |
16 |
17 import Preferences |
17 from eric7 import Preferences, Utilities |
18 from Preferences.Shortcuts import readShortcuts |
18 |
19 |
19 from eric7.Preferences.Shortcuts import readShortcuts |
20 from VcsPlugins.vcsMercurial.HgUtilities import getConfigPath, getHgExecutable |
20 |
21 |
21 from eric7.Plugins.VcsPlugins.vcsMercurial.HgUtilities import ( |
22 import Utilities |
22 getConfigPath, |
23 import UI.Info |
23 getHgExecutable, |
|
24 ) |
|
25 |
|
26 from eric7.UI import Info |
24 |
27 |
25 # Start-Of-Header |
28 # Start-Of-Header |
26 name = "Mercurial Plugin" |
29 name = "Mercurial Plugin" |
27 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
30 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
28 autoactivate = False |
31 autoactivate = False |
29 deactivateable = True |
32 deactivateable = True |
30 version = UI.Info.VersionOnly |
33 version = Info.VersionOnly |
31 pluginType = "version_control" |
34 pluginType = "version_control" |
32 pluginTypename = "Mercurial" |
35 pluginTypename = "Mercurial" |
33 className = "VcsMercurialPlugin" |
36 className = "VcsMercurialPlugin" |
34 packageName = "__core__" |
37 packageName = "__core__" |
35 shortDescription = "Implements the Mercurial version control interface." |
38 shortDescription = "Implements the Mercurial version control interface." |
101 |
104 |
102 @param configDlg reference to the configuration dialog (QDialog) |
105 @param configDlg reference to the configuration dialog (QDialog) |
103 @return reference to the configuration page |
106 @return reference to the configuration page |
104 """ |
107 """ |
105 global mercurialCfgPluginObject |
108 global mercurialCfgPluginObject |
106 from VcsPlugins.vcsMercurial.ConfigurationPage.MercurialPage import MercurialPage |
109 from eric7.Plugins.VcsPlugins.vcsMercurial.ConfigurationPage.MercurialPage import ( |
|
110 MercurialPage, |
|
111 ) |
107 |
112 |
108 if mercurialCfgPluginObject is None: |
113 if mercurialCfgPluginObject is None: |
109 mercurialCfgPluginObject = VcsMercurialPlugin(None) |
114 mercurialCfgPluginObject = VcsMercurialPlugin(None) |
110 page = MercurialPage(mercurialCfgPluginObject) |
115 page = MercurialPage(mercurialCfgPluginObject) |
111 return page |
116 return page |
188 @param ui reference to the user interface object (UI.UserInterface) |
193 @param ui reference to the user interface object (UI.UserInterface) |
189 """ |
194 """ |
190 super().__init__(ui) |
195 super().__init__(ui) |
191 self.__ui = ui |
196 self.__ui = ui |
192 |
197 |
193 from VcsPlugins.vcsMercurial.ProjectHelper import HgProjectHelper |
198 from eric7.Plugins.VcsPlugins.vcsMercurial.ProjectHelper import HgProjectHelper |
194 |
199 |
195 self.__projectHelperObject = HgProjectHelper(None, None) |
200 self.__projectHelperObject = HgProjectHelper(None, None) |
196 with contextlib.suppress(KeyError): |
201 with contextlib.suppress(KeyError): |
197 ericApp().registerPluginObject( |
202 ericApp().registerPluginObject( |
198 pluginTypename, self.__projectHelperObject, pluginType |
203 pluginTypename, self.__projectHelperObject, pluginType |
223 Public method to activate this plugin. |
228 Public method to activate this plugin. |
224 |
229 |
225 @return tuple of reference to instantiated viewmanager and |
230 @return tuple of reference to instantiated viewmanager and |
226 activation status (boolean) |
231 activation status (boolean) |
227 """ |
232 """ |
228 from VcsPlugins.vcsMercurial.hg import Hg |
233 from eric7.Plugins.VcsPlugins.vcsMercurial.hg import Hg |
229 |
234 |
230 self.__object = Hg(self, self.__ui) |
235 self.__object = Hg(self, self.__ui) |
231 |
236 |
232 tb = self.__ui.getToolbar("vcs")[1] |
237 tb = self.__ui.getToolbar("vcs")[1] |
233 tb.setVisible(False) |
238 tb.setVisible(False) |