[Python-Dev] Expose Subversion revision number to Python (original) (raw)
Phillip J. Eby pje at telecommunity.com
Fri Dec 16 07:38:53 CET 2005
- Previous message: [Python-Dev] Expose Subversion revision number to Python
- Next message: [Python-Dev] Expose Subversion revision number to Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 12:16 AM 12/16/2005 -0500, Barry Warsaw wrote:
SF patch # 1382163 is a fairly simple patch to expose the Subversion revision number to Python, both in the PyGetBuildInfo() text, and in a new PyGetBuildNumber() C API function, and via a new sys.buildnumber attribute. This number is calculated from the output of "svn info" at the top of the tree.
FYI, this is not the true revision number; it's only the revision number in which the directory was last modified, not the latest revision number within the tree.
You probably want to do a bit more processing of "svn info -R", or else parse the .svn/entries files yourself. There's some Python code that does this at:
http://svn.python.org/projects/sandbox/trunk/setuptools/setuptools/command/egg_info.py
Specifically, see the 'get_svn_revision' method for an example of processing .svn/entries files to find out the highest committed revision number in a source tree.
- Previous message: [Python-Dev] Expose Subversion revision number to Python
- Next message: [Python-Dev] Expose Subversion revision number to Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]