Mercurial > public > mercurial-scm > hg-stable
diff mercurial/patch.py @ 25149:3f0744eeaeaf
cleanup: use __builtins__.any instead of util.any
any() is available in all Python versions we support now.
author | Augie Fackler <augie@google.com> |
---|---|
date | Sat, 16 May 2015 14:30:07 -0400 |
parents | 0d6b64fbb5ba |
children | c1f5ef76d1c2 |
line wrap: on
line diff
--- a/mercurial/patch.py Sat May 16 14:31:03 2015 -0400 +++ b/mercurial/patch.py Sat May 16 14:30:07 2015 -0400 @@ -830,7 +830,7 @@ self.hunks = [] def binary(self): - return util.any(h.startswith('index ') for h in self.header) + return any(h.startswith('index ') for h in self.header) def pretty(self, fp): for h in self.header: @@ -853,7 +853,7 @@ fp.write(''.join(self.header)) def allhunks(self): - return util.any(self.allhunks_re.match(h) for h in self.header) + return any(self.allhunks_re.match(h) for h in self.header) def files(self): match = self.diffgit_re.match(self.header[0]) @@ -872,7 +872,7 @@ return '<header %s>' % (' '.join(map(repr, self.files()))) def isnewfile(self): - return util.any(self.newfile_re.match(h) for h in self.header) + return any(self.newfile_re.match(h) for h in self.header) def special(self): # Special files are shown only at the header level and not at the hunk @@ -885,7 +885,7 @@ nocontent = len(self.header) == 2 emptynewfile = self.isnewfile() and nocontent return emptynewfile or \ - util.any(self.special_re.match(h) for h in self.header) + any(self.special_re.match(h) for h in self.header) class recordhunk(object): """patch hunk