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

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

rm -rf temp1
mkdir temp1
cd temp1
$DARCS initialize
echo ALL ignore-times >> _darcs/prefs/defaults
echo A > foo
$DARCS add foo
$DARCS record -a -m AA -A x
echo B > foo
$DARCS record -a -m BB -A x
echo C > foo
$DARCS record -a -m CC -A x
$DARCS tag -m 1.0 -A x
echo D > foo
$DARCS record -a -m DD -A x
echo E > foo
$DARCS record -a -m EE -A x
echo F > foo
$DARCS record -a -m FF -A x
$DARCS tag -m 2.0 -A x

$DARCS show tags > my
cat my
cat > ref <<EOF
2.0
1.0
EOF

cmp my ref
cd ..

rm -rf temp1
