There is a command in svn commandline tools for exactly this:
svnversion [path_to_workingcopy]
It returns the current revision number of the working copy (or current dir, if arg is omitted). If working copy is modified, mixed or sparse checked out, it will output this as well. Excerpt from the documentation available via --help cmd-switch:
4123:4168 mixed revision working copy
4168M modified working copy
4123S switched working copy
4123P partial working copy, from a sparse checkout
4123:4168MS mixed revision, modified, switched working copy
So you can just invoke svnversion in your buildscript and either process the output or put it into a file and read this file.