Patchwork D2339: largfiles: replace filter() with listcomp when result needs to be a list

login
register
mail settings
Submitter phabricator
Date Feb. 19, 2018, 2:06 a.m.
Message ID <8c0afd5aeea75ae422cdc8aaf319a2e8@localhost.localdomain>
Download mbox | patch
Permalink /patch/28138/
State Not Applicable
Headers show

Comments

phabricator - Feb. 19, 2018, 2:06 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa74243227aec: largfiles: replace filter() with listcomp when result needs to be a list (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2339?vs=5896&id=5907

REVISION DETAIL
  https://phab.mercurial-scm.org/D2339

AFFECTED FILES
  hgext/largefiles/lfcommands.py
  hgext/largefiles/overrides.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -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
diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py
+++ b/hgext/largefiles/lfcommands.py
@@ -365,7 +365,7 @@ 
     at = 0
     ui.debug("sending statlfile command for %d largefiles\n" % len(files))
     retval = store.exists(files)
-    files = filter(lambda h: not retval[h], files)
+    files = [h for h in files if not retval[h]]
     ui.debug("%d largefiles need to be uploaded\n" % len(files))
 
     for hash in files: