mercurial/copies.py
changeset 33867 252fb66ee5bb
parent 33822 42ad7cc645a4
child 33879 169baf3d1d3c
--- a/mercurial/copies.py	Tue Aug 22 11:00:00 2017 +0200
+++ b/mercurial/copies.py	Sat Aug 19 11:23:33 2017 +0900
@@ -10,6 +10,7 @@
 import heapq
 
 from . import (
+    match as matchmod,
     node,
     pathutil,
     scmutil,
@@ -182,8 +183,9 @@
     # optimization, since the ctx.files() for a merge commit is not correct for
     # this comparison.
     forwardmissingmatch = match
-    if not match and b.p1() == a and b.p2().node() == node.nullid:
-        forwardmissingmatch = scmutil.matchfiles(a._repo, b.files())
+    if b.p1() == a and b.p2().node() == node.nullid:
+        filesmatcher = scmutil.matchfiles(a._repo, b.files())
+        forwardmissingmatch = matchmod.intersectmatchers(match, filesmatcher)
     missing = _computeforwardmissing(a, b, match=forwardmissingmatch)
 
     ancestrycontext = a._repo.changelog.ancestors([b.rev()], inclusive=True)