tests/test-convert-p4
changeset 7823 11efa41037e2
child 8063 ee8d9b93b316
equal deleted inserted replaced
7822:1079e666e938 7823:11efa41037e2
       
     1 #!/bin/sh
       
     2 
       
     3 "$TESTDIR/hghave" p4 || exit 80
       
     4 
       
     5 echo "[extensions]" >> $HGRCPATH
       
     6 echo "convert = " >> $HGRCPATH
       
     7 
       
     8 echo % create p4 depot
       
     9 export P4ROOT=$PWD/depot
       
    10 export P4AUDIT=$P4ROOT/audit
       
    11 export P4JOURNAL=$P4ROOT/journal
       
    12 export P4LOG=$P4ROOT/log
       
    13 export P4PORT=localhost:16661
       
    14 export P4DEBUG=1
       
    15 
       
    16 echo % start the p4 server
       
    17 [ ! -d $P4ROOT ] && mkdir $P4ROOT
       
    18 p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr &
       
    19 trap "echo % stop the p4 server ; p4 admin stop" EXIT
       
    20 
       
    21 # wait for the server to initialize
       
    22 while ! p4 ; do
       
    23    sleep 1
       
    24 done >/dev/null 2>/dev/null
       
    25 
       
    26 echo % create a client spec
       
    27 export P4CLIENT=hg-p4-import
       
    28 DEPOTPATH=//depot/test-mercurial-import/...
       
    29 p4 client -o | sed '/^View:/,$ d' >p4client
       
    30 echo View: >>p4client
       
    31 echo " $DEPOTPATH //$P4CLIENT/..." >>p4client
       
    32 p4 client -i <p4client
       
    33 
       
    34 echo % populate the depot
       
    35 echo a > a
       
    36 mkdir b
       
    37 echo c > b/c
       
    38 p4 add a b/c
       
    39 p4 submit -d initial
       
    40 
       
    41 echo % change some files
       
    42 p4 edit a
       
    43 echo aa >> a
       
    44 p4 submit -d "change a"
       
    45 
       
    46 p4 edit b/c
       
    47 echo cc >> b/c
       
    48 p4 submit -d "change b/c"
       
    49 
       
    50 echo % convert
       
    51 hg convert -s p4 $DEPOTPATH dst
       
    52 hg -R dst log --template 'rev=#rev# desc="#desc#" tags="#tags#" files="#files#"\n'
       
    53 
       
    54 echo % change some files
       
    55 p4 edit a b/c
       
    56 echo aaa >> a
       
    57 echo ccc >> b/c
       
    58 p4 submit -d "change a b/c"
       
    59 
       
    60 echo % convert again
       
    61 hg convert -s p4 $DEPOTPATH dst
       
    62 hg -R dst log --template 'rev=#rev# desc="#desc#" tags="#tags#" files="#files#"\n'
       
    63 
       
    64 echo % interesting names
       
    65 echo dddd > "d d"
       
    66 mkdir " e "
       
    67 echo fff >" e /f "
       
    68 p4 add "d d" " e /f "
       
    69 p4 submit -d "add d e f"
       
    70 
       
    71 echo % convert again
       
    72 hg convert -s p4 $DEPOTPATH dst
       
    73 hg -R dst log --template 'rev=#rev# desc="#desc#" tags="#tags#" files="#files#"\n'
       
    74 
       
    75