Patchwork [1,of,5,V3] perf: stop creating new revlog by hand in perftags

login
register
mail settings
Submitter Boris Feld
Date Nov. 26, 2018, 6:26 p.m.
Message ID <a2a4aabea58bef816eeb.1543256766@localhost.localdomain>
Download mbox | patch
Permalink /patch/36781/
State Accepted
Headers show

Comments

Boris Feld - Nov. 26, 2018, 6:26 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1543149473 -3600
#      Sun Nov 25 13:37:53 2018 +0100
# Node ID a2a4aabea58bef816eeb53e80ddaf0d438717c66
# Parent  cfaf3843491bde30916b89180d5f67561a22da28
# EXP-Topic perf-tags
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r a2a4aabea58b
perf: stop creating new revlog by hand in perftags

It i better to let the repository logic create its own object. We now just clear
the cache. New object will be automatically created from there.
Yuya Nishihara - Nov. 27, 2018, 11:35 a.m.
On Mon, 26 Nov 2018 19:26:06 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1543149473 -3600
> #      Sun Nov 25 13:37:53 2018 +0100
> # Node ID a2a4aabea58bef816eeb53e80ddaf0d438717c66
> # Parent  cfaf3843491bde30916b89180d5f67561a22da28
> # EXP-Topic perf-tags
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r a2a4aabea58b
> perf: stop creating new revlog by hand in perftags

Queued, thanks.

> diff --git a/contrib/perf.py b/contrib/perf.py
> --- a/contrib/perf.py
> +++ b/contrib/perf.py
> @@ -546,10 +546,8 @@ def perftags(ui, repo, **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')

Removed several unused imports and variables in flight.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -546,10 +546,8 @@  def perftags(ui, repo, **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())