joerg.sonnenberger created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches.
REVISION SUMMARY revlog files had uncompressed revlog entries support since forever, but it wasn't selectable or exposed explicitly. It is occassionally useful for performance testing as it avoids the latency of zlib or zstd. It also has the nice side effect of providing a non-default compression engine out-of-the-box. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9572 AFFECTED FILES mercurial/utils/compression.py tests/test-repo-compengines.t CHANGE DETAILS diff --git a/tests/test-repo-compengines.t b/tests/test-repo-compengines.t --- a/tests/test-repo-compengines.t +++ b/tests/test-repo-compengines.t @@ -43,6 +43,27 @@ $ cd .. +Specifying a new format.compression on an existing repo won't introduce data +with that engine or a requirement + + $ cd default + $ touch bar + $ hg --config format.revlog-compression=none -q commit -A -m 'add bar with a lot of repeated repeated repeated text' + + $ cat .hg/requires + dotencode + fncache + generaldelta + revlogv1 + sparserevlog + store + testonly-simplestore (reposimplestore !) + + $ hg debugrevlog -c | grep 0x78 + 0x78 (x) : 2 (100.00%) + 0x78 (x) : 199 (100.00%) + $ cd .. + #if zstd $ hg --config format.revlog-compression=zstd init zstd @@ -66,25 +87,6 @@ $ cd .. -Specifying a new format.compression on an existing repo won't introduce data -with that engine or a requirement - - $ cd default - $ touch bar - $ hg --config format.revlog-compression=zstd -q commit -A -m 'add bar with a lot of repeated repeated repeated text' - - $ cat .hg/requires - dotencode - fncache - generaldelta - revlogv1 - sparserevlog - store - testonly-simplestore (reposimplestore !) - - $ hg debugrevlog -c | grep 0x78 - 0x78 (x) : 2 (100.00%) - 0x78 (x) : 199 (100.00%) #endif @@ -116,10 +118,12 @@ > done $ $RUNTESTDIR/f -s */.hg/store/data/* - default/.hg/store/data/foo.i: size=64 (pure !) + default/.hg/store/data/bar.i: size=64 + default/.hg/store/data/foo.i: size=64 zlib-level-1/.hg/store/data/a.i: size=4146 zlib-level-9/.hg/store/data/a.i: size=4138 zlib-level-default/.hg/store/data/a.i: size=4138 + zstd/.hg/store/data/foo.i: size=64 (zstd !) Test error cases @@ -144,6 +148,41 @@ abort: invalid value for `storage.revlog.zlib.level` config: 42 [255] +checking details of none compression +==================================== + + $ hg init none-compression --config format.revlog-compression=none + + $ commitone() { + > repo=$1 + > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a + > hg -R $repo add $repo/a + > hg -R $repo commit -m some-commit + > } + + $ commitone none-compression + + $ hg log -R none-compression + changeset: 0:68b53da39cd8 + tag: tip + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: some-commit + + + $ cat none-compression/.hg/requires + dotencode + exp-compression-none + fncache + generaldelta + revlogv1 + sparserevlog + store + testonly-simplestore (reposimplestore !) + + $ $RUNTESTDIR/f -s none-compression/.hg/store/data/* + none-compression/.hg/store/data/a.i: size=4216 + #if zstd checking zstd options diff --git a/mercurial/utils/compression.py b/mercurial/utils/compression.py --- a/mercurial/utils/compression.py +++ b/mercurial/utils/compression.py @@ -617,8 +617,10 @@ def wireprotosupport(self): return compewireprotosupport(b'none', 0, 10) - # We don't implement revlogheader because it is handled specially - # in the revlog class. + # revlog special cases the uncompressed case, but implementing + # revlogheader allows forcing uncompressed storage. + def revlogheader(self): + return b'\0' def compressstream(self, it, opts=None): return it To: joerg.sonnenberger, #hg-reviewers Cc: mercurial-patches, mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel