aboutsummaryrefslogtreecommitdiffstats
path: root/RepSys
diff options
context:
space:
mode:
Diffstat (limited to 'RepSys')
-rw-r--r--RepSys/log.py16
-rw-r--r--RepSys/svn.py15
2 files changed, 24 insertions, 7 deletions
diff --git a/RepSys/log.py b/RepSys/log.py
index 6e80a13..a7210a6 100644
--- a/RepSys/log.py
+++ b/RepSys/log.py
@@ -239,21 +239,31 @@ def parse_repsys_entry(revlog):
return data
+def get_revision_offset():
+ try:
+ revoffset = config.getint("global", "revision-offset", 0)
+ except (ValueError, TypeError):
+ raise Error, ("Invalid revision-offset number in configuration "
+ "file(s).")
+ return revoffset
+
def svn2rpm(pkgdirurl, rev=None, size=None, submit=False, template=None):
concat = config.get("log", "concat", "").split()
+ revoffset = get_revision_offset()
svn = SVN(baseurl=pkgdirurl)
pkgreleasesurl = os.path.join(pkgdirurl, "releases")
pkgcurrenturl = os.path.join(pkgdirurl, "current")
releaseslog = svn.log(pkgreleasesurl, noerror=1)
- currentlog = svn.log(pkgcurrenturl, start=rev)
- if size is not None:
- currentlog = currentlog[:size]
+ currentlog = svn.log(pkgcurrenturl, limit=size, start=rev,
+ end=revoffset)
lastauthor = None
previous_revision = 0
currelease = None
releases = []
+ # for the emergency bug fixer: the [].sort() is done using the
+ # decorate-sort-undecorate pattern
releases_data = []
for relentry in releaseslog[::-1]:
try:
diff --git a/RepSys/svn.py b/RepSys/svn.py
index 4804a39..e83b072 100644
--- a/RepSys/svn.py
+++ b/RepSys/svn.py
@@ -247,10 +247,10 @@ class SVN:
return output
return None
- def log(self, url, start=None, end=0, **kwargs):
+ def log(self, url, start=None, end=0, limit=None, **kwargs):
cmd = ["log", url]
- if start is not None:
- if type(start) is not type(0):
+ if start is not None or end != 0:
+ if start is not None and type(start) is not type(0):
try:
start = int(start)
except (ValueError, TypeError):
@@ -260,7 +260,14 @@ class SVN:
end = int(end)
except (ValueError, TypeError):
raise Error, "invalid log end revision provided"
- cmd.append("-r %d:%d" % (start, end))
+ start = start or "HEAD"
+ cmd.append("-r %s:%s" % (start, end))
+ if limit is not None:
+ try:
+ limit = int(limit)
+ except (ValueError, TypeError):
+ raise Error, "invalid limit number provided"
+ cmd.append("--limit %d" % limit)
status, output = self._execsvn(*cmd, **kwargs)
if status != 0:
return None