[Python-Dev] Expose Subversion revision number to Python

Phillip J. Eby pje at telecommunity.com
Fri Dec 16 22:34:23 CET 2005


At 10:16 PM 12/16/2005 +0100, Armin Rigo wrote:
>Hi Phillip,
>
>On Fri, Dec 16, 2005 at 11:33:00AM -0500, Phillip J. Eby wrote:
> > >Not if you're happy with "Last Changed Rev":
> > >
> > >     LC_ALL=C svn info | grep -i "last changed rev" | cut -f 4 -d " "
> >
> > You left off the all-important "-R" from "svn info", and the "sort -nr |
> > head -1" at the end.  The "Last Changed Rev" of the root is not 
> necessarily
> > the highest "Last Changed Rev", no matter how or where you update or check
> > out.  Try it and see.
>
>I was proposing this line as a slight extension of the one currently in
>the SF patch.  In accordance with Martin I am still unconvinced that
>'svn info -R' or more fancy tools are really useful here.
>
>If you meant that the following situation is possible:
>
>     trunk$  svn up
>     At revision xxx.
>     trunk$  svn info
>     Last Changed Rev: 10000
>     trunk$  cd Python
>     trunk/python$  svn info
>     Last Changed Rev: 10001
>
>then I object.  As far as I can tell this is not possible.

It is indeed possible for a file's "Last Changed Rev" to exceed that of the 
directory that contains it.  I'm not sure what you object to, 
though.  These are simply the facts of how Subversion operates, so 
objecting to anybody but the Subversion developers won't help.  ;)

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, and updating a 
directory can cause its "Revision" to advance even when there has been no 
change to the source.




More information about the Python-Dev mailing list