tags:

views:

1537

answers:

3

Hi, I have some code documentation in MS Powerpoint 2003 that I'm revision-controlling in an SVN repository. I'd like to auto-insert the latest revision number into this document whenever I open it. I am using TortoiseSVN. I've been able to google up a macro or two that might work but wanted advice from experts. :) Thanks!

+2  A: 

I think it should be possible to use the $Rev$ macro inside it with the Office 2007 XML formats, but I am not too sure what will happen with older formats that might contain binary data. You might need to tweak svn settings a bit so it sees .ppt files as text and not binary for this to work, I am not sure what is the default behavior. See svn:mime-type for this : http://svnbook.red-bean.com/en/1.2/svn.advanced.props.html

Read this for detailed infos on $Rev$ replacement: http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html

Seldaek
+1  A: 

I believe SVN Won't touch binary files, and chances are if you embedded a $REV$ string in it something would break.

I know nothing about "Office Macros" either, but it would probably be preferable to

  1. Have a text file with that revision string.
  2. Have an office macro copy the previous revision string ( sans $REV$ for safteys sake ) Into the office file prior to saving.
  3. Have the same office-macro that injects random garbage into textfile #1 every time the file is saved.

Its better IMO to write the rev string into the document on /save/ because that will eliminate the need for extra commits just for the sake of putting a revision string in the file, and it will also reduce dependency on that revision file in the event you share this PPT around without the aforementioned text file present.

Kent Fredric
Actually, subversion does handle binary files, it's just it won't attempt to merge new version with current, nor will it show the diffs or "blame": http://subversion.tigris.org/faq.html#binary-files
Joe Pineda
A: 

If you like to use "keyword expansion" with binary files (e.g. .doc) you have to use the following format:

$keyword::____________________$** (underscore = space)

The :: ensures that the number of characters are always the same, otherwise you'll corrupt the binary word file.

But this only works until Word 2003.

This will not work for Word 2007 because a .docx file is a ZIP file containing word data (e.g. xml). But it does not make sense to embed something directly into the ZIP content.

Maybe in the future there will be a SVN contribution which does the trick also for .docx file ;-)