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

Re: Add subversion rev number in committed file

From: Ulrich Eckhardt <eckhardt_at_satorlaser.com>
Date: Tue, 5 Aug 2008 18:09:11 +0200

On Tuesday 05 August 2008, CAVAILLES Philippe wrote:
> Does someone know if it is possible to add the subversion revision
> number in committed files?

You can use keyword replacements, which are described in the book.

> I have tried to use a pre-commit hook script. I succeed to extract the
> revision number (by using svnlook) and the list of updated/added files,
> but I don't knows how to modify the "committed" files with the extracted
> revision number before termination of the commit action.

This is a bad idea in general: you are actually modifying a commit which means
that the original author
 - is only one of the authors
 - only tested part of the changes that were written
 - and their copy now differs from what is actually contained in the
   repository.

Note that this is just in general. Keyword replacement is done while checking
out, transparently removed while checking in and automatically updated at the
client's side, otherwise it faces similar problems.

Generally, when people think they need the repositories revision number they
are doing something wrong. Typically, they should rather use named tags and
leave the repository revision for tracking of repository specific things.

However, it depends on what you need, so if you tell us what you want instead,
you might get better answers.

cheers

Uli

-- 
ML: http://subversion.tigris.org/mailing-list-guidelines.html
FAQ: http://subversion.tigris.org/faq.html
Docs: http://svnbook.red-bean.com/
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
**************************************************************************************
           Visit our website at <http://www.satorlaser.de/>
**************************************************************************************
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. Sator Laser GmbH ist für diese Folgen nicht verantwortlich.
**************************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-08-05 18:25:13 CEST

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.