Mercurial > hg-stable
changeset 16428:9b26d541e972
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 14 Apr 2012 01:39:35 -0500 |
parents | d54d4de56aa7 (current diff) c3aedd526d53 (diff) |
children | 71dcce391a44 |
files | contrib/check-code.py hgext/mq.py |
diffstat | 2 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/check-code.py Fri Apr 13 11:01:07 2012 -0700 +++ b/contrib/check-code.py Sat Apr 14 01:39:35 2012 -0500 @@ -180,7 +180,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 Fri Apr 13 11:01:07 2012 -0700 +++ b/hgext/mq.py Sat Apr 14 01:39:35 2012 -0500 @@ -3315,7 +3315,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'))