diff hgext/largefiles/overrides.py @ 36344:b9da10f310f4

largfiles: replace filter() with listcomp when result needs to be a list filter() is a generator on Python 3, but these cases are used as lists. Differential Revision: https://phab.mercurial-scm.org/D2339
author Augie Fackler <augie@google.com>
date Sun, 18 Feb 2018 14:28:31 -0500
parents 976e1cfb2f64
children 398e96f77aa3
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Sun Feb 18 14:25:03 2018 -0500
+++ b/hgext/largefiles/overrides.py	Sun Feb 18 14:28:31 2018 -0500
@@ -42,7 +42,7 @@
     matcher'''
     m = copy.copy(match)
     lfile = lambda f: lfutil.standin(f) in manifest
-    m._files = filter(lfile, m._files)
+    m._files = [lf for lf in m._files if lfile(lf)]
     m._fileset = set(m._files)
     m.always = lambda: False
     origmatchfn = m.matchfn
@@ -57,7 +57,7 @@
     m = copy.copy(match)
     notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in
             manifest or f in excluded)
-    m._files = filter(notlfile, m._files)
+    m._files = [lf for lf in m._files if notlfile(lf)]
     m._fileset = set(m._files)
     m.always = lambda: False
     origmatchfn = m.matchfn