##// END OF EJS Templates
tests: unify test-addremove-similar
tests: unify test-addremove-similar

File last commit:

r10775:c5205761 stable
r11851:db955418 default
Show More
test-convert-hg-svn
79 lines | 1.8 KiB | text/plain | TextLexer
/ tests / test-convert-hg-svn
Bryan O'Sullivan
convert: tell the source repository when a rev has been converted...
r5554 #!/bin/sh
"$TESTDIR/hghave" svn svn-bindings || exit 80
fix_path()
{
tr '\\' /
}
echo "[extensions]" >> $HGRCPATH
echo "convert = " >> $HGRCPATH
Patrick Mezard
convert/svn: make sink recover gracefully from empty changeset...
r10051 echo "mq = " >> $HGRCPATH
Bryan O'Sullivan
convert: tell the source repository when a rev has been converted...
r5554
Patrick Mezard
test-convert-hg-svn: make it more windows friendly
r5809 svnpath=`pwd | fix_path`/svn-repo
Mads Kiilerich
Tests with spaces in paths...
r10775 svnadmin create "$svnpath"
Bryan O'Sullivan
convert: tell the source repository when a rev has been converted...
r5554
Mads Kiilerich
Tests with spaces in paths...
r10775 cat > "$svnpath"/hooks/pre-revprop-change <<'EOF'
Bryan O'Sullivan
convert: tell the source repository when a rev has been converted...
r5554 #!/bin/sh
REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"
if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi
if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi
echo "Changing prohibited revision property" >&2
exit 1
EOF
Mads Kiilerich
Tests with spaces in paths...
r10775 chmod +x "$svnpath"/hooks/pre-revprop-change
Bryan O'Sullivan
convert: tell the source repository when a rev has been converted...
r5554
Patrick Mezard
test-convert-hg-svn: make it more windows friendly
r5809 # SVN wants all paths to start with a slash. Unfortunately,
# Windows ones don't. Handle that.
Mads Kiilerich
Tests with spaces in paths...
r10775 svnurl="$svnpath"
expr "$svnurl" : "\/" > /dev/null
Patrick Mezard
test-convert-hg-svn: make it more windows friendly
r5809 if [ $? -ne 0 ]; then
Mads Kiilerich
Tests with spaces in paths...
r10775 svnurl="/$svnurl"
Patrick Mezard
test-convert-hg-svn: make it more windows friendly
r5809 fi
Mads Kiilerich
Tests with spaces in paths...
r10775 svnurl="file://$svnurl"
svn co "$svnurl" "$svnpath"-wc
Bryan O'Sullivan
convert: tell the source repository when a rev has been converted...
r5554
Mads Kiilerich
Tests with spaces in paths...
r10775 cd "$svnpath"-wc
Bryan O'Sullivan
convert: tell the source repository when a rev has been converted...
r5554 echo a > a
svn add a
svn ci -m'added a' a
cd ..
echo % initial roundtrip
Mads Kiilerich
Tests with spaces in paths...
r10775 hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg | grep -v initializing
hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
Bryan O'Sullivan
convert: tell the source repository when a rev has been converted...
r5554
echo % second roundtrip should do nothing
Mads Kiilerich
Tests with spaces in paths...
r10775 hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg
hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
Bryan O'Sullivan
convert: tell the source repository when a rev has been converted...
r5554
echo % new hg rev
Mads Kiilerich
Tests with spaces in paths...
r10775 hg clone "$svnpath"-hg "$svnpath"-work
cd "$svnpath"-work
Patrick Mezard
convert/svn: make sink recover gracefully from empty changeset...
r10051 echo b > b
hg add b
hg ci -mb
echo '% adding an empty revision'
hg qnew -m emtpy empty
hg qfinish -a
cd ..
Bryan O'Sullivan
convert: tell the source repository when a rev has been converted...
r5554
echo % echo hg to svn
Mads Kiilerich
Tests with spaces in paths...
r10775 hg --cwd "$svnpath"-hg pull -q "$svnpath"-work
hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
Bryan O'Sullivan
convert: tell the source repository when a rev has been converted...
r5554
echo % svn back to hg should do nothing
Mads Kiilerich
Tests with spaces in paths...
r10775 hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg
Bryan O'Sullivan
convert: tell the source repository when a rev has been converted...
r5554 echo % hg back to svn should do nothing
Mads Kiilerich
Tests with spaces in paths...
r10775 hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc