mercurial/logcmdutil.py
changeset 41620 74f53d3bd685
parent 41619 035cae1d197f
child 41630 3d094bfaf885
--- a/mercurial/logcmdutil.py	Wed Feb 06 17:46:20 2019 -0800
+++ b/mercurial/logcmdutil.py	Wed Feb 06 22:52:49 2019 -0800
@@ -64,6 +64,7 @@
         relroot = pathutil.canonpath(repo.root, repo.getcwd(), root)
     else:
         relroot = ''
+    copysourcematch = None
     if relroot != '':
         # XXX relative roots currently don't work if the root is within a
         # subrepo
@@ -76,6 +77,7 @@
 
         relrootmatch = scmutil.match(ctx2, pats=[relroot], default='path')
         match = matchmod.intersectmatchers(match, relrootmatch)
+        copysourcematch = relrootmatch
 
     if stat:
         diffopts = diffopts.copy(context=0, noprefix=False)
@@ -84,7 +86,8 @@
             width = ui.termwidth() - graphwidth
 
     chunks = ctx2.diff(ctx1, match, changes, opts=diffopts, prefix=prefix,
-                       relroot=relroot, hunksfilterfn=hunksfilterfn)
+                       relroot=relroot, copysourcematch=copysourcematch,
+                       hunksfilterfn=hunksfilterfn)
 
     if fp is not None or ui.canwritewithoutlabels():
         out = fp or ui