From 5ec755581655de76a2ce21fdc9ae5ac502db5f9d Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Tue, 13 Nov 2007 03:55:10 +0000 Subject: =?UTF-8?q?Fixed=20get=5Fsubmit=5Finfo=20to=20use=20the=20new=20SV?= =?UTF-8?q?N=20code.=20-Esta=20linha,=20e=20as=20abaixo,=20ser=C3=A3o=20ig?= =?UTF-8?q?noradas--?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit M RepSys/rpmutil.py --- RepSys/rpmutil.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/RepSys/rpmutil.py b/RepSys/rpmutil.py index 86fb890..4cbba62 100644 --- a/RepSys/rpmutil.py +++ b/RepSys/rpmutil.py @@ -483,33 +483,30 @@ def get_submit_info(path): if not os.path.isdir(os.path.join(path, ".svn")): raise Error, "subversion directory not found" + # Now, extract the package name. svn = SVN() + info = svn.info(path) - - # Now, extract the package name. - for line in svn.info(path): - if line.startswith("URL: "): - url = line.split()[1] - toks = url.split("/") - if len(toks) < 2 or toks[-1] != "current": - raise Error, "unexpected URL received from 'svn info'" - name = toks[-2] - break - else: - raise Error, "URL tag not found in 'svn info' output" + url = info.url + toks = url.split("/") + if len(toks) < 2 or toks[-1] != "current": + raise Error, "invalid package URL %s, needs current/" % url + name = toks[-2] # Finally, guess revision. max = -1 files = [] files.extend(glob.glob("%s/*" % specsdir)) files.extend(glob.glob("%s/*" % sourcesdir)) - for line in svn.info(" ".join(files)): - if line.startswith("Revision: "): - rev = int(line.split()[1]) - if rev > max: - max = rev + for file in files: + info = svn.info(file) + if info is None: # not in working copy + continue + rev = info.commit_revision.number + if rev > max: + max = rev if max == -1: - raise Error, "revision tag not found in 'svn info' output" + raise Error, "unable to find the latest revision" return name, max -- cgit v1.2.1