tests/test-convert-bzr
changeset 7053 209ef5f3534c
child 7058 9e6d6568bf7a
equal deleted inserted replaced
7052:0ca4f42daed7 7053:209ef5f3534c
       
     1 #!/bin/sh
       
     2 
       
     3 source "$TESTDIR/bzr-definitions"
       
     4 
       
     5 echo % create and rename on the same file in the same step
       
     6 mkdir test-createandrename
       
     7 cd test-createandrename
       
     8 bzr init -q source
       
     9 cd source
       
    10 echo a > a
       
    11 bzr add -q a
       
    12 bzr commit -q -m 'Initial add: a'
       
    13 bzr mv a b
       
    14 echo a2 >> a
       
    15 bzr add -q a
       
    16 bzr commit -q -m 'rename a into b, create a'
       
    17 cd ..
       
    18 hg convert source source-hg
       
    19 glog -R source-hg
       
    20 echo "% test --rev option"
       
    21 hg convert -r 1 source source-1-hg
       
    22 glog -R source-1-hg
       
    23 cd ..
       
    24 
       
    25 echo % merge
       
    26 mkdir test-merge
       
    27 cd test-merge
       
    28 
       
    29 cat > helper.py <<EOF
       
    30 import sys
       
    31 from bzrlib import workingtree
       
    32 wt = workingtree.WorkingTree.open('.')
       
    33 
       
    34 message, stamp = sys.argv[1:]
       
    35 wt.commit(message, timestamp=int(stamp))
       
    36 EOF
       
    37 
       
    38 bzr init -q source
       
    39 cd source
       
    40 echo content > a
       
    41 echo content2 > b
       
    42 bzr add -q a b
       
    43 bzr commit -q -m 'Initial add'
       
    44 cd ..
       
    45 bzr branch -q source source-improve
       
    46 cd source
       
    47 echo more >> a
       
    48 python ../helper.py 'Editing a' 100
       
    49 cd ../source-improve
       
    50 echo content3 >> b
       
    51 python ../helper.py 'Editing b' 200
       
    52 cd ../source
       
    53 bzr merge -q ../source-improve
       
    54 bzr commit -q -m 'Merged improve branch'
       
    55 cd ..
       
    56 hg convert --datesort source source-hg
       
    57 glog -R source-hg
       
    58 cd ..
       
    59 
       
    60 echo % symlinks and executable files
       
    61 mkdir test-symlinks
       
    62 cd test-symlinks
       
    63 bzr init -q source
       
    64 cd source
       
    65 touch program
       
    66 chmod +x program
       
    67 ln -s program altname
       
    68 bzr add -q altname program
       
    69 bzr commit -q -m 'Initial setup'
       
    70 touch newprog
       
    71 chmod +x newprog
       
    72 rm altname
       
    73 ln -s newprog altname
       
    74 chmod -x program
       
    75 bzr add -q newprog
       
    76 bzr commit -q -m 'Symlink changed, x bits changed'
       
    77 cd ..
       
    78 hg convert source source-hg
       
    79 manifest source-hg 0
       
    80 manifest source-hg tip
       
    81 cd ..