Thank you Daniel for your fast and exaustive reply.
Regards
Valentina

Il giorno gio 5 gen 2023 alle ore 15:47 Daniel Sahlberg via TortoiseSVN <
[email protected]> ha scritto:

> torsdag 5 januari 2023 kl. 15:33:02 UTC+1 skrev
> [email protected]:
>
>> I would like to print the value of the Revision property into a docx and
>> xlsx file.
>> I added the property form windows context menu properties --> subversion
>> --> properties --> new --> keyword --> revision .
>> I wrote into the file/cell  $Rev$
>> but, after a commit,  I can't see the value of the revision.
>> This process is fine for txt file.
>>
>> Could you help me?
>> Thank you
>>
>
> docx and xlsx are binary file formats (zipped XML files to be more
> precise). Subversion is looking for "$Rev$" within the file but it is very
> unlikely you will find it in clear in the file. And in either case if
> Subversion would replace it, chances are that the ZIP file will be corrupt
> afterwards. Don't set the svn:keywords property on binary files!
>
> I can't see an easy way to add the revision number within a document.
>
> One way would be to add a pre-commit script using the COM interfaces of
> Word and Excel to open the file and Search/replace the $Rev$ identifier.
> But that will only add the latest known revision to the document, which is
> not the same as the revision you will get after commit. (It is not even
> assured you will get "latest known + 1" since another commit might be going
> on in the background and the one finishing first will get the next rev
> number).
>
> Another way would be to do a post-update and/or post-commit script that
> does the same (this is similar to what Subversion is doing with the
> automatic keyword expansion), but you will end up with locally modified
> files which might be a showstopper in case someone else modifies the file
> in the repository. (Subversion handles this on text files since it
> translates/detranslates the $Rev$ keyword before talking to the repository).
>
> Kind regards,
> Daniel
>
> --
> You received this message because you are subscribed to the Google Groups
> "TortoiseSVN" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tortoisesvn/2815657c-d0dd-40a3-bd91-7a02daa4ee23n%40googlegroups.com
> <https://groups.google.com/d/msgid/tortoisesvn/2815657c-d0dd-40a3-bd91-7a02daa4ee23n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"TortoiseSVN" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tortoisesvn/CACb4D9mMFmQEv%3DJv0KrNHvB4qQtXH0rAGPzJo6znEwx-%3Dr0yMQ%40mail.gmail.com.

Reply via email to