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

keyword text substitution

From: Dan Crosta <dcrosta_at_gmail.com>
Date: 2006-10-02 18:37:49 CEST

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?

- d

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Oct 2 18:38:28 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.