Patchwork D1910: obsutil: work around filter() being a generator in Python 3

login
register
mail settings
Submitter phabricator
Date Jan. 18, 2018, 6:17 p.m.
Message ID <differential-rev-PHID-DREV-qvw5kszg26xgfless7sl-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26918/
State Superseded
Headers show

Comments

phabricator - Jan. 18, 2018, 6:17 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/obsutil.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 1, 2018, 11:32 p.m.
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  Writing this as a generator expression /might/ be a bit better. But I don't think perf is an issue here.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -421,10 +421,10 @@ 
 
         # Check if other meta has changed
         changeextra = changectx.extra().items()
-        ctxmeta = filter(metanotblacklisted, changeextra)
+        ctxmeta = list(filter(metanotblacklisted, changeextra))
 
         sourceextra = source.extra().items()
-        srcmeta = filter(metanotblacklisted, sourceextra)
+        srcmeta = list(filter(metanotblacklisted, sourceextra))
 
         if ctxmeta != srcmeta:
             effects |= METACHANGED