#!/usr/bin/env bash

# For issue257: push => incorrect return code when couldn't get lock

set -ev

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

rm -rf tempc
mkdir tempc
cd tempc
$DARCS init
echo foo > foo.c
$DARCS rec -Ax -alm init
cd ..
rm -rf temps
$DARCS get tempc temps
cd temps
echo server >> foo.c
$DARCS rec -Ax -alm server
cd ../tempc
echo client >> foo.c
$DARCS rec -Ax -alm client
if $DARCS push -a ../temps; then
        false
fi
cd ..
rm -rf tempc temps
