subversion revision number string within an application packaged with distutils?

"Martin v. Löwis" martin at v.loewis.de
Fri Dec 8 01:30:41 EST 2006


Jim Tittsler schrieb:
> Is there a standard recipe for getting the subversion revision number
> into my Python-based application each time I package it up with
> distutils?  (Not just the package name, but also a string that I will
> display in my app's "About" dialog.)

You can't really use subversion's keyword substitution for that
(contrary to what Gabriel Genellina suggested): a $Revision$
field will only be updated to the revision in which the file
containing it changed. If you want the repository version at
the time of the packaging, you can use the svnversion tool.
On Windows, you can alternatively also use the subwcrev.exe
tool that comes with Tortoise.

If you don't want to invoke an external tool, you could also
retrieve the same information with the subversion Python
bindings.

Regards,
Martin



More information about the Python-list mailing list