From 811182ed59bb1b233e2c4589ce15133bd5dad4e5 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Sat, 16 Jul 2005 16:43:02 +0000 Subject: Fix only detecting the revision number of the setup directory, not the highest revision number for the project as a whole. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041129 --- setuptools/command/egg_info.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'setuptools/command') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 68e2fefb..5e5686a3 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -134,13 +134,16 @@ class egg_info(Command): def get_svn_revision(self): - stdin, stdout = os.popen4("svn info"); stdin.close() + stdin, stdout = os.popen4("svn info -R"); stdin.close() result = stdout.read(); stdout.close() import re - match = re.search(r'Last Changed Rev: (\d+)', result) - if not match: + revisions = [ + int(match.group(1)) + for match in re.finditer(r'Last Changed Rev: (\d+)', result) + ] + if not revisions: raise DistutilsError("svn info error: %s" % result.strip()) - return match.group(1) + return str(max(revisions)) def write_toplevel_names(self): @@ -159,9 +162,6 @@ class egg_info(Command): - - - def write_namespace_packages(self): nsp = getattr(self.distribution,'namespace_packages',None) if nsp is None: -- cgit v1.2.1