# HG changeset patch # User Boris Feld # Date 1531526987 -7200 # Node ID 2cdb82e8fb44346cdf8e9a27377a64642d0b212f # Parent 55101513ed9498d9e57595b933254a149e9390da perffncachewrite: load fncache after lock is acquired Without this patch, running perffncachewrite on a repository destroy its fncache. Lock Acquisition drops various caches, including the fncache one. Then writing of an non-loaded fncache result into an empty one. diff -r 55101513ed94 -r 2cdb82e8fb44 contrib/perf.py --- a/contrib/perf.py Fri Jun 22 11:02:42 2018 +0100 +++ b/contrib/perf.py Sat Jul 14 02:09:47 2018 +0200 @@ -980,9 +980,10 @@ def perffncachewrite(ui, repo, **opts): timer, fm = gettimer(ui, opts) s = repo.store + lock = repo.lock() s.fncache._load() - lock = repo.lock() tr = repo.transaction('perffncachewrite') + tr.addbackup('fncache') def d(): s.fncache._dirty = True s.fncache.write(tr) diff -r 55101513ed94 -r 2cdb82e8fb44 tests/test-contrib-perf.t --- a/tests/test-contrib-perf.t Fri Jun 22 11:02:42 2018 +0100 +++ b/tests/test-contrib-perf.t Sat Jul 14 02:09:47 2018 +0200 @@ -146,7 +146,11 @@ #if repofncache $ hg perffncacheencode $ hg perffncacheload + $ hg debugrebuildfncache + fncache already up to date $ hg perffncachewrite + $ hg debugrebuildfncache + fncache already up to date #endif $ hg perfheads $ hg perfindex