tests/test-manifestv2.t
branchstable
changeset 37788 ed5448edcbfa
parent 37287 fb92df8b634c
parent 37787 92213f6745ed
child 37789 bfd32db06952
equal deleted inserted replaced
37287:fb92df8b634c 37788:ed5448edcbfa
     1 Create repo with old manifest
       
     2 
       
     3   $ cat << EOF >> $HGRCPATH
       
     4   > [format]
       
     5   > usegeneraldelta=yes
       
     6   > EOF
       
     7 
       
     8   $ hg init existing
       
     9   $ cd existing
       
    10   $ echo footext > foo
       
    11   $ hg add foo
       
    12   $ hg commit -m initial
       
    13 
       
    14 We're using v1, so no manifestv2 entry is in requires yet.
       
    15 
       
    16   $ grep manifestv2 .hg/requires
       
    17   [1]
       
    18 
       
    19 Let's clone this with manifestv2 enabled to switch to the new format for
       
    20 future commits.
       
    21 
       
    22   $ cd ..
       
    23   $ hg clone --pull existing new --config experimental.manifestv2=1
       
    24   requesting all changes
       
    25   adding changesets
       
    26   adding manifests
       
    27   adding file changes
       
    28   added 1 changesets with 1 changes to 1 files
       
    29   new changesets 0fc9a4fafa44
       
    30   updating to branch default
       
    31   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    32   $ cd new
       
    33 
       
    34 Check that entry was added to .hg/requires.
       
    35 
       
    36   $ grep manifestv2 .hg/requires
       
    37   manifestv2
       
    38 
       
    39 Make a new commit.
       
    40 
       
    41   $ echo newfootext > foo
       
    42   $ hg commit -m new
       
    43 
       
    44 Check that the manifest actually switched to v2.
       
    45 
       
    46   $ hg debugdata -m 0
       
    47   foo\x0021e958b1dca695a60ee2e9cf151753204ee0f9e9 (esc)
       
    48 
       
    49   $ hg debugdata -m 1
       
    50   \x00 (esc)
       
    51   \x00foo\x00 (esc)
       
    52   I\xab\x7f\xb8(\x83\xcas\x15\x9d\xc2\xd3\xd3:5\x08\xbad5_ (esc)
       
    53 
       
    54 Check that manifestv2 is used if the requirement is present, even if it's
       
    55 disabled in the config.
       
    56 
       
    57   $ echo newerfootext > foo
       
    58   $ hg --config experimental.manifestv2=False commit -m newer
       
    59 
       
    60   $ hg debugdata -m 2
       
    61   \x00 (esc)
       
    62   \x00foo\x00 (esc)
       
    63   \xa6\xb1\xfb\xef]\x91\xa1\x19`\xf3.#\x90S\xf8\x06 \xe2\x19\x00 (esc)
       
    64 
       
    65 Check that we can still read v1 manifests.
       
    66 
       
    67   $ hg files -r 0
       
    68   foo
       
    69 
       
    70   $ cd ..
       
    71 
       
    72 Check that entry is added to .hg/requires on repo creation
       
    73 
       
    74   $ hg --config experimental.manifestv2=True init repo
       
    75   $ cd repo
       
    76   $ grep manifestv2 .hg/requires
       
    77   manifestv2
       
    78 
       
    79 Set up simple repo
       
    80 
       
    81   $ echo a > file1
       
    82   $ echo b > file2
       
    83   $ echo c > file3
       
    84   $ hg ci -Aqm 'initial'
       
    85   $ echo d > file2
       
    86   $ hg ci -m 'modify file2'
       
    87 
       
    88 Check that 'hg verify', which uses manifest.readdelta(), works
       
    89 
       
    90   $ hg verify
       
    91   checking changesets
       
    92   checking manifests
       
    93   crosschecking files in changesets and manifests
       
    94   checking files
       
    95   3 files, 2 changesets, 4 total revisions
       
    96 
       
    97 Check that manifest revlog is smaller than for v1
       
    98 
       
    99   $ hg debugindex -m
       
   100      rev    offset  length  delta linkrev nodeid       p1           p2
       
   101        0         0      81     -1       0 57361477c778 000000000000 000000000000
       
   102        1        81      33      0       1 aeaab5a2ef74 57361477c778 000000000000