# HG changeset patch # User Matt Mackall # Date 1365182498 18000 # Node ID 565482e2ac6b71125e74adf409939bf54bad274f # Parent 93b03a222c3ec65de309b38d2016cc51594e08e0# Parent 3cfaace0441e936826a4a0d4ae12d545f11a903d merge with crew diff -r 93b03a222c3e -r 565482e2ac6b contrib/perf.py --- a/contrib/perf.py Fri Apr 05 12:20:14 2013 -0500 +++ b/contrib/perf.py Fri Apr 05 12:21:38 2013 -0500 @@ -2,7 +2,7 @@ '''helper extension to measure performance''' from mercurial import cmdutil, scmutil, util, match, commands, obsolete -from mercurial import repoview, branchmap, merge +from mercurial import repoview, branchmap, merge, copies import time, os, sys cmdtable = {} @@ -158,6 +158,14 @@ acceptremote=True) timer(d) +@command('perfpathcopies', [], "REV REV") +def perfpathcopies(ui, repo, rev1, rev2): + ctx1 = scmutil.revsingle(repo, rev1, rev1) + ctx2 = scmutil.revsingle(repo, rev2, rev2) + def d(): + copies.pathcopies(ctx1, ctx2) + timer(d) + @command('perfmanifest') def perfmanifest(ui, repo): def d(): diff -r 93b03a222c3e -r 565482e2ac6b mercurial/copies.py --- a/mercurial/copies.py Fri Apr 05 12:20:14 2013 -0500 +++ b/mercurial/copies.py Fri Apr 05 12:21:38 2013 -0500 @@ -133,11 +133,13 @@ # we currently don't try to find where old files went, too expensive # this means we can miss a case like 'hg rm b; hg cp a b' cm = {} - for f in b: - if f not in a: - ofctx = _tracefile(b[f], a) - if ofctx: - cm[f] = ofctx.path() + missing = set(b.manifest().iterkeys()) + missing.difference_update(a.manifest().iterkeys()) + + for f in missing: + ofctx = _tracefile(b[f], a) + if ofctx: + cm[f] = ofctx.path() # combine copies from dirstate if necessary if w is not None: