10 import contextlib |
10 import contextlib |
11 import os |
11 import os |
12 |
12 |
13 from PyQt6.QtCore import QByteArray, QCoreApplication, QObject |
13 from PyQt6.QtCore import QByteArray, QCoreApplication, QObject |
14 |
14 |
15 from eric7 import Preferences, Utilities |
15 from eric7 import Preferences |
16 from eric7.EricWidgets.EricApplication import ericApp |
16 from eric7.EricWidgets.EricApplication import ericApp |
17 from eric7.Plugins.VcsPlugins.vcsMercurial.HgUtilities import ( |
17 from eric7.Plugins.VcsPlugins.vcsMercurial.HgUtilities import ( |
18 getConfigPath, |
18 getConfigPath, |
19 getHgExecutable, |
19 getHgExecutable, |
20 ) |
20 ) |
21 from eric7.Preferences.Shortcuts import readShortcuts |
21 from eric7.Preferences.Shortcuts import readShortcuts |
|
22 from eric7.SystemUtilities import FileSystemUtilities |
22 from eric7.UI import Info |
23 from eric7.UI import Info |
23 |
24 |
24 # Start-Of-Header |
25 # Start-Of-Header |
25 name = "Mercurial Plugin" |
26 name = "Mercurial Plugin" |
26 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
27 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
70 (string) and vcs display string (string) |
71 (string) and vcs display string (string) |
71 """ |
72 """ |
72 global pluginTypename |
73 global pluginTypename |
73 data = {} |
74 data = {} |
74 exe = getHgExecutable() |
75 exe = getHgExecutable() |
75 if Utilities.isinpath(exe): |
76 if FileSystemUtilities.isinpath(exe): |
76 data[".hg"] = (pluginTypename, displayString()) |
77 data[".hg"] = (pluginTypename, displayString()) |
77 data["_hg"] = (pluginTypename, displayString()) |
78 data["_hg"] = (pluginTypename, displayString()) |
78 return data |
79 return data |
79 |
80 |
80 |
81 |
83 Public function to get the display string. |
84 Public function to get the display string. |
84 |
85 |
85 @return display string (string) |
86 @return display string (string) |
86 """ |
87 """ |
87 exe = getHgExecutable() |
88 exe = getHgExecutable() |
88 if Utilities.isinpath(exe): |
89 if FileSystemUtilities.isinpath(exe): |
89 return QCoreApplication.translate("VcsMercurialPlugin", "Mercurial") |
90 return QCoreApplication.translate("VcsMercurialPlugin", "Mercurial") |
90 else: |
91 else: |
91 return "" |
92 return "" |
92 |
93 |
93 |
94 |