[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Problem with binary files which containing the revision number.

From: Ryan Schmidt <subversion-2010d_at_ryandesign.com>
Date: Wed, 8 Dec 2010 07:59:04 -0600

On Dec 8, 2010, at 07:39, Merkle Andreas wrote:

> we have a lot of binary files, e. g. word documents, schematics, etc., which are containing the revision number.
> If such a file is updated, it won’t be possible to estimate the revision which the file really get.
> Example:
> Document A has rev. 10 … now I lock it, update it and write rev. 11 in the document. Now I commit the document,
> but a colleague commits one second before a file to the repository. The problem is that my document
> contains inside now the wrong rev. as text.
> Is it possible somehow to avoid this? The only chance I see at the moment is to lock the whole repository, but that
> is not really a good solution.

If the text you type into the document will appear in the binary file in plain text (as it seems to in Word files for example), then you can use Subversion keywords as you would in any text file. Subversion has fixed-width versions of its keywords that you would use in this case, to ensure that expanding the keyword won't corrupt the file. So just type "$Rev:: $" or "$Id:: $" in your document, and set svn:keywords on that document to that key. Make sure you use double colons after the keyword name so that you get the fixed-width versions, otherwise you will corrupt the file.

See:

http://svnbook.red-bean.com/nightly/en/svn.advanced.props.special.keywords.html
Received on 2010-12-08 14:59:46 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.