if ($args.length -lt 2) {
    echo "usage: svnclone [from] [to]"
    exit 1
}
$from=$args[0]
$to=$args[1]

if (! (Test-Path $from)) {
    echo "from directory '$from' does not exist"
    exit 1
}
if (Test-Path $to) {
    echo "to directory '$to' already exists"
    exit 1
}
echo ""
echo "$from -> $to"
echo ""

mkdir $to
svn add -N $to

svn export $from/carserv $to/carserv
cp $from/README.txt $to/README.txt
svn add -N $to/carserv
svn add -N $to/README.txt

cd $to/carserv

foreach($file in @(".","dom","commandline","fixture","service","webapp")) {
  echo $file
  svn add -N $file
  svn add $file/pom.xml
  svn propset svn:ignore -F c:\tmp\svnignore $file
}

foreach($file in @("dom","commandline","fixture","service","webapp")) {
  svn add $file/src
}

svn add README.txt
svn add .umlproject
svn add carserv.uml
svn add dom/.umlproject
svn add dom/reverse_settings.xml
svn add dom/carserv-dom.uml

svn add commandline/ide
svn add commandline/config

svn add webapp/ide

cd -
