tests/test-convert-svn-startrev
author Martin Geisler <mg@daimi.au.dk>
Sat, 04 Apr 2009 23:15:37 +0200
changeset 7986 c756e695012a
parent 7475 90d8dfb481e7
child 8523 5b7da468531b
permissions -rwxr-xr-x
children: word-wrap help texts at 70 characters
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6173
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     2
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     3
"$TESTDIR/hghave" svn svn-bindings || exit 80
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     4
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     5
fix_path()
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     6
{
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     7
    tr '\\' /
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     8
}
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     9
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    10
echo "[extensions]" >> $HGRCPATH
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    11
echo "convert = " >> $HGRCPATH
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    12
echo "hgext.graphlog =" >> $HGRCPATH
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    13
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    14
svnadmin create svn-repo
7475
90d8dfb481e7 Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents: 6439
diff changeset
    15
cat "$TESTDIR/svn/startrev.svndump" | svnadmin load svn-repo > /dev/null
6173
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    16
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    17
svnpath=`pwd | fix_path`
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    18
# SVN wants all paths to start with a slash. Unfortunately,
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    19
# Windows ones don't. Handle that.
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    20
expr $svnpath : "\/" > /dev/null
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    21
if [ $? -ne 0 ]; then
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    22
    svnpath='/'$svnpath
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    23
fi
7475
90d8dfb481e7 Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents: 6439
diff changeset
    24
svnurl=file://$svnpath/svn-repo
6173
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    25
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    26
convert()
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    27
{
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    28
    startrev=$1
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    29
    repopath=A-r$startrev-hg
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    30
    hg convert --config convert.svn.startrev=$startrev \
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    31
        --config convert.svn.trunk=branches/branch1 \
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    32
        --config convert.svn.branches="  " \
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    33
        --config convert.svn.tags= \
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    34
        --datesort $svnurl $repopath
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    35
    hg -R $repopath glog --template '#rev# #desc|firstline# files: #files#\n'
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    36
    echo
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    37
}
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    38
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    39
echo % convert before branching point
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    40
convert 3
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    41
echo % convert before branching point
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    42
convert 4
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    43
echo % convert at branching point
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    44
convert 5
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    45
echo % convert last revision only
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    46
convert 6