aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MANIFEST.in2
-rwxr-xr-xsetuptools/command/egg_info.py5
-rw-r--r--setuptools/tests/entries-v10615
-rw-r--r--setuptools/tests/test_egg_info.py40
4 files changed, 659 insertions, 3 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index 68337800..ff102123 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,6 @@
recursive-include setuptools *.py *.txt *.exe *.xml
recursive-include tests *.py *.c *.pyx *.txt
-recursive-include setuptools/tests *.html
+recursive-include setuptools/tests *.html entries*
recursive-include docs *.py *.txt *.conf *.css *.css_t Makefile indexsidebar.html
recursive-include _markerlib *.py
include *.py
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index cd3ea198..5863d2d4 100755
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -210,7 +210,8 @@ class egg_info(Command):
- def get_svn_revision(self):
+ @staticmethod
+ def get_svn_revision():
revision = 0
urlre = re.compile('url="([^"]+)"')
revre = re.compile('committed-rev="(\d+)"')
@@ -234,7 +235,7 @@ class egg_info(Command):
log.warn("unrecognized .svn/entries format; skipping %s", base)
dirs[:] = []
continue
-
+
data = map(str.splitlines,data.split('\n\x0c\n'))
del data[0][0] # get rid of the '8' or '9' or '10'
dirurl = data[0][3]
diff --git a/setuptools/tests/entries-v10 b/setuptools/tests/entries-v10
new file mode 100644
index 00000000..4446c501
--- /dev/null
+++ b/setuptools/tests/entries-v10
@@ -0,0 +1,615 @@
+10
+
+dir
+89001
+http://svn.python.org/projects/sandbox/branches/setuptools-0.6
+http://svn.python.org/projects
+
+
+
+2013-06-03T17:26:03.052972Z
+89000
+phillip.eby
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6015fed2-1504-0410-9fe1-9d1591cc4771
+
+api_tests.txt
+file
+
+
+
+
+2013-06-19T13:20:47.948712Z
+dec366372ca14fbeaeb26f492bcf5725
+2013-05-15T22:04:59.389374Z
+88997
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+12312
+
+setuptools.egg-info
+dir
+
+README.txt
+file
+
+
+
+
+2013-06-19T13:20:47.948712Z
+26f0dd5d095522ba3ad999b6b6777b92
+2011-05-31T20:10:56.416725Z
+88846
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7615
+
+easy_install.py
+file
+
+
+
+
+2013-06-19T13:20:47.948712Z
+97b52fe7253bf4683f9f626f015eb72e
+2006-09-20T20:48:18.716070Z
+51935
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+126
+
+setuptools
+dir
+
+launcher.c
+file
+
+
+
+
+2013-06-19T13:20:47.924700Z
+e5a8e77de9022688b80f77fc6d742fee
+2009-10-19T21:03:29.785400Z
+75544
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7476
+
+ez_setup.py
+file
+
+
+
+
+2013-06-19T13:20:47.924700Z
+17e8ec5e08faccfcb08b5f8d5167ca14
+2011-01-20T18:50:00.815420Z
+88124
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8350
+
+version
+file
+
+
+
+
+2013-06-19T13:20:47.924700Z
+e456da09e0c9e224a56302f8316b6dbf
+2007-01-09T19:21:05.921317Z
+53317
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1143
+
+setup.py
+file
+
+
+
+
+2013-06-19T13:20:47.924700Z
+d4e5b3c16bd61bfef6c0bb9377a3a3ea
+2013-05-15T22:04:59.389374Z
+88997
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5228
+
+release.sh
+file
+
+
+
+
+2013-06-19T13:20:47.932704Z
+b1fd4054a1c107ff0f27baacd97be94c
+2009-10-28T17:12:45.227140Z
+75925
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1044
+
+pkg_resources.txt
+file
+
+
+
+
+2013-06-19T13:20:47.928702Z
+f497e7c92a4de207cbd9ab1943f93388
+2009-10-12T20:00:02.336146Z
+75385
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+94518
+
+site.py
+file
+
+
+
+
+2013-06-19T13:20:47.932704Z
+ebaac6fb6525f77ca950d22e6f8315df
+2006-03-11T00:39:09.666740Z
+42965
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2362
+
+version.dat
+file
+
+
+
+
+2013-06-19T13:20:47.932704Z
+8e14ecea32b9874cd7d29277494554c0
+2009-10-28T17:12:45.227140Z
+75925
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+80
+
+virtual-python.py
+file
+
+
+
+
+2013-06-19T13:20:47.932704Z
+aa857add3b5563238f0a904187f5ded9
+2005-10-17T02:26:39.000000Z
+41262
+pje
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3898
+
+setup.cfg
+file
+
+
+
+
+2013-06-19T13:20:47.932704Z
+eda883e744fce83f8107ad8dc8303536
+2006-09-21T22:26:48.050256Z
+51965
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+296
+
+setuptools.txt
+file
+
+
+
+
+2013-06-19T13:20:47.940708Z
+11926256f06046b196eaf814772504e7
+2013-05-15T22:04:59.389374Z
+88997
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+149832
+
+pkg_resources.py
+file
+
+
+
+
+2013-06-19T13:20:47.940708Z
+b63a30f5f0f0225a788c2c0e3430b3cf
+2013-05-15T22:04:59.389374Z
+88997
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+90397
+
+tests
+dir
+
+wikiup.cfg
+file
+
+
+
+
+2013-06-19T13:20:47.944710Z
+34ad845a5e0a0b46458557fa910bf429
+2008-08-21T17:23:50.797633Z
+65935
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+136
+
+EasyInstall.txt
+file
+
+
+
+
+2013-06-19T13:20:47.944710Z
+e97387c517f70fc18a377e42d19d64d4
+2013-05-15T22:04:59.389374Z
+88997
+phillip.eby
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+82495
+
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py
new file mode 100644
index 00000000..f26a1f51
--- /dev/null
+++ b/setuptools/tests/test_egg_info.py
@@ -0,0 +1,40 @@
+import os
+import tempfile
+import shutil
+import unittest
+
+import pkg_resources
+from setuptools.command import egg_info
+
+ENTRIES_V10 = pkg_resources.resource_string(__name__, 'entries-v10')
+"An entries file generated with svn 1.6.17 against the legacy Setuptools repo"
+
+class TestEggInfo(unittest.TestCase):
+
+ def setUp(self):
+ self.test_dir = tempfile.mkdtemp()
+ os.mkdir(os.path.join(self.test_dir, '.svn'))
+
+ self.old_cwd = os.getcwd()
+ os.chdir(self.test_dir)
+
+ def tearDown(self):
+ os.chdir(self.old_cwd)
+ shutil.rmtree(self.test_dir)
+
+ def _write_entries(self, entries):
+ fn = os.path.join(self.test_dir, '.svn', 'entries')
+ entries_f = open(fn, 'wb')
+ entries_f.write(entries)
+ entries_f.close()
+
+ def test_version_10_format(self):
+ """
+ """
+ self._write_entries(ENTRIES_V10)
+ rev = egg_info.egg_info.get_svn_revision()
+ self.assertEqual(rev, '89000')
+
+
+def test_suite():
+ return unittest.defaultTestLoader.loadTestsFromName(__name__)