aboutsummaryrefslogtreecommitdiffstats
path: root/RepSys
diff options
context:
space:
mode:
authorBogdano Arendartchuk <bogdano@mandriva.org>2007-05-02 17:28:55 +0000
committerBogdano Arendartchuk <bogdano@mandriva.org>2007-05-02 17:28:55 +0000
commit91700a68924f4b2e97a18f2c3787bd885c36640c (patch)
treee4a7b4c22b2bf37dd3a8ba9329322045408b9adc /RepSys
parent8a62bcc2b2df3c6b8008c91083966ebc470f11ff (diff)
downloadmgarepo-91700a68924f4b2e97a18f2c3787bd885c36640c.tar
mgarepo-91700a68924f4b2e97a18f2c3787bd885c36640c.tar.gz
mgarepo-91700a68924f4b2e97a18f2c3787bd885c36640c.tar.bz2
mgarepo-91700a68924f4b2e97a18f2c3787bd885c36640c.tar.xz
mgarepo-91700a68924f4b2e97a18f2c3787bd885c36640c.zip
Fixed regressions introduced in changelog generation while fixing the
problem of package just imported.
Diffstat (limited to 'RepSys')
-rw-r--r--RepSys/log.py29
1 files changed, 24 insertions, 5 deletions
diff --git a/RepSys/log.py b/RepSys/log.py
index b03e23d..f298e6f 100644
--- a/RepSys/log.py
+++ b/RepSys/log.py
@@ -151,8 +151,10 @@ class _Author:
def group_releases_by_author(releases):
allauthors = []
+ grouped = []
for release in releases:
authors = {}
+ latest = None
for revision in release.revisions:
authors.setdefault(revision.author, []).append(revision)
@@ -165,7 +167,19 @@ def group_releases_by_author(releases):
revdeco = [(r.revision, r) for r in revs]
revdeco.sort(reverse=1)
author.revisions = [t[1] for t in revdeco]
- decorated.append((max(revdeco)[0], author))
+ revlatest = author.revisions[0]
+ # keep the latest revision even for silented authors (below)
+ if latest is None or revlatest.revision > latest.revision:
+ latest = revlatest
+ count = sum(len(rev.lines) for rev in author.revisions)
+ if count == 0:
+ # skipping author with only silented lines
+ continue
+ decorated.append((revdeco[0][0], author))
+
+ if not decorated:
+ # skipping release with only authors with silented lines
+ continue
decorated.sort(reverse=1)
release.authors = [t[1] for t in decorated]
@@ -176,12 +190,17 @@ def group_releases_by_author(releases):
first, release.authors = release.authors[0], release.authors[1:]
release.author_name = first.name
release.author_email = first.email
- release.date = first.revisions[0].date
- release.raw_date = first.revisions[0].raw_date
release.release_revisions = first.revisions
- release.revision = first.revisions[0].revision
- return releases
+ #release.date = first.revisions[0].date
+ release.date = latest.date
+ release.raw_date = latest.raw_date
+ #release.revision = first.revisions[0].revision
+ release.revision = latest.revision
+
+ grouped.append(release)
+
+ return grouped
def group_revisions_by_author(currentlog):