tests/test-convert-baz
branchstable
changeset 17225 a06e2681dd17
parent 17222 98823bd0d697
parent 17224 23b247234454
child 17226 436cc9d017c6
equal deleted inserted replaced
17222:98823bd0d697 17225:a06e2681dd17
     1 #!/bin/sh
       
     2 
       
     3 "$TESTDIR/hghave" baz || exit 80
       
     4 
       
     5 baz my-id "mercurial <mercurial@selenic.com>"
       
     6 
       
     7 echo "[extensions]" >> $HGRCPATH
       
     8 echo "convert=" >> $HGRCPATH
       
     9 echo 'graphlog =' >> $HGRCPATH
       
    10 
       
    11 echo % create baz archive
       
    12 baz make-archive baz@mercurial--convert hg-test-convert-baz
       
    13 
       
    14 echo % initialize baz repo
       
    15 mkdir baz-repo
       
    16 cd baz-repo/
       
    17 baz init-tree baz@mercurial--convert/baz--test--0
       
    18 baz import
       
    19 
       
    20 echo % create initial files
       
    21 echo 'this is a file' > a
       
    22 baz add a
       
    23 mkdir src
       
    24 baz add src
       
    25 cd src
       
    26 dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null
       
    27 baz add b
       
    28 # HACK: hide GNU tar-1.22 "tar: The --preserve option is deprecated, use --preserve-permissions --preserve-order instead"
       
    29 baz commit -s "added a file, src and src/b (binary)" 2>&1 | grep -v '^tar'
       
    30 
       
    31 echo % create link file and modify a
       
    32 ln -s ../a a-link
       
    33 baz add a-link
       
    34 echo 'this a modification to a' >> ../a
       
    35 baz commit -s "added link to a and modify a"
       
    36 
       
    37 echo % create second link and modify b
       
    38 ln -s ../a a-link-2
       
    39 baz add a-link-2
       
    40 dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null
       
    41 baz commit -s "added second link and modify b"
       
    42 
       
    43 echo % b file to link and a-link-2 to regular file
       
    44 rm -f a-link-2
       
    45 echo 'this is now a regular file' > a-link-2
       
    46 ln -sf ../a b
       
    47 baz commit -s "file to link and link to file test"
       
    48 
       
    49 echo % move a-link-2 file and src directory
       
    50 cd ..
       
    51 baz mv src/a-link-2 c
       
    52 baz mv src test
       
    53 baz commit -s "move and rename a-link-2 file and src directory"
       
    54 
       
    55 echo % move and add the moved file again
       
    56 echo e > e
       
    57 baz add e
       
    58 baz commit -s "add e"
       
    59 baz mv e f
       
    60 echo ee > e
       
    61 baz add e
       
    62 baz commit -s "move e and recreate it again"
       
    63 cd ..
       
    64 
       
    65 echo % converting baz repo to Mercurial
       
    66 hg convert baz-repo baz-repo-hg
       
    67 
       
    68 baz register-archive -d baz@mercurial--convert
       
    69 
       
    70 glog()
       
    71 {
       
    72     hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
       
    73 }
       
    74 
       
    75 echo % show graph log
       
    76 glog -R baz-repo-hg
       
    77 hg up -q -R baz-repo-hg
       
    78 hg -R baz-repo-hg manifest --debug
       
    79 hg -R baz-repo-hg log -r 5 -r 7 -C --debug | grep copies