Q: SVN - how to revert to oldest version After checking out a repository, I want to revert it to the oldest version. Is there a way to do it? Anything short of running
svn log | grep '|' > log

(I have to do this for multiple folders). And then getting the first word of the last line and then removing the 'r' and then converting it to an integer. And this assumes that no commit messages have '|' in them, which I guess is a safe assumption,  but isn't "correct", as such.
Note: I know how to check out out a specific revision number.
Running svn revert ./* within the directory didn't work either. After doing that, when I ran svn up, it said "At revision __" (latest revision). Running svn co -r works fine

A: You have two problems. The first, is "how do I quickly find the first revision for a directory in the repository". This can probably be solved as in https://stackoverflow.com/questions/2675749/how-do-i-see-the-last-10-commits-in-reverse-chronoligical-order-with-svn using svn log --limit 1 -r1:HEAD which should limit you to the earliest single log message for the directory. This uses "--limit 1" to show only a single message, and "-r1:HEAD" to order the displayed messages from first to last instead of the usual last to first.
The second problem, is "how do I get my working copy to point to a specific revision, once I know the revision?"
As you know, svn co -r123 will get you a NEW working copy at revision 123. If you already have a working copy, you just use svn update -r123 instead, to update your working copy to that revision.
Note that you can also use dates in your revision specifier, as detailed at http://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html#svn.tour.revs.dates . Also a few keywords are supported like HEAD.
