tests/test-dirstate-version-fallback.t
branchstable
changeset 50389 bf16ef96defe
parent 50388 9e08cfbe77b1
child 50395 e7a3611181aa
equal deleted inserted replaced
50388:9e08cfbe77b1 50389:bf16ef96defe
    18 Copy v1 dirstate
    18 Copy v1 dirstate
    19   $ cp .hg/dirstate $TESTTMP/dirstate-v1-backup
    19   $ cp .hg/dirstate $TESTTMP/dirstate-v1-backup
    20 
    20 
    21 Upgrade it to v2
    21 Upgrade it to v2
    22 
    22 
    23   $ hg debugupgraderepo -q --config format.use-dirstate-v2=1 --run | grep added
    23   $ hg debugupgraderepo -q --config format.use-dirstate-v2=1 --run | egrep 'added:|removed:'
    24      added: dirstate-v2
    24      added: dirstate-v2
    25   $ hg debugrequires | grep dirstate
    25   $ hg debugrequires | grep dirstate
    26   dirstate-v2
    26   dirstate-v2
    27   $ ls -1 .hg/dirstate*
    27   $ ls -1 .hg/dirstate*
    28   .hg/dirstate
    28   .hg/dirstate
    33   $ rm .hg/dirstate*
    33   $ rm .hg/dirstate*
    34   $ cp $TESTTMP/dirstate-v1-backup .hg/dirstate
    34   $ cp $TESTTMP/dirstate-v1-backup .hg/dirstate
    35 
    35 
    36 There should be no errors, but a v2 dirstate should be written back to disk
    36 There should be no errors, but a v2 dirstate should be written back to disk
    37   $ hg st
    37   $ hg st
    38   abort: dirstate-v2 parse error: when reading docket, Expected at least * bytes, got * (glob) (known-bad-output !)
       
    39   [255]
       
    40   $ ls -1 .hg/dirstate*
    38   $ ls -1 .hg/dirstate*
    41   .hg/dirstate
    39   .hg/dirstate
    42   .hg/dirstate.* (glob) (missing-correct-output !)
    40   .hg/dirstate.* (glob)
    43 
    41 
       
    42 Corrupt the dirstate to see how the errors show up to the user
       
    43   $ echo "I ate your data" > .hg/dirstate
       
    44 
       
    45   $ hg st
       
    46   abort: working directory state appears damaged! (no-rhg !)
       
    47   (falling back to dirstate-v1 from v2 also failed) (no-rhg !)
       
    48   abort: Too little data for dirstate. (rhg !)
       
    49   [255]