#!/bin/sh

set -ev

[ -n "$DARCS" ] || DARCS=$PWD/../darcs
export EMAIL=tester

rm -fr temp1 temp2

mkdir temp1
cd temp1
$DARCS init

echo abc > A
$DARCS add A
echo def > B1
$DARCS add B1
# $DARCS record -all --patch-name patch1 # this way it doesn't trigger the bug
for i in 1 2 3 4 5 6 7 8 9 11; do echo y; done | $DARCS record --patch-name patch1

$DARCS mv B1 B2
$DARCS record --all --patch-name patch2
cd ..

mkdir temp2
cd temp2
$DARCS init
$DARCS pull --all ../temp1
$DARCS whatsnew | grep 'No changes'
cd ..

rm -fr temp1 temp2

