tests/svn/svndump-replace.sh
branchstable
changeset 11128 a9b427b5821e
child 13052 5fb924ee44d5
equal deleted inserted replaced
11127:ab575114ddd8 11128:a9b427b5821e
       
     1 #!/bin/sh
       
     2 
       
     3 RSVN="`pwd`/rsvn.py"
       
     4 export PATH=/bin:/usr/bin
       
     5 mkdir temp
       
     6 cd temp
       
     7 
       
     8 svnadmin create repo
       
     9 svn co file://`pwd`/repo wc
       
    10 
       
    11 cd wc
       
    12 mkdir trunk branches
       
    13 cd trunk
       
    14 echo a > a
       
    15 mkdir d
       
    16 echo b > d/b
       
    17 ln -s d dlink
       
    18 ln -s d dlink2
       
    19 ln -s d dlink3
       
    20 cd ..
       
    21 svn add *
       
    22 svn ci -m 'initial'
       
    23 # Clobber symlink with file with similar content
       
    24 cd trunk
       
    25 ls -Alh
       
    26 readlink dlink3 > dlink3tmp
       
    27 rm dlink3
       
    28 mv dlink3tmp dlink3
       
    29 svn propdel svn:special dlink3
       
    30 svn ci -m 'clobber symlink'
       
    31 cd ..
       
    32 svn up
       
    33 
       
    34 # Clobber files and symlink with directories
       
    35 cd ..
       
    36 cat > clobber.rsvn <<EOF
       
    37 rdelete trunk/a
       
    38 rdelete trunk/dlink
       
    39 rcopy trunk/d trunk/a
       
    40 rcopy trunk/d trunk/dlink
       
    41 EOF
       
    42 
       
    43 python $RSVN --message=clobber1 --username=evil `pwd`/repo < clobber.rsvn
       
    44 
       
    45 # Clobber non-symlink with symlink with same content (kudos openwrt)
       
    46 cat > clobber.rsvn <<EOF
       
    47 rdelete trunk/dlink3
       
    48 rcopy trunk/dlink2 trunk/dlink3
       
    49 EOF
       
    50 
       
    51 python $RSVN --message=clobber2 --username=evil `pwd`/repo < clobber.rsvn
       
    52 
       
    53 svn log -v file://`pwd`/repo
       
    54 
       
    55 svnadmin dump repo > ../replace.svndump