#!/usr/bin/env bash
set -ev

test $DARCS || DARCS=$PWD/../darcs

rm -rf temp temp2 temp3

#$DARCS get http://darcs.net/repos/unstable-hashed temp

$DARCS get --lazy http://darcs.net/repos/unstable-hashed temp2

$DARCS get --lazy --tag . http://darcs.net/repos/unstable-hashed temp3

cd temp2
$DARCS obliterate --from-tag . -a
$DARCS pull --tag . -a
cd ..

diff -u temp2/_darcs/hashed_inventory temp3/_darcs/hashed_inventory

rm -rf temp temp2 temp3
