##// END OF EJS Templates
mq: replace hasattr() with util.safehasattr(), update check-code.py
Patrick Mezard -
r16416:c3aedd52 stable
parent child Browse files
Show More
@@ -177,7 +177,7 b' pypats = ['
177 "comparison with singleton, use 'is' or 'is not' instead"),
177 "comparison with singleton, use 'is' or 'is not' instead"),
178 (r'^\s*(while|if) [01]:',
178 (r'^\s*(while|if) [01]:',
179 "use True/False for constant Boolean expression"),
179 "use True/False for constant Boolean expression"),
180 (r'(?<!def)\s+hasattr',
180 (r'(?:(?<!def)\s+|\()hasattr',
181 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
181 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
182 (r'opener\([^)]*\).read\(',
182 (r'opener\([^)]*\).read\(',
183 "use opener.read() instead"),
183 "use opener.read() instead"),
@@ -3308,7 +3308,7 b' def reposetup(ui, repo):'
3308 repo._phasedefaults.append(mqphasedefaults)
3308 repo._phasedefaults.append(mqphasedefaults)
3309
3309
3310 def mqimport(orig, ui, repo, *args, **kwargs):
3310 def mqimport(orig, ui, repo, *args, **kwargs):
3311 if (hasattr(repo, 'abortifwdirpatched')
3311 if (util.safehasattr(repo, 'abortifwdirpatched')
3312 and not kwargs.get('no_commit', False)):
3312 and not kwargs.get('no_commit', False)):
3313 repo.abortifwdirpatched(_('cannot import over an applied patch'),
3313 repo.abortifwdirpatched(_('cannot import over an applied patch'),
3314 kwargs.get('force'))
3314 kwargs.get('force'))
General Comments 0
You need to be logged in to leave comments. Login now