Changeset 59638a981e9f…
Parent 52799c003972…
by
Changes to one file · Browse files at 59638a981e9f Showing diff from parent 52799c003972 Diff from another changeset...
@@ -12,25 +12,6 @@ from tortoisehg.util.i18n import _ as gettext
from tortoisehg.util import cachethg, paths, hglib
-promoted = []
-try:
- from _winreg import HKEY_CURRENT_USER, OpenKey, QueryValueEx
- try:
- hkey = OpenKey(HKEY_CURRENT_USER, r"Software\TortoiseHg")
- pl = QueryValueEx(hkey, 'PromotedItems')[0]
- for item in pl.split(','):
- item = item.strip()
- if item: promoted.append(str(item))
- except EnvironmentError:
- promoted = ['commit', 'log']
-except ImportError:
- # fallback method for non-win32 platforms
- u = ui.ui()
- pl = u.config('tortoisehg', 'promoteditems', 'commit')
- for item in pl.split(','):
- item = item.strip()
- if item: promoted.append(str(item))
-
def _(msgid):
return {'id': msgid, 'str': gettext(msgid)}
@@ -171,10 +152,17 @@ self.ui = ui
self.name = name
self.sep = [False]
+ self.promoted = []
+ pl = self.ui.config('tortoisehg', 'promoteditems', 'commit')
+ for item in pl.split(','):
+ item = item.strip()
+ if item:
+ self.promoted.append(str(item))
+
def add_menu(self, hgcmd, icon=None, state=True):
- global promoted, thgcmenu
- if hgcmd in promoted:
+ global thgcmenu
+ if hgcmd in self.promoted:
pos = 0
else:
pos = 1
|
Loading...