Mercurial > hg
changeset 24783:a7f8e3584ef3
diff: pass the diff matcher to the copy logic
This passes the existing diff matcher instance down to the copy logic so copy
tracing can be more efficient when possible and only trace copies for matching
files.
This only actually affects forwardcopies (i.e. Given A<-B<-C<-D, it works for
'hg diff -r B -r D foo.txt', but not for 'hg diff -r D -r B foo.txt') since
backward copies require walking all histories, and not just the individual
file's.
This reduces 'hg diff -r A -r B foo.txt' time from 15s to 1s when A and B have
80,000 files different.
author | Durham Goode <durham@fb.com> |
---|---|
date | Thu, 16 Apr 2015 11:31:48 -0700 |
parents | 4906dc0e038c |
children | 59406b8b1303 |
files | mercurial/patch.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/patch.py Thu Apr 16 11:29:30 2015 -0700 +++ b/mercurial/patch.py Thu Apr 16 11:31:48 2015 -0700 @@ -2127,7 +2127,7 @@ copy = {} if opts.git or opts.upgrade: - copy = copies.pathcopies(ctx1, ctx2) + copy = copies.pathcopies(ctx1, ctx2, match=match) if relroot is not None: if not relfiltered: