##// END OF EJS Templates
#44 Handling pre-2.9.1 mercurials in demandimport activity test
Marcin Kasperski -
r137:a1eefca2 default
parent child Browse files
Show More
@@ -74,9 +74,16 b' for blocked_module in ['
74 if blocked_module not in demandimport.ignore:
74 if blocked_module not in demandimport.ignore:
75 demandimport.ignore.append(blocked_module)
75 demandimport.ignore.append(blocked_module)
76
76
77 try:
78 is_demandimport_enabled = demandimport.isenabled
79 except AttributeError:
80 # Mercurial < 2.9.1
81 def is_demandimport_enabled():
82 return __import__ == demandimport.demandimport
83
77 # Temporarily disable demandimport to make the need of extending
84 # Temporarily disable demandimport to make the need of extending
78 # the list above less likely.
85 # the list above less likely.
79 if demandimport.isenabled():
86 if is_demandimport_enabled():
80 demandimport.disable()
87 demandimport.disable()
81 try:
88 try:
82 import keyring
89 import keyring
@@ -145,7 +152,7 b' class PasswordStore(object):'
145 # keyring in general expects unicode. Mercurial provides "local" encoding. See #33
152 # keyring in general expects unicode. Mercurial provides "local" encoding. See #33
146 password = encoding.fromlocal(password).decode('utf-8')
153 password = encoding.fromlocal(password).decode('utf-8')
147 keyring.set_password(KEYRING_SERVICE,
154 keyring.set_password(KEYRING_SERVICE,
148 pwdkey,
155 pwdkey,
149 password)
156 password)
150
157
151 password_store = PasswordStore()
158 password_store = PasswordStore()
General Comments 0
You need to be logged in to leave comments. Login now