test-convert-svn-source
89 lines
| 2.0 KiB
| text/plain
|
TextLexer
/ tests / test-convert-svn-source
Bryan O'Sullivan
|
r5513 | #!/bin/sh | ||
"$TESTDIR/hghave" svn svn-bindings || exit 80 | ||||
fix_path() | ||||
{ | ||||
tr '\\' / | ||||
} | ||||
echo "[extensions]" >> $HGRCPATH | ||||
echo "convert = " >> $HGRCPATH | ||||
Martin Geisler
|
r10119 | echo 'graphlog =' >> $HGRCPATH | ||
Bryan O'Sullivan
|
r5513 | |||
svnadmin create svn-repo | ||||
svnpath=`pwd | fix_path` | ||||
# SVN wants all paths to start with a slash. Unfortunately, | ||||
# Windows ones don't. Handle that. | ||||
Mads Kiilerich
|
r10775 | expr "$svnpath" : "\/" > /dev/null | ||
Bryan O'Sullivan
|
r5513 | if [ $? -ne 0 ]; then | ||
Mads Kiilerich
|
r10775 | svnpath="/$svnpath" | ||
Bryan O'Sullivan
|
r5513 | fi | ||
Edouard Gomez
|
r5854 | echo "# now tests that it works with trunk/tags layout, but no branches yet" | ||
echo | ||||
echo % initial svn import | ||||
mkdir projB | ||||
cd projB | ||||
mkdir trunk | ||||
mkdir tags | ||||
cd .. | ||||
Mads Kiilerich
|
r10775 | svnurl="file://$svnpath/svn-repo/proj%20B" | ||
svn import -m "init projB" projB "$svnurl" | fix_path | ||||
Edouard Gomez
|
r5854 | |||
echo % update svn repository | ||||
Mads Kiilerich
|
r10775 | svn co "$svnurl"/trunk B | fix_path | ||
Edouard Gomez
|
r5854 | cd B | ||
Patrick Mezard
|
r7074 | echo hello > 'letter .txt' | ||
svn add 'letter .txt' | ||||
Edouard Gomez
|
r5854 | svn ci -m hello | ||
Patrick Mezard
|
r7074 | "$TESTDIR/svn-safe-append.py" world 'letter .txt' | ||
Edouard Gomez
|
r5854 | svn ci -m world | ||
Mads Kiilerich
|
r10775 | svn copy -m "tag v0.1" "$svnurl"/trunk "$svnurl"/tags/v0.1 | ||
Edouard Gomez
|
r5854 | |||
Patrick Mezard
|
r7074 | "$TESTDIR/svn-safe-append.py" 'nice day today!' 'letter .txt' | ||
Edouard Gomez
|
r5854 | svn ci -m "nice day" | ||
cd .. | ||||
echo % convert to hg once | ||||
Mads Kiilerich
|
r10775 | hg convert "$svnurl" B-hg | ||
Edouard Gomez
|
r5854 | |||
echo % update svn repository again | ||||
cd B | ||||
Patrick Mezard
|
r7074 | "$TESTDIR/svn-safe-append.py" "see second letter" 'letter .txt' | ||
Edouard Gomez
|
r5854 | echo "nice to meet you" > letter2.txt | ||
svn add letter2.txt | ||||
svn ci -m "second letter" | ||||
Mads Kiilerich
|
r10775 | svn copy -m "tag v0.2" "$svnurl"/trunk "$svnurl"/tags/v0.2 | ||
Edouard Gomez
|
r5854 | |||
Peter Arrenbrecht
|
r6439 | "$TESTDIR/svn-safe-append.py" "blah-blah-blah" letter2.txt | ||
Edouard Gomez
|
r5854 | svn ci -m "work in progress" | ||
cd .. | ||||
Patrick Mezard
|
r6401 | ######################################## | ||
Edouard Gomez
|
r5854 | echo % test incremental conversion | ||
Mads Kiilerich
|
r10775 | hg convert "$svnurl" B-hg | ||
Edouard Gomez
|
r5854 | |||
cd B-hg | ||||
Martin Geisler
|
r8523 | hg glog --template '{rev} {desc|firstline} files: {files}\n' | ||
Edouard Gomez
|
r5854 | hg tags -q | ||
cd .. | ||||
Patrick Mezard
|
r6401 | |||
echo % test filemap | ||||
echo 'include letter2.txt' > filemap | ||||
Mads Kiilerich
|
r10775 | hg convert --filemap filemap "$svnurl"/trunk fmap | ||
Martin Geisler
|
r8523 | hg glog -R fmap --template '{rev} {desc|firstline} files: {files}\n' | ||
Patrick Mezard
|
r6401 | |||
echo % test stop revision | ||||
Mads Kiilerich
|
r10775 | hg convert --rev 1 "$svnurl"/trunk stoprev | ||
Patrick Mezard
|
r6401 | # Check convert_revision extra-records. | ||
# This is also the only place testing more than one extra field | ||||
# in a revision. | ||||
hg --cwd stoprev tip --debug | grep extra | sed 's/=.*/=/' | ||||