Mercurial > hg-stable
changeset 14267:6332c02b3d68
check-code: complain about set.isdisjoint
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 08 May 2011 11:39:24 -0500 |
parents | e4ab5ae193f2 |
children | a55a0045704c |
files | contrib/check-code.py hgext/mq.py |
diffstat | 2 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/check-code.py Sun May 01 12:29:32 2011 +0200 +++ b/contrib/check-code.py Sun May 08 11:39:24 2011 -0500 @@ -139,6 +139,7 @@ (r'[\x80-\xff]', "non-ASCII character literal"), (r'("\')\.format\(', "str.format() not available in Python 2.4"), (r'^\s*with\s+', "with not available in Python 2.4"), + (r'\.isdisjoint\(', "set.isdisjoint not available in Python 2.4"), (r'^\s*except.* as .*:', "except as not available in Python 2.4"), (r'^\s*os\.path\.relpath', "relpath not available in Python 2.4"), (r'(?<!def)\s+(any|all|format)\(',
--- a/hgext/mq.py Sun May 01 12:29:32 2011 +0200 +++ b/hgext/mq.py Sun May 08 11:39:24 2011 -0500 @@ -1174,7 +1174,7 @@ for patchname in s: pf = os.path.join(self.path, patchname) patchfiles = patchmod.changedfiles(pf, strip=1) - if not wcfiles.isdisjoint(patchfiles): + if wcfiles.intersection(patchfiles): self.localchangesfound(self.applied) elif mergeq: self.check_localchanges(refresh=self.applied) @@ -1285,7 +1285,7 @@ if not force and parentfiles: mm, aa, rr, dd = repo.status()[:4] wcfiles = set(mm + aa + rr + dd) - if not wcfiles.isdisjoint(parentfiles): + if wcfiles.intersection(parentfiles): self.localchangesfound() if d: raise util.Abort(_("deletions found between repo revs"))