comparison hgext/narrow/narrowcopies.py @ 36345:f85e32a5e5c8

narrow: use list comprehension instead of filter for filtering lists filter() returns a generator on Python 3, which causes these filters to break things. Differential Revision: https://phab.mercurial-scm.org/D2363
author Augie Fackler <augie@google.com>
date Wed, 21 Feb 2018 10:08:35 -0500
parents a2a6e724d61a
children d0d5eef57fb0
comparison
equal deleted inserted replaced
36344:a65502597d8d 36345:f85e32a5e5c8
17 def setup(repo): 17 def setup(repo):
18 def _computeforwardmissing(orig, a, b, match=None): 18 def _computeforwardmissing(orig, a, b, match=None):
19 missing = orig(a, b, match) 19 missing = orig(a, b, match)
20 if util.safehasattr(repo, 'narrowmatch'): 20 if util.safehasattr(repo, 'narrowmatch'):
21 narrowmatch = repo.narrowmatch() 21 narrowmatch = repo.narrowmatch()
22 missing = filter(narrowmatch, missing) 22 missing = [f for f in missing if narrowmatch(f)]
23 return missing 23 return missing
24 24
25 def _checkcopies(orig, srcctx, dstctx, f, base, tca, remotebase, limit, 25 def _checkcopies(orig, srcctx, dstctx, f, base, tca, remotebase, limit,
26 data): 26 data):
27 if util.safehasattr(repo, 'narrowmatch'): 27 if util.safehasattr(repo, 'narrowmatch'):