status: pass matcher to pathcopies()
Just like a7f8e3584ef3 (diff: pass the diff matcher to the copy logic,
2015-04-16) sped up 'hg diff --git $path', let's speed up 'hg st -C
$path'. On the Firefox repo, this speeds up
hg st --rev tip~40000 --rev tip -C python
from 16s to 1.8s. Those two revisions differ in 100k files, out of
which 1k is in python/.
--- a/mercurial/commands.py Sat Apr 18 15:27:03 2015 +0900
+++ b/mercurial/commands.py Sun Apr 19 21:43:53 2015 -0700
@@ -5837,14 +5837,15 @@
else:
show = states[:5]
- stat = repo.status(node1, node2, scmutil.match(repo[node2], pats, opts),
+ m = scmutil.match(repo[node2], pats, opts)
+ stat = repo.status(node1, node2, m,
'ignored' in show, 'clean' in show, 'unknown' in show,
opts.get('subrepos'))
changestates = zip(states, 'MAR!?IC', stat)
if (opts.get('all') or opts.get('copies')
or ui.configbool('ui', 'statuscopies')) and not opts.get('no_status'):
- copy = copies.pathcopies(repo[node1], repo[node2])
+ copy = copies.pathcopies(repo[node1], repo[node2], m)
fm = ui.formatter('status', opts)
fmt = '%s' + end