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

RE: keyword text substitution

From: Peter Dulimov <PeterDu_at_resmed.com.au>
Date: 2006-10-04 00:35:24 CEST

> -----Original Message-----
> From: Dan Crosta [mailto:dcrosta@gmail.com]
> Sent: Tuesday, 3 October 2006 2:38 AM
> To: users@subversion.tigris.org
> Subject: keyword text substitution
>
>
> I've been working on a project for a while, and would like to have
> development copies have a version number like 0.1.<revision #>. This
> is python, so I've been setting a variable __version__ in an
> __init__.py file in the package directory for this project. I had used
> the line:
>
> __version__ = '0.1.%s' % ('$Rev$'.split(' ')[1])
>
> which I thought was pretty clever, except that it doesn't work --
> because the line only gets updated by svn whenever the file gets
> updated, not whenver you run 'svn update' on the working copy it lives
> in. since there's not much besides license text and a few metadata
> variables in this __init__.py file, it won't get updated frequently,
> and so the version string will pretty much always be out of date.
>
> is there a way (some svn keyword perhaps?) that i can make subversion
> redo this substitution every time an svn update or svn commit happens?
> (are there any other commands that can change the revision of a
> working copy?) or am i barking up the wrong tree?
>
> thanks,
> - d
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>

TortoiseSVN has a utility called subwcrev that seems to achieve the purpose
that you are trying to achieve, although by a different mechanism. I have
an ugly hacked up version of that code that compiles on Linux if you're not
a Windows user.

Peter.

Warning: Copyright ResMed. Where the contents of this email and/or attachment includes materials prepared by ResMed, the use of those
materials is subject exclusively to the conditions of engagement between ResMed and the intended recipient.
 
This communication is confidential and may contain legally privileged information.
By the use of email over the Internet or other communication systems, ResMed is not waiving either confidentiality of, or legal
privilege in,the content of the email and of any attachments.
If the recipient of this message is not the intended addressee, please call ResMed immediately on +61 2 8884 1000 Sydney, Australia.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Oct 4 00:36:04 2006

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.