[PEAK] setuptools and subversion 1.4

Lutz Paelike lutz_p at gmx.net
Tue Sep 26 11:53:49 EDT 2006


After upgrading to subversion 1.4 and setuptools 0.6c3
i still have a problem with a svn entries file.
If you wish i can post it to you...


The problem is that whilst determining localrev int() breaks on an empty string.
The following patch solves it for me.

Index: setuptools/command/egg_info.py
===================================================================
--- setuptools/command/egg_info.py      (Revision 52005)
+++ setuptools/command/egg_info.py      (Arbeitskopie)
@@ -221,7 +221,7 @@
                 data = map(str.splitlines,data.split('\n\x0c\n'))
                 del data[0][0]  # get rid of the '8'
                 dirurl = data[0][3]
-                localrev = max([int(d[9]) for d in data if len(d)>9])
+                localrev = max([int(d[9]) for d in data if len(d)>9] and d[9])
             elif data.startswith('<?xml'):
                 dirurl = urlre.search(data).group(1)    # get repository URL
                 localrev = max([int(m.group(1)) for m in revre.finditer(data)])



To discuss this little further..

> Yes, you missed something.  ;)  Older SVN versions don't support the --xml 
> option to "svn info".

The svnversion command summarizes the local revision(s) of a working copy.
see http://svnbook.red-bean.com/en/1.1/re57.html

> 
> (And a second something, which is that the current code will also work 
> correctly if somebody gives a tarball of an SVN checkout to someone else to 
> work on, even if they don't have an SVN client installed, or they have one 
> but it's not on the current PATH, as might be the case with say, a Windows 
> SVN client under Cygwin or a Cygwin client under Windows.)

good point. I was wondering myself why you have chosen to parse the file yourself
instead of relying on svn info or svnversion or even the svn python binding.

Just wondering, have you used any documentation of the entries file format or just figured out yourself
how the file is structured?

Cheers,

Lutz



More information about the PEAK mailing list