Comments
Patch
@@ -685,8 +685,8 @@
# the base and present in the source.
# Presence in the base is important to exclude added files, presence in the
# source is important to exclude removed files.
- missingfiles = filter(lambda f: f not in m1 and f in base and f in c2,
- changedfiles)
+ filt = lambda f: f not in m1 and f in base and f in c2
+ missingfiles = [f for f in changedfiles if filt(f)]
if missingfiles:
basenametofilename = collections.defaultdict(list)
@@ -1831,7 +1831,7 @@
else:
self.revs.discard(value)
ctx = change(value)
- matches = filter(match, ctx.files())
+ matches = [f for f in ctx.files() if match(f)]
if matches:
fncache[value] = matches
self.set.add(value)
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY These two uses of filter() are then checked for truthiness, but on Python 3: >>> bool(filter(None, [])) True So we need to stop depending on that. Fortunately it's easy to replace the filter with an equivalent list comprehension. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2364 AFFECTED FILES mercurial/cmdutil.py mercurial/copies.py CHANGE DETAILS To: durin42, #hg-reviewers Cc: mercurial-devel