##// END OF EJS Templates
patchbomb: fix 'echo -en' bashism in test-patchbomb...
patchbomb: fix 'echo -en' bashism in test-patchbomb The echo command doesn't accept options in some shells. printf is required by the SUSv2 (Single UNIX Specification v2).

File last commit:

r8470:dd24488c default
r9730:732fc0e9 default
Show More
test-convert-bzr
127 lines | 2.7 KiB | text/plain | TextLexer
Marek Kubica
convert: add bzr source
r7053 #!/bin/sh
Benoit Boissinot
`source` doesn't work for some /bin/sh, use `.` instead
r7058 . "$TESTDIR/bzr-definitions"
Marek Kubica
convert: add bzr source
r7053
echo % create and rename on the same file in the same step
mkdir test-createandrename
cd test-createandrename
bzr init -q source
cd source
echo a > a
Patrick Mezard
test-convert-bzr: check renamed files are removed (issue1505)
r8036 echo c > c
Patrick Mezard
convert/bzr: fix file rename replaced by a dir case (issue1583)...
r8045 echo e > e
bzr add -q a c e
bzr commit -q -m 'Initial add: a, c, e'
Marek Kubica
convert: add bzr source
r7053 bzr mv a b
Patrick Mezard
test-convert-bzr: check renamed files are removed (issue1505)
r8036 bzr mv c d
Patrick Mezard
convert/bzr: fix file rename replaced by a dir case (issue1583)...
r8045 bzr mv e f
Marek Kubica
convert: add bzr source
r7053 echo a2 >> a
Patrick Mezard
convert/bzr: fix file rename replaced by a dir case (issue1583)...
r8045 mkdir e
bzr add -q a e
Patrick Mezard
test-convert-bzr: check renamed files are removed (issue1505)
r8036 bzr commit -q -m 'rename a into b, create a, rename c into d'
Marek Kubica
convert: add bzr source
r7053 cd ..
hg convert source source-hg
glog -R source-hg
Patrick Mezard
test-convert-bzr: check renamed files are removed (issue1505)
r8036 echo "% manifest"
hg manifest -R source-hg -r tip
Marek Kubica
convert: add bzr source
r7053 echo "% test --rev option"
hg convert -r 1 source source-1-hg
glog -R source-1-hg
Patrick Mezard
convert/bzr: make it work with filemaps (issue1631)...
r8165 echo "% test with filemap"
cat > filemap <<EOF
exclude a
EOF
hg convert --filemap filemap source source-filemap-hg
hg -R source-filemap-hg manifest -r tip
Greg Ward
convert/bzr: handle Bazaar timestamps correctly (issue1652).
r8305
Patrick Mezard
convert/bzr: warn when source is a lightweight checkout (issue1647)
r8470 echo '% convert from lightweight checkout'
bzr checkout --lightweight source source-light
hg convert source-light source-light-hg
echo "% lightweight manifest"
hg manifest -R source-light-hg -r tip
Greg Ward
convert/bzr: handle Bazaar timestamps correctly (issue1652).
r8305 # extract timestamps that look just like hg's {date|isodate}:
# yyyy-mm-dd HH:MM zzzz (no seconds!)
echo "% compare timestamps"
cd source
bzr log | \
Greg Ward
test-convert-bzr: tweak sed hack to preserve timezone in 'bzr log' output
r8308 sed '/timestamp/!d;s/.\{15\}\([0-9: -]\{16\}\):.. \(.[0-9]\{4\}\)/\1 \2/' \
Greg Ward
convert/bzr: handle Bazaar timestamps correctly (issue1652).
r8305 > ../bzr-timestamps
cd ..
hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps
if diff -q bzr-timestamps hg-timestamps ; then
echo "good: hg timestamps match bzr timestamps"
else
echo "fail: bzr timestamps are:"
cat bzr-timestamps
echo "but hg timestamps are:"
cat hg-timestamps
fi
Marek Kubica
convert: add bzr source
r7053 cd ..
echo % merge
mkdir test-merge
cd test-merge
cat > helper.py <<EOF
import sys
from bzrlib import workingtree
wt = workingtree.WorkingTree.open('.')
message, stamp = sys.argv[1:]
wt.commit(message, timestamp=int(stamp))
EOF
bzr init -q source
cd source
echo content > a
echo content2 > b
bzr add -q a b
bzr commit -q -m 'Initial add'
cd ..
bzr branch -q source source-improve
cd source
echo more >> a
python ../helper.py 'Editing a' 100
cd ../source-improve
echo content3 >> b
python ../helper.py 'Editing b' 200
cd ../source
bzr merge -q ../source-improve
bzr commit -q -m 'Merged improve branch'
cd ..
hg convert --datesort source source-hg
glog -R source-hg
cd ..
echo % symlinks and executable files
mkdir test-symlinks
cd test-symlinks
bzr init -q source
cd source
touch program
chmod +x program
ln -s program altname
Patrick Mezard
convert/bzr: fix symlink handling (issue1626)
r8148 mkdir d
echo a > d/a
ln -s a syma
bzr add -q altname program syma d/a
Marek Kubica
convert: add bzr source
r7053 bzr commit -q -m 'Initial setup'
touch newprog
chmod +x newprog
rm altname
ln -s newprog altname
chmod -x program
bzr add -q newprog
bzr commit -q -m 'Symlink changed, x bits changed'
cd ..
hg convert source source-hg
manifest source-hg 0
manifest source-hg tip
Patrick Mezard
convert/bzr: fix symlinks target (issue1626/2)
r8423 cd source-hg
echo % test the symlinks can be recreated
hg up
hg cat syma
cd ../..