Question

We have a custom font (ttf) that we added to a subversion repository. We've detected a problem with certain characters and are not sure when the problem was introduced. The file is of course a binary file, so there are no text differences to compare, we just needed contain it with the other project files and version it. Anyhow, I'd like to retrieve all versions of the file from the repository. I've got access to TortoiseSVN (for Windows) and Cornerstone (for Mac); however, I'm also comfortable using the Terminal. How can I retrieve a ttf file for every version of the font that got checked into subversion?

Was it helpful?

Solution

This is a little crude and I'm sure there are much more elegant solutions out there but it does the job. Set GRAB_FILE and GRAB_FROM_REV appropriately.

$ mkdir versions
$ GRAB_FILE="MGSource.h"
$ GRAB_FROM_REV=700
$ for i in `svn log -r$GRAB_FROM_REV:HEAD "$GRAB_FILE" | grep -o '^r[0123456789]*'`; do svn up "$GRAB_FILE" -$i; cp $GRAB_FILE versions/"$GRABFILE.$i.h"; done  

Updated to revision 768.
U    MGSource.h
Updated to revision 770.
U    MGSource.h
Updated to revision 804.
U    MGSource.h
Updated to revision 821.

$ ls -l versions/
total 56
-rw-r--r--  1 me    staff  1599 Mar 18 21:03 MGSource.r709.h
-rw-r--r--  1 me    staff  1705 Mar 18 21:03 MGSource.r759.h
-rw-r--r--  1 me    staff  1891 Mar 18 21:03 MGSource.r760.h
-rw-r--r--  1 me    staff  1882 Mar 18 21:03 MGSource.r768.h
-rw-r--r--  1 me    staff  2009 Mar 18 21:03 MGSource.r770.h
-rw-r--r--  1 me    staff  2009 Mar 18 21:03 MGSource.r804.h
-rw-r--r--  1 me    staff  1942 Mar 18 21:03 MGSource.r821.h

OTHER TIPS

If you're using TortoiseSVN, you can get this very easy:

Show the log for the font file. You will see a list of revisions where that particular file was changed. Right-click on any of those revisions, then just choose "Save as..." from the context menu and you'll get the file as it was in that revision.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top