tests/test-dumprevlog
author Patrick Mezard <pmezard@gmail.com>
Mon, 07 Dec 2009 12:44:15 -0500
branchstable
changeset 10051 a02d43acbc04
parent 8167 6c82beaaa11a
permissions -rwxr-xr-x
convert/svn: make sink recover gracefully from empty changeset Otherwise when processing a changeset that in fact changes no files (perhaps due to bug in import from CVS) can get something like: unexpected svn output: abort: unable to cope with svn output Bug report and patch draft by Jesse Glick <jesse.glick@sun.com>

#!/bin/sh

CONTRIBDIR=$TESTDIR/../contrib

echo % prepare repo-a
mkdir repo-a
cd repo-a
hg init

echo this is file a > a
hg add a
hg commit -m first

echo adding to file a >> a
hg commit -m second

echo adding more to file a >> a
hg commit -m third

hg verify

echo
echo % dumping revlog of file a to stdout
python $CONTRIBDIR/dumprevlog .hg/store/data/a.i
echo % dumprevlog done

echo
echo % dump all revlogs to file repo.dump
find .hg/store -name "*.i" | sort | xargs python $CONTRIBDIR/dumprevlog > ../repo.dump

cd ..

mkdir repo-b
cd repo-b
hg init

echo
echo % undumping into repo-b
python $CONTRIBDIR/undumprevlog < ../repo.dump
echo % undumping done

cd ..

echo
echo % clone --pull repo-b repo-c  to rebuild fncache
hg clone --pull -U repo-b repo-c

cd repo-c

echo
echo % verify repo-c
hg verify

cd ..

echo
echo % comparing repos
hg -R repo-c incoming repo-a
hg -R repo-a incoming repo-c

exit 0