subversion 1.5 で checkout した Trac plugin を setup.py bdist_egg したらエラーになった…の続きの続き

前回で結局うまくいかなかったわけで。

checkout しているのは http://svn.python.org/projects/sandbox/branches/setuptools-0.6@r65197

調べると setuptools/command/sdist.py には subversion 1.5 用のコードがあるけど、setuptools/command/egg_info.py はそのままになっている。

Index: setuptools/command/egg_info.py
===================================================================
--- setuptools/command/egg_info.py      (revision 65196)
+++ setuptools/command/egg_info.py      (working copy)
@@ -217,7 +217,7 @@
             data = f.read()
             f.close()

-            if data.startswith('8'):
+            if data.startswith('9') or data.startswith('8'):
                 data = map(str.splitlines,data.split('\n\x0c\n'))
                 del data[0][0]  # get rid of the '8'
                 dirurl = data[0][3]

このパッチをあてると bdist_egg でリビジョン番号が扱えるようになった。

参考: issue2770: Subversion 1.5 Working Copies Break Setuptools