Comments
Patch
@@ -2234,10 +2234,16 @@ def perfbranchmap(ui, repo, *filternames
@command(b'perfbranchmapupdate', [
(b'', b'base', [], b'subset of revision to start from'),
(b'', b'target', [], b'subset of revision to end with'),
+ (b'', b'clear-caches', False, b'clear cache between each runs')
] + formatteropts)
def perfbranchmapupdate(ui, repo, base=(), target=(), **opts):
"""benchmark branchmap update from for <base> revs to <target> revs
+ if `--clear-caches` is passed, the following items will be reset before
+ each update:
+ * the changelog instance and associated indexes
+ * the rev-branch-cache instance
+
Examples:
# update for the one last revision
@@ -2250,6 +2256,7 @@ def perfbranchmapupdate(ui, repo, base=(
from mercurial import repoview
opts = _byteskwargs(opts)
timer, fm = gettimer(ui, opts)
+ clearcaches = opts['clear_caches']
unfi = repo.unfiltered()
x = [None] # used to pass data between closure
@@ -2315,6 +2322,9 @@ def perfbranchmapupdate(ui, repo, base=(
def setup():
x[0] = base.copy()
+ if clearcaches:
+ unfi._revbranchcache = None
+ clearchangelog(repo)
def bench():
x[0].update(targetrepo, newrevs)