What’s my SVN-working-copy’s version?

/* references: http://stackoverflow.com/questions/1364618/how-do-i-determine-svn-working-copy-layout-version
 *
 * If .svn/format exists, then read the number in it:
 *     Version 7 is SVN 1.3
 *     Version 8 is SVN 1.4
 *     Version 9 is SVN 1.5
 * If .svn/format doesn't exist then the version number is on the first line in .svn/entries:
 *     Version 10 is SVN 1.6
 *     Version 12 is SVN 1.7
 */
 
String workingCopyPath = args[0]
String formatFilePath = workingCopyPath + "\\.svn\\format"
String entriesFilePath = workingCopyPath + "\\.svn\\entries"
 
File formatFile = new File (formatFilePath)
File entriesFile = new File (entriesFilePath)
 
String wcFormat = "unknown"
 
if (formatFile.exists()) {
    println "found format-file, using it..."   
    wcFormat = formatFile.withReader { line = it.readLine() }
}
 
if ( (!formatFile.exists()) && (entriesFile.exists()) ) {
    println "found entries-file, using it..."
    wcFormat = entriesFile.withReader { line = it.readLine() }
}
 
String svnClientVersion
switch (wcFormat){
    case "7" : svnClientVersion="1.3"; break;
    case "8" : svnClientVersion="1.4"; break;
    case "9" : svnClientVersion="1.5"; break;
    case "10" : svnClientVersion="1.6"; break;
    case "12" : svnClientVersion="1.7"; break;
    default : svnClientVersion=">>unknown<<"; break;
}
 
print "Workingcopy was checked out by " + svnClientVersion + "-svn-client"