[Python-Dev] Expose Subversion revision number to Python

Fredrik Lundh fredrik at pythonware.com
Fri Dec 16 22:53:02 CET 2005


Phillip J. Eby wrote:
> I have not found any way to establish a stable "revision number" for a
> directory tree in Subversion except by using -R and "Last Changed Rev" (or
> the equivalent scanning of .svn/entries files).  Through my experience
> working on setuptools in the sandbox, it is clearly possible to *commit*
> changes without affecting a directory's "Revision" number

it's also possible to modify files and rebuild.  your approach doesn't
address that.

> and updating a directory can cause its "Revision" to advance even when
> there has been no  change to the source.

sure, but is that really relevant?  checking out that revision will give you the
same code base, and it's not exactly difficult to figure out what's changed be-
tween two given versions...

fwiw, the official way to do this is to use svnversion:

    http://subversion.tigris.org/faq.html#version-value-in-source

(this also looks for local changes).

</F>





More information about the Python-Dev mailing list