Mercurial > public > mercurial-scm > hg-stable
diff tests/test-revlog-raw.py @ 49792:efbbc2f9121e
delta-find: use a smarter object for snapshot caching
This open the way for a longer lived cache.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 06 Nov 2022 16:56:23 -0500 |
parents | e33776297d1f |
children | b670eb3dd6c9 |
line wrap: on
line diff
--- a/tests/test-revlog-raw.py Mon Nov 07 22:12:59 2022 -0500 +++ b/tests/test-revlog-raw.py Sun Nov 06 16:56:23 2022 -0500 @@ -1,7 +1,6 @@ # test revlog interaction about raw data (flagprocessor) -import collections import hashlib import sys @@ -472,16 +471,16 @@ def findsnapshottest(rlog): - resultall = collections.defaultdict(list) - deltas._findsnapshots(rlog, resultall, 0) - resultall = dict(resultall.items()) + cache = deltas.SnapshotCache() + cache.update(rlog) + resultall = dict(cache.snapshots) if resultall != snapshotmapall: print('snapshot map differ:') print(' expected: %s' % snapshotmapall) print(' got: %s' % resultall) - result15 = collections.defaultdict(list) - deltas._findsnapshots(rlog, result15, 15) - result15 = dict(result15.items()) + cache15 = deltas.SnapshotCache() + cache15.update(rlog, 15) + result15 = dict(cache15.snapshots) if result15 != snapshotmap15: print('snapshot map differ:') print(' expected: %s' % snapshotmap15)