perf: stop creating new revlog by hand in perftags
authorBoris Feld <boris.feld@octobus.net>
Sun, 25 Nov 2018 13:37:53 +0100
changeset 40743 415735bfcf2b
parent 40742 8edca70dc951
child 40744 594e84a2e574
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.
contrib/perf.py
--- a/contrib/perf.py	Mon Nov 26 00:23:12 2018 +0100
+++ b/contrib/perf.py	Sun Nov 25 13:37:53 2018 +0100
@@ -540,18 +540,12 @@
 
 @command(b'perftags', formatteropts)
 def perftags(ui, repo, **opts):
-    import mercurial.changelog
-    import mercurial.manifest
-
     opts = _byteskwargs(opts)
     timer, fm = gettimer(ui, opts)
-    svfs = getsvfs(repo)
     repocleartagscache = repocleartagscachefunc(repo)
     def s():
-        repo.changelog = mercurial.changelog.changelog(svfs)
-        rootmanifest = mercurial.manifest.manifestrevlog(svfs)
-        repo.manifestlog = mercurial.manifest.manifestlog(svfs, repo,
-                                                          rootmanifest)
+        clearchangelog(repo)
+        clearfilecache(repo.unfiltered(), 'manifest')
         repocleartagscache()
     def t():
         return len(repo.tags())