aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/egg_info.py
diff options
context:
space:
mode:
authorPhilip Thiem <ptthiem@gmail.com>2013-06-28 21:55:47 -0500
committerPhilip Thiem <ptthiem@gmail.com>2013-06-28 21:55:47 -0500
commitd26d42296c45c25703e7c1fb76bf78fc5aa8347e (patch)
treef6e751e081c76ec477206d4dd943dd1e51dee4d1 /setuptools/command/egg_info.py
parent72495bf98af2c556721126fceff8a5e7d8283a91 (diff)
downloadexternal_python_setuptools-d26d42296c45c25703e7c1fb76bf78fc5aa8347e.tar.gz
external_python_setuptools-d26d42296c45c25703e7c1fb76bf78fc5aa8347e.tar.bz2
external_python_setuptools-d26d42296c45c25703e7c1fb76bf78fc5aa8347e.zip
Quick addition to get past svn test in another package.
--HG-- extra : rebase_source : a36601a66f574d7c0919b7c885dcae7b820bb7dd
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-xsetuptools/command/egg_info.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index 642687b2..7daaee0f 100755
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -15,6 +15,9 @@ from pkg_resources import parse_requirements, safe_name, parse_version, \
safe_version, yield_lines, EntryPoint, iter_entry_points, to_filename
from setuptools.command.sdist import walk_revctrl
+#requires python >= 2.4
+from subprocess import Popen as _Popen, PIPE as _PIPE
+
class egg_info(Command):
description = "create a distribution's .egg-info directory"
@@ -216,6 +219,8 @@ class egg_info(Command):
revision = 0
urlre = re.compile('url="([^"]+)"')
revre = re.compile('committed-rev="(\d+)"')
+ urlre11 = re.compile('<url>([^<>]+)</url>')
+ revre11 = re.compile('<commit\s+[^>]*revision="(\d+)"')
for base,dirs,files in os.walk(os.curdir):
if '.svn' not in dirs:
@@ -236,11 +241,17 @@ class egg_info(Command):
log.warn("unrecognized .svn/entries format; skipping %s", base)
dirs[:] = []
continue
+ elif svnver > 10:
+ p = _Popen(['svn', 'info', '--xml'], stdout=_PIPE, shell=(sys.platform=='win32'))
+ data = unicode(p.communicate()[0], encoding='utf-8')
+ dirurl = urlre11.search(data).group(1)
+ localrev = max([int(m.group(1)) for m in revre11.finditer(data)]+[0])
+ else:
+ data = list(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]
+ localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]]+[0])
- data = list(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]
- localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]]+[0])
if base==os.curdir:
base_url = dirurl+'/' # save the root url
elif not dirurl.startswith(base_url):
@@ -253,6 +264,8 @@ class egg_info(Command):
+
+
def find_sources(self):
"""Generate SOURCES.txt manifest file"""
manifest_filename = os.path.join(self.egg_info,"SOURCES.txt")