--- a/contrib/check-code.py Sun Apr 08 11:14:56 2012 +0200
+++ b/contrib/check-code.py Fri Apr 13 15:07:13 2012 +0200
@@ -177,7 +177,7 @@
"comparison with singleton, use 'is' or 'is not' instead"),
(r'^\s*(while|if) [01]:',
"use True/False for constant Boolean expression"),
- (r'(?<!def)\s+hasattr',
+ (r'(?:(?<!def)\s+|\()hasattr',
'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
(r'opener\([^)]*\).read\(',
"use opener.read() instead"),
--- a/hgext/mq.py Sun Apr 08 11:14:56 2012 +0200
+++ b/hgext/mq.py Fri Apr 13 15:07:13 2012 +0200
@@ -3308,7 +3308,7 @@
repo._phasedefaults.append(mqphasedefaults)
def mqimport(orig, ui, repo, *args, **kwargs):
- if (hasattr(repo, 'abortifwdirpatched')
+ if (util.safehasattr(repo, 'abortifwdirpatched')
and not kwargs.get('no_commit', False)):
repo.abortifwdirpatched(_('cannot import over an applied patch'),
kwargs.get('force'))