tests/test-repo-compengines.t
changeset 30818 4c0a5a256ae8
child 37415 c2c8962a9465
equal deleted inserted replaced
30817:2b279126b8f5 30818:4c0a5a256ae8
       
     1 A new repository uses zlib storage, which doesn't need a requirement
       
     2 
       
     3   $ hg init default
       
     4   $ cd default
       
     5   $ cat .hg/requires
       
     6   dotencode
       
     7   fncache
       
     8   generaldelta
       
     9   revlogv1
       
    10   store
       
    11 
       
    12   $ touch foo
       
    13   $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text to trigger compression'
       
    14   $ hg debugrevlog -c | grep 0x78
       
    15       0x78 (x)  :   1 (100.00%)
       
    16       0x78 (x)  : 110 (100.00%)
       
    17 
       
    18   $ cd ..
       
    19 
       
    20 Unknown compression engine to format.compression aborts
       
    21 
       
    22   $ hg --config experimental.format.compression=unknown init unknown
       
    23   abort: compression engine unknown defined by experimental.format.compression not available
       
    24   (run "hg debuginstall" to list available compression engines)
       
    25   [255]
       
    26 
       
    27 A requirement specifying an unknown compression engine results in bail
       
    28 
       
    29   $ hg init unknownrequirement
       
    30   $ cd unknownrequirement
       
    31   $ echo exp-compression-unknown >> .hg/requires
       
    32   $ hg log
       
    33   abort: repository requires features unknown to this Mercurial: exp-compression-unknown!
       
    34   (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
       
    35   [255]
       
    36 
       
    37   $ cd ..
       
    38 
       
    39 #if zstd
       
    40 
       
    41   $ hg --config experimental.format.compression=zstd init zstd
       
    42   $ cd zstd
       
    43   $ cat .hg/requires
       
    44   dotencode
       
    45   exp-compression-zstd
       
    46   fncache
       
    47   generaldelta
       
    48   revlogv1
       
    49   store
       
    50 
       
    51   $ touch foo
       
    52   $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text'
       
    53 
       
    54   $ hg debugrevlog -c | grep 0x28
       
    55       0x28      :  1 (100.00%)
       
    56       0x28      : 98 (100.00%)
       
    57 
       
    58   $ cd ..
       
    59 
       
    60 Specifying a new format.compression on an existing repo won't introduce data
       
    61 with that engine or a requirement
       
    62 
       
    63   $ cd default
       
    64   $ touch bar
       
    65   $ hg --config experimental.format.compression=zstd -q commit -A -m 'add bar with a lot of repeated repeated repeated text'
       
    66 
       
    67   $ cat .hg/requires
       
    68   dotencode
       
    69   fncache
       
    70   generaldelta
       
    71   revlogv1
       
    72   store
       
    73 
       
    74   $ hg debugrevlog -c | grep 0x78
       
    75       0x78 (x)  :   2 (100.00%)
       
    76       0x78 (x)  : 199 (100.00%)
       
    77 
       
    78 #endif