You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Merkle Andreas <An...@newtec.de> on 2010/12/08 13:39:28 UTC

Problem with binary files which containing the revision number.

Hi,

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.

Best regards
Andreas


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

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Merkle Andreas,
am Mittwoch, 8. Dezember 2010 um 15:37 schrieben Sie:

> That's a workaround for the binary files, which contains the keywords as plain text. Ok.
> But it is not really safe ... there is still a probability that the
> binary will be corrupt afterwards.
> And it doesn't work for all the other binary files, e.g. schematics, etc.

It should be the best solution one can get, because there can't be a
more general solution for any binary file out there without knowing
each file format.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning
AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig
 
Telefon: Potsdam: 0331-743881-0
E-Mail:  tschoening@am-soft.de
Web:     http://www.am-soft.de

AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow

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

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Dec 8, 2010, at 08:37, Merkle Andreas wrote:

> Ryan Schmidt wrote:
> 
>> 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
> 
> That's a workaround for the binary files, which contains the keywords as plain text. Ok.

I'd say what you're proposing, trying to divine the revision before it's committed, is a workaround, or more, a hack. There's no 100% accurate way to guarantee what revision you'll get, before you've gotten it.

Using the $Id$ or $Rev$ keywords isn't a workaround, it's the correct solution; this is a supported feature of Subversion.

> But it is not really safe ... there is still a probability that the binary will be corrupt afterwards.

Well, only if you think the string "$Id::" (or "$Rev::") is likely to appear in the binary representation of the file elsewhere than where you typed it. It depends on the specific binary format of course, so you can only know by trying it out. I would feel OK using this in Word documents, since the book suggests keywords can be used in Word documents, and others on the list have over the years reported this working in Word documents, and I haven't heard of any corruption reported.

> And it doesn't work for all the other binary files, e.g. schematics, etc.

Ah, that's too bad. I guess whatever format the schematic files are in doesn't store the text you type in the document in plain text in the binary representation. Then I don't have a solution for those types of files.



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

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Merkle Andreas,
am Mittwoch, 8. Dezember 2010 um 15:37 schrieben Sie:

> That's a workaround for the binary files, which contains the keywords as plain text. Ok.
> But it is not really safe ... there is still a probability that the
> binary will be corrupt afterwards.
> And it doesn't work for all the other binary files, e.g. schematics, etc.

It should be the best solution one can get, because there can't be a
more general solution for any binary file out there without knowing
each file format.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning
AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig
 
Telefon: Potsdam: 0331-743881-0
E-Mail:  tschoening@am-soft.de
Web:     http://www.am-soft.de

AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow


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

Posted by Merkle Andreas <An...@newtec.de>.
That's a workaround for the binary files, which contains the keywords as plain text. Ok.
But it is not really safe ... there is still a probability that the binary will be corrupt afterwards.
And it doesn't work for all the other binary files, e.g. schematics, etc.

Anyway thanks for the idea.


> 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


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

Posted by Ryan Schmidt <su...@ryandesign.com>.
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


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

Posted by Ulrich Eckhardt <ul...@dominolaser.com>.
On Wednesday 08 December 2010, I wrote:
> use tags in a separate tag repository.
                             ^^^^^^^^^^
That's supposed to read "directory", of course.

Uli

-- 
ML: http://subversion.apache.org/docs/community-guide/mailing-lists.html
FAQ: http://subversion.apache.org/faq.html
Docs: http://svnbook.red-bean.com/


**************************************************************************************
Domino Laser GmbH, Fangdieckstraße 75a, 22547 Hamburg, Deutschland
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
**************************************************************************************
Visit our website at <http://www.dominolaser.com/>
**************************************************************************************
Diese E-Mail einschließlich sämtlicher Anhänge ist nur für den Adressaten bestimmt und kann vertrauliche Informationen enthalten. Bitte benachrichtigen Sie den Absender umgehend, falls Sie nicht der beabsichtigte Empfänger sein sollten. Die E-Mail ist in diesem Fall zu löschen und darf weder gelesen, weitergeleitet, veröffentlicht oder anderweitig benutzt werden.
E-Mails können durch Dritte gelesen werden und Viren sowie nichtautorisierte Änderungen enthalten. Domino Laser GmbH ist für diese Folgen nicht verantwortlich.
**************************************************************************************


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

Posted by Ulrich Eckhardt <ul...@dominolaser.com>.
On Wednesday 08 December 2010, 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.

I'd say the general advise is not to use the repository's revision numbers. 
These are for the repo's internal bookkeeping. If you want to assign names 
(like the different revisions of a document), then use tags in a separate tag 
repository.

Uli

-- 
ML: http://subversion.apache.org/docs/community-guide/mailing-lists.html
FAQ: http://subversion.apache.org/faq.html
Docs: http://svnbook.red-bean.com/


**************************************************************************************
Domino Laser GmbH, Fangdieckstraße 75a, 22547 Hamburg, Deutschland
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
**************************************************************************************
Visit our website at <http://www.dominolaser.com/>
**************************************************************************************
Diese E-Mail einschließlich sämtlicher Anhänge ist nur für den Adressaten bestimmt und kann vertrauliche Informationen enthalten. Bitte benachrichtigen Sie den Absender umgehend, falls Sie nicht der beabsichtigte Empfänger sein sollten. Die E-Mail ist in diesem Fall zu löschen und darf weder gelesen, weitergeleitet, veröffentlicht oder anderweitig benutzt werden.
E-Mails können durch Dritte gelesen werden und Viren sowie nichtautorisierte Änderungen enthalten. Domino Laser GmbH ist für diese Folgen nicht verantwortlich.
**************************************************************************************