I have a moderate size repository (around 2500 versions) from a project I've been running in the past 3 years. There is a particular file (let's call it foo.xml) there which I now want to analyse its evolution. Ideally, what I'm looking for, is to export into a directory every versions that file had, appended with the date, e.g.
2007_08_08_foo.xml
2007_08_09_foo.xml
2007_08_15_foo.xml
...
What is the quickest way of achieving this?
Best Answer
I don't think SVN has that functionality built in, but if you are able to run commands on the server that holds the SVN repository (and assuming the server has the standard UNIX/Linux tools available), this bash script should do it for you:
This will produce filenames of the form
2007-08-08_foo.xml
. Of course, you have to change/path/to/repos
in the first line to the actual filesystem path (not a URL) of the repository, anddir/foo.xml
in the second line to the path of the file within the repository.If it's really important to you to have underscores in the date, change line 4 as follows:
Also keep in mind that if the file was ever modified more than once on a given day, only the first edit on each day will actually be reflected in the written files.