tests/test-convert
changeset 12510 efcbff270317
parent 12509 4746a2e4b239
child 12511 0fefeb4fff49
equal deleted inserted replaced
12509:4746a2e4b239 12510:efcbff270317
     1 #!/bin/sh
       
     2 
       
     3 cat >> $HGRCPATH <<EOF
       
     4 [extensions]
       
     5 convert=
       
     6 [convert]
       
     7 hg.saverev=False
       
     8 EOF
       
     9 
       
    10 hg help convert
       
    11 
       
    12 hg init a
       
    13 cd a
       
    14 echo a > a
       
    15 hg ci -d'0 0' -Ama
       
    16 hg cp a b
       
    17 hg ci -d'1 0' -mb
       
    18 hg rm a
       
    19 hg ci -d'2 0' -mc
       
    20 hg mv b a
       
    21 hg ci -d'3 0' -md
       
    22 echo a >> a
       
    23 hg ci -d'4 0' -me
       
    24 
       
    25 cd ..
       
    26 hg convert a 2>&1 | grep -v 'subversion python bindings could not be loaded'
       
    27 hg --cwd a-hg pull ../a
       
    28 
       
    29 touch bogusfile
       
    30 echo % should fail
       
    31 hg convert a bogusfile
       
    32 
       
    33 mkdir bogusdir
       
    34 chmod 000 bogusdir
       
    35 
       
    36 echo % should fail
       
    37 hg convert a bogusdir
       
    38 
       
    39 echo % should succeed
       
    40 chmod 700 bogusdir
       
    41 hg convert a bogusdir
       
    42 
       
    43 echo % test pre and post conversion actions
       
    44 echo 'include b' > filemap
       
    45 hg convert --debug --filemap filemap a partialb | \
       
    46     grep 'run hg'
       
    47 
       
    48 echo % converting empty dir should fail "nicely"
       
    49 mkdir emptydir
       
    50 # override $PATH to ensure p4 not visible; use $PYTHON in case we're
       
    51 # running from a devel copy, not a temp installation
       
    52 PATH="$BINDIR" $PYTHON "$BINDIR"/hg convert emptydir 2>&1 | sed 's,file://.*/emptydir,.../emptydir,g'
       
    53 
       
    54 echo % convert with imaginary source type
       
    55 hg convert --source-type foo a a-foo
       
    56 echo % convert with imaginary sink type
       
    57 hg convert --dest-type foo a a-foo
       
    58 
       
    59 echo
       
    60 echo % "testing: convert must not produce duplicate entries in fncache"
       
    61 hg convert a b
       
    62 echo % "contents of fncache file:"
       
    63 cat b/.hg/store/fncache
       
    64 
       
    65 echo '% test bogus URL'
       
    66 hg convert -q bzr+ssh://foobar@selenic.com/baz baz
       
    67 
       
    68 true