##// END OF EJS Templates
narrow: use list comprehension instead of filter for filtering lists...
Augie Fackler -
r36363:f85e32a5 default
parent child Browse files
Show More
@@ -52,7 +52,7 b' def setup():'
52 getattr(self, '_narrow_matcher', None))
52 getattr(self, '_narrow_matcher', None))
53 if matcher is not None:
53 if matcher is not None:
54 narrowmatch = matcher()
54 narrowmatch = matcher()
55 changedfiles = filter(narrowmatch, changedfiles)
55 changedfiles = [f for f in changedfiles if narrowmatch(f)]
56 if getattr(self, 'is_shallow', False):
56 if getattr(self, 'is_shallow', False):
57 # See comment in generate() for why this sadness is a thing.
57 # See comment in generate() for why this sadness is a thing.
58 mfdicts = self._mfdicts
58 mfdicts = self._mfdicts
@@ -19,7 +19,7 b' def setup(repo):'
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,
@@ -31,9 +31,9 b' def setup(repo):'
31 copy, getfilectx, *args, **kwargs):
31 copy, getfilectx, *args, **kwargs):
32 if util.safehasattr(repo, 'narrowmatch'):
32 if util.safehasattr(repo, 'narrowmatch'):
33 narrowmatch = repo.narrowmatch()
33 narrowmatch = repo.narrowmatch()
34 modified = filter(narrowmatch, modified)
34 modified = [f for f in modified if narrowmatch(f)]
35 added = filter(narrowmatch, added)
35 added = [f for f in added if narrowmatch(f)]
36 removed = filter(narrowmatch, removed)
36 removed = [f for f in removed if narrowmatch(f)]
37 copy = {k: v for k, v in copy.iteritems() if narrowmatch(k)}
37 copy = {k: v for k, v in copy.iteritems() if narrowmatch(k)}
38 return orig(repo, revs, ctx1, ctx2, modified, added, removed, copy,
38 return orig(repo, revs, ctx1, ctx2, modified, added, removed, copy,
39 getfilectx, *args, **kwargs)
39 getfilectx, *args, **kwargs)
General Comments 0
You need to be logged in to leave comments. Login now