I messed up on my SVN repository and now need to revert the entire repository from revision 28 to 24 and don\'t want to deal with diffs or conflicts. Is there a quick and si
For anyone using TortoiseSVN, the solution is simple:
This method preserves the version history (i.e. all of the revisions that you reverted).
Could you svn del
the topmost directories, then svn copy
them:
svn copy svnurl@version svnurl
Check out svnadmin dump/load. It creates a text file with every version of your files. It may be possible to delete everything above/below a certain point and re-import it.
See for instance Migrating Repository Data Elsewhere
If you do not avail admin rights then you cannot obliterate any old revisions BUT you can still hide them extremely well with just one amazingly simple "svn copy" command (nickf and JesperE already mentioned this but in a rather cryptic way)
svn delete protocol://svnserver/some/resource
svn copy protocol://svnserver/some/resource@24 protocol://svnserver/some/resource
And that's it, revisions 25 to 28 have completely disappeared from svn log. It's not a hack at all, it is a safe and (barely...) documented feature.
If "resource" is a directory then you must strip it from the last URL:
svn copy protocol://svnserver/some/directory@24 protocol://svnserver/some/
(otherwise you would copy it inside itself)
I hate to say this, but that is a situation where I've found myself using backups of my svn repository.
Can you copy files of a certain revision to a new directory within the repository?
I'm not entirely sure if this work as I haven't used it in a live production yet, but I just now tried on a test repository (I copied one of my production ones) and it seems to work.
When you're in your repository, use the following command:
svn update -r 24 trunk
Where 24 is the revision number, and trunk is the file/folder you'd like to update (or restore, in this case) to said revision number.
In my test, several files were updated and (re-)added, and after doing a commit I did not receive any warnings whatsoever. I then modified a file with some dummy text and tried yet another commit, and only said file popped up on the modified list. So it seems to work rather well!
Again, I didn't use this before in live productions, so if I'm wrong please advice. I'd love to know if this is the way to go, too, because I can see myself needing this in the (near) future.
-Dave