Mercurial > hg
comparison contrib/perf.py @ 40743:415735bfcf2b
perf: stop creating new revlog by hand in perftags
It's better to let the repository logic create its own object. We now just clear
the cache. New object will be automatically created from there.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Sun, 25 Nov 2018 13:37:53 +0100 |
parents | 30d878cb102d |
children | 594e84a2e574 |
comparison
equal
deleted
inserted
replaced
40742:8edca70dc951 | 40743:415735bfcf2b |
---|---|
538 timer(d) | 538 timer(d) |
539 fm.end() | 539 fm.end() |
540 | 540 |
541 @command(b'perftags', formatteropts) | 541 @command(b'perftags', formatteropts) |
542 def perftags(ui, repo, **opts): | 542 def perftags(ui, repo, **opts): |
543 import mercurial.changelog | 543 opts = _byteskwargs(opts) |
544 import mercurial.manifest | 544 timer, fm = gettimer(ui, opts) |
545 | |
546 opts = _byteskwargs(opts) | |
547 timer, fm = gettimer(ui, opts) | |
548 svfs = getsvfs(repo) | |
549 repocleartagscache = repocleartagscachefunc(repo) | 545 repocleartagscache = repocleartagscachefunc(repo) |
550 def s(): | 546 def s(): |
551 repo.changelog = mercurial.changelog.changelog(svfs) | 547 clearchangelog(repo) |
552 rootmanifest = mercurial.manifest.manifestrevlog(svfs) | 548 clearfilecache(repo.unfiltered(), 'manifest') |
553 repo.manifestlog = mercurial.manifest.manifestlog(svfs, repo, | |
554 rootmanifest) | |
555 repocleartagscache() | 549 repocleartagscache() |
556 def t(): | 550 def t(): |
557 return len(repo.tags()) | 551 return len(repo.tags()) |
558 timer(t, setup=s) | 552 timer(t, setup=s) |
559 fm.end() | 553 fm.end() |