#!/bin/sh
set -ev

test $DARCS || DARCS=$PWD/../darcs
rm -rf temp1 temp2
mkdir temp1 temp2
cd temp1
$DARCS init
mkdir dir
$DARCS record -a -m add_dir -A x --look-for-adds
echo zig > dir/foo
echo zag > foo
mkdir dir2
echo hi > dir2/foo2
$DARCS record -a -m add_foo -A x --look-for-adds
cd ../temp2
$DARCS init
$DARCS pull -a ../temp1
cd ..
cmp temp1/dir2/foo2 temp2/dir2/foo2
cmp temp1/dir/foo temp2/dir/foo
cmp temp1/foo temp2/foo
rm -rf temp1 temp2

