#!/bin/sh

# This test script, originally written by David Roundy and Ian Lynagh is in
# the public domain.

set -ev

test $DARCS || DARCS=$PWD/../darcs
ACTUAL_DARCS=`which $DARCS`
DARCSPATH=`dirname $ACTUAL_DARCS`
export PATH="$DARCSPATH:$PATH"

rm -rf temp1 temp2

mkdir temp1
cd temp1
$DARCS init
perl -e 'print "a"x1048576' > foo
$DARCS record -l -a -A author -m x
rm foo
$DARCS record -a -A author -m y
cd ..

mkdir temp2
cd temp2
$DARCS init
echo yn | $DARCS pull ../temp1
rm foo
$DARCS pull -a
cd ..

rm -rf temp*
