changeset 15319:9da7e96cd5c2 stable

largefiles: remove redundant any_ function
author Benjamin Pollack <benjamin@bitquabit.com>
date Wed, 19 Oct 2011 20:40:55 -0400
parents acecb419e5b0
children 681267a5f491
files hgext/largefiles/basestore.py hgext/largefiles/lfutil.py hgext/largefiles/reposetup.py
diffstat 3 files changed, 4 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/basestore.py	Thu Oct 20 09:35:37 2011 -0500
+++ b/hgext/largefiles/basestore.py	Wed Oct 19 20:40:55 2011 -0400
@@ -121,7 +121,7 @@
             cctx = self.repo[rev]
             cset = "%d:%s" % (cctx.rev(), node.short(cctx.node()))
 
-            failed = lfutil.any_(self._verifyfile(
+            failed = util.any(self._verifyfile(
                 cctx, cset, contents, standin, verified) for standin in cctx)
 
         num_revs = len(verified)
--- a/hgext/largefiles/lfutil.py	Thu Oct 20 09:35:37 2011 -0500
+++ b/hgext/largefiles/lfutil.py	Wed Oct 19 20:40:55 2011 -0400
@@ -436,13 +436,7 @@
 
 def islfilesrepo(repo):
     return ('largefiles' in repo.requirements and
-            any_(shortname + '/' in f[0] for f in repo.store.datafiles()))
-
-def any_(gen):
-    for x in gen:
-        if x:
-            return True
-    return False
+            util.any(shortname + '/' in f[0] for f in repo.store.datafiles()))
 
 class storeprotonotcapable(BaseException):
     def __init__(self, storetypes):
--- a/hgext/largefiles/reposetup.py	Thu Oct 20 09:35:37 2011 -0500
+++ b/hgext/largefiles/reposetup.py	Wed Oct 19 20:40:55 2011 -0400
@@ -346,7 +346,7 @@
                         fstandin += os.sep
 
                     # prevalidate matching standin directories
-                    if lfutil.any_(st for st in match._files
+                    if util.any(st for st in match._files
                                    if st.startswith(fstandin)):
                         continue
                     actualfiles.append(f)
@@ -400,7 +400,7 @@
     repo.__class__ = lfiles_repo
 
     def checkrequireslfiles(ui, repo, **kwargs):
-        if 'largefiles' not in repo.requirements and lfutil.any_(
+        if 'largefiles' not in repo.requirements and util.any(
                 lfutil.shortname+'/' in f[0] for f in repo.store.datafiles()):
             repo.requirements.add('largefiles')
             repo._writerequirements()