tests/test-repo-compengines.t
author Boris Feld <boris.feld@octobus.net>
Mon, 12 Nov 2018 01:16:12 +0100
changeset 40908 f6904d60fc21
parent 40905 4fe18205bbdb
child 40919 a0886a4d6dce
permissions -rw-r--r--
test: enable sparse-revlog for test-ssh-bundle1.t We are about to enable sparse-revlog globally. To help with reviewing the tests change, we isolate them in individual changesets. Differential Revision: https://phab.mercurial-scm.org/D5335
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40905
4fe18205bbdb test: enable sparse-revlog for test-repo-compengines.t
Boris Feld <boris.feld@octobus.net>
parents: 37415
diff changeset
     1
TRANSITIONAL CONFIG
4fe18205bbdb test: enable sparse-revlog for test-repo-compengines.t
Boris Feld <boris.feld@octobus.net>
parents: 37415
diff changeset
     2
  $ cat << EOF >> $HGRCPATH
4fe18205bbdb test: enable sparse-revlog for test-repo-compengines.t
Boris Feld <boris.feld@octobus.net>
parents: 37415
diff changeset
     3
  > [format]
4fe18205bbdb test: enable sparse-revlog for test-repo-compengines.t
Boris Feld <boris.feld@octobus.net>
parents: 37415
diff changeset
     4
  > sparse-revlog = yes
4fe18205bbdb test: enable sparse-revlog for test-repo-compengines.t
Boris Feld <boris.feld@octobus.net>
parents: 37415
diff changeset
     5
  > EOF
4fe18205bbdb test: enable sparse-revlog for test-repo-compengines.t
Boris Feld <boris.feld@octobus.net>
parents: 37415
diff changeset
     6
30818
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     7
A new repository uses zlib storage, which doesn't need a requirement
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     8
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
  $ hg init default
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
  $ cd default
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
  $ cat .hg/requires
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    12
  dotencode
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
  fncache
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    14
  generaldelta
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    15
  revlogv1
40905
4fe18205bbdb test: enable sparse-revlog for test-repo-compengines.t
Boris Feld <boris.feld@octobus.net>
parents: 37415
diff changeset
    16
  sparserevlog
30818
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    17
  store
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30818
diff changeset
    18
  testonly-simplestore (reposimplestore !)
30818
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    19
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    20
  $ touch foo
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    21
  $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text to trigger compression'
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    22
  $ hg debugrevlog -c | grep 0x78
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    23
      0x78 (x)  :   1 (100.00%)
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    24
      0x78 (x)  : 110 (100.00%)
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    25
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    26
  $ cd ..
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    27
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    28
Unknown compression engine to format.compression aborts
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    29
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    30
  $ hg --config experimental.format.compression=unknown init unknown
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    31
  abort: compression engine unknown defined by experimental.format.compression not available
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    32
  (run "hg debuginstall" to list available compression engines)
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    33
  [255]
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    34
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    35
A requirement specifying an unknown compression engine results in bail
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    36
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    37
  $ hg init unknownrequirement
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    38
  $ cd unknownrequirement
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    39
  $ echo exp-compression-unknown >> .hg/requires
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    40
  $ hg log
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    41
  abort: repository requires features unknown to this Mercurial: exp-compression-unknown!
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    42
  (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    43
  [255]
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    44
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    45
  $ cd ..
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    46
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    47
#if zstd
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    48
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    49
  $ hg --config experimental.format.compression=zstd init zstd
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    50
  $ cd zstd
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    51
  $ cat .hg/requires
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    52
  dotencode
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    53
  exp-compression-zstd
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    54
  fncache
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    55
  generaldelta
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    56
  revlogv1
40905
4fe18205bbdb test: enable sparse-revlog for test-repo-compengines.t
Boris Feld <boris.feld@octobus.net>
parents: 37415
diff changeset
    57
  sparserevlog
30818
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    58
  store
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30818
diff changeset
    59
  testonly-simplestore (reposimplestore !)
30818
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    60
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    61
  $ touch foo
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    62
  $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text'
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    63
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    64
  $ hg debugrevlog -c | grep 0x28
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    65
      0x28      :  1 (100.00%)
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    66
      0x28      : 98 (100.00%)
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    67
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    68
  $ cd ..
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    69
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    70
Specifying a new format.compression on an existing repo won't introduce data
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    71
with that engine or a requirement
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    72
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    73
  $ cd default
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    74
  $ touch bar
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    75
  $ hg --config experimental.format.compression=zstd -q commit -A -m 'add bar with a lot of repeated repeated repeated text'
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    76
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    77
  $ cat .hg/requires
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    78
  dotencode
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    79
  fncache
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    80
  generaldelta
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    81
  revlogv1
40905
4fe18205bbdb test: enable sparse-revlog for test-repo-compengines.t
Boris Feld <boris.feld@octobus.net>
parents: 37415
diff changeset
    82
  sparserevlog
30818
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    83
  store
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30818
diff changeset
    84
  testonly-simplestore (reposimplestore !)
30818
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    85
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    86
  $ hg debugrevlog -c | grep 0x78
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    87
      0x78 (x)  :   2 (100.00%)
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    88
      0x78 (x)  : 199 (100.00%)
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    89
4c0a5a256ae8 localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    90
#endif