[PEAK] setuptools and subversion 1.4

Marc-Antoine Parent maparent at acm.org
Sun Sep 17 00:31:07 EDT 2006


Good day!
Hope this is the right place to post this.
You may know that subversion now has a different entries file
format... And that the code in get_svn_revision breaks on checkouts
that have been updated to the new format.
I did a quick hack to make it work; it probably needs improvements
(caching the split(), for example) but as an emergency measure it
might do.
I think that, as a more robust, strategy, you might consider calling
'svn info' and parsing the result. It can be done even if the net is
down.
Cheers,
Marc-Antoine


Index: setuptools/command/egg_info.py
===================================================================
--- setuptools/command/egg_info.py      (revision 51897)
+++ setuptools/command/egg_info.py      (working copy)
@@ -193,14 +193,20 @@
             f = open(os.path.join(base,'.svn','entries'))
             data = f.read()
             f.close()
-            dirurl = urlre.search(data).group(1)    # get repository URL
+            if data[0] == '8':
+                dirurl = data.split('\n')[4]
+            else:
+                dirurl = urlre.search(data).group(1)    # get repository URL
             if base==os.curdir:
                 base_url = dirurl+'/'   # save the root url
             elif not dirurl.startswith(base_url):
                 dirs[:] = []
                 continue    # not part of the same svn tree, skip it
-            for match in revre.finditer(data):
-                revision = max(revision, int(match.group(1)))
+            if data[0] == '8':
+                revision = max(revision, int(data.split('\n')[10]))
+            else:
+                for match in revre.finditer(data):
+                    revision = max(revision, int(match.group(1)))
         return str(revision or get_pkg_info_revision())

     def find_sources(self):



More information about the PEAK mailing list