tests/test-bundle-r
changeset 3284 d89e98840b08
child 3285 484e6b7e7062
equal deleted inserted replaced
3281:f49c90b46897 3284:d89e98840b08
       
     1 #!/bin/sh
       
     2 
       
     3 hg init test
       
     4 cd test
       
     5 cat >>afile <<EOF
       
     6 0
       
     7 EOF
       
     8 hg add afile
       
     9 hg commit -m "0.0" -d "1000000 0"
       
    10 cat >>afile <<EOF
       
    11 1
       
    12 EOF
       
    13 hg commit -m "0.1" -d "1000000 0"
       
    14 cat >>afile <<EOF
       
    15 2
       
    16 EOF
       
    17 hg commit -m "0.2" -d "1000000 0"
       
    18 cat >>afile <<EOF
       
    19 3
       
    20 EOF
       
    21 hg commit -m "0.3" -d "1000000 0"
       
    22 hg update -C 0
       
    23 cat >>afile <<EOF
       
    24 1
       
    25 EOF
       
    26 hg commit -m "1.1" -d "1000000 0"
       
    27 cat >>afile <<EOF
       
    28 2
       
    29 EOF
       
    30 hg commit -m "1.2" -d "1000000 0"
       
    31 cat >fred <<EOF
       
    32 a line
       
    33 EOF
       
    34 cat >>afile <<EOF
       
    35 3
       
    36 EOF
       
    37 hg add fred
       
    38 hg commit -m "1.3" -d "1000000 0"
       
    39 hg mv afile adifferentfile
       
    40 hg commit -m "1.3m" -d "1000000 0"
       
    41 hg update -C 3
       
    42 hg mv afile anotherfile
       
    43 hg commit -m "0.3m" -d "1000000 0"
       
    44 hg debugindex .hg/data/afile.i
       
    45 hg debugindex .hg/data/adifferentfile.i
       
    46 hg debugindex .hg/data/anotherfile.i
       
    47 hg debugindex .hg/data/fred.i
       
    48 hg debugindex .hg/00manifest.i
       
    49 hg verify
       
    50 cd ..
       
    51 for i in 0 1 2 3 4 5 6 7 8; do
       
    52    mkdir test-"$i"
       
    53    hg --cwd test-"$i" init
       
    54    hg -R test bundle -r "$i" test-"$i".hg test-"$i"
       
    55    cd test-"$i"
       
    56    hg unbundle ../test-"$i".hg
       
    57    hg verify
       
    58    hg tip -q
       
    59    cd ..
       
    60 done
       
    61 cd test-8
       
    62 hg pull ../test-7
       
    63 hg verify
       
    64 hg rollback
       
    65 cd ..
       
    66 
       
    67 echo % should fail
       
    68 hg -R test bundle --base 2 -r tip test-bundle-branch1.hg test-3
       
    69 hg -R test bundle -r tip test-bundle-branch1.hg
       
    70 
       
    71 hg -R test bundle --base 2 -r tip test-bundle-branch1.hg
       
    72 hg -R test bundle --base 2 -r 7 test-bundle-branch2.hg
       
    73 hg -R test bundle --base 2 test-bundle-all.hg
       
    74 hg -R test bundle --base 3 -r tip test-bundle-should-fail.hg
       
    75 cd test-2
       
    76 echo % 2
       
    77 hg tip -q
       
    78 hg unbundle ../test-bundle-should-fail.hg
       
    79 echo % 2
       
    80 hg tip -q
       
    81 hg unbundle ../test-bundle-all.hg
       
    82 echo % 8
       
    83 hg tip -q
       
    84 hg rollback
       
    85 echo % 2
       
    86 hg tip -q
       
    87 hg unbundle ../test-bundle-branch1.hg
       
    88 echo % 4
       
    89 hg tip -q
       
    90 hg unbundle ../test-bundle-branch2.hg
       
    91 echo % 8
       
    92 hg tip -q
       
    93 hg verify