You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Dan Crosta <dc...@gmail.com> on 2006/10/02 16:37:49 UTC

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

AW: keyword text substitution

Posted by Felix Gilcher <gi...@exozet.com>.
Dan Crosta <ma...@gmail.com> schrieb am Montag, 2. Oktober 2006 18:38:

> 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?

Probably this FAQ item is what you're looking for: http://subversion.tigris.org/faq.html#version-value-in-source

> 
> thanks,
> - d
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org

you're welcome

fg

-- 
Felix Gilcher
Head of IT Development

Exozet Berlin GmbH
Rotherstraße 20
10245 Berlin

eMail: gilcher@exozet.com
URL: www.exozet.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org