#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" -- ${1+"$@"}

set WD [pwd]

set CvsRoot [file join $WD "CVS_REPOSITORY"]
if {[ file isdirectory $CvsRoot ]} {
  file delete -force $CvsRoot
}
if {[ file isdirectory CVSROOT ]} {
  file delete -force CVSROOT
}
set oldirs [glob -nocomplain -- cvs_test*]
foreach od $oldirs {
  puts "Deleting $od"
  file delete -force $od
}

set SvnRoot [file join $WD "SVN_REPOSITORY"]
if {[ file isdirectory $SvnRoot ]} {
  file delete -force $SvnRoot
}
set oldirs [glob -nocomplain -- svn_test*]
foreach od $oldirs {
  puts "Deleting $od"
  file delete -force $od
}
set SvnRoot [file join $WD "SVN_NONCONFORM"]
if {[ file isdirectory $SvnRoot ]} {
  file delete -force $SvnRoot
}
set oldirs [glob -nocomplain -- svnnc_*]
foreach od $oldirs {
  puts "Deleting $od"
  file delete -force $od
}

set RcsRoot [file join $WD "RCS_REPOSITORY"]
if {[ file isdirectory $RcsRoot ]} {
  file delete -force $RcsRoot
}
set oldirs [glob -nocomplain -- rcs_test*]
foreach od $oldirs {
  puts "Deleting $od"
  file delete -force $od
}

set GitRoot [file join $WD "GIT_REPOSITORY.git"]
if {[ file isdirectory $GitRoot ]} {
  file delete -force $GitRoot
}
set oldirs [glob -nocomplain -- git_test*]
foreach od $oldirs {
  puts "Deleting $od"
  file delete -force $od
}
set oldirs [glob -nocomplain -- git_rcs_test*]
foreach od $oldirs {
  puts "Deleting $od"
  file delete -force $od
}
