Patchwork D2515: py3: listify the return value of filter()

login
register
mail settings
Submitter phabricator
Date March 1, 2018, 6:49 p.m.
Message ID <differential-rev-PHID-DREV-tjvs76s7gtcrimtxbfz7-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28568/
State Superseded
Headers show

Comments

phabricator - March 1, 2018, 6:49 p.m.
pulkit created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  filter() on Python 3 returns a filter object.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowchangegroup.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/narrow/narrowchangegroup.py b/hgext/narrow/narrowchangegroup.py
--- a/hgext/narrow/narrowchangegroup.py
+++ b/hgext/narrow/narrowchangegroup.py
@@ -44,7 +44,7 @@ 
                       source):
         matcher = _cgmatcher(self)
         if matcher:
-            changedfiles = filter(matcher, changedfiles)
+            changedfiles = list(filter(matcher, changedfiles))
         if getattr(self, 'is_shallow', False):
             # See comment in generate() for why this sadness is a thing.
             mfdicts = self._mfdicts