diff options
author | Bogdano Arendartchuk <bogdano@mandriva.org> | 2007-12-12 15:15:25 +0000 |
---|---|---|
committer | Bogdano Arendartchuk <bogdano@mandriva.org> | 2007-12-12 15:15:25 +0000 |
commit | 03a5fc9e42f30adfff07d2468b8593c1cc9969d4 (patch) | |
tree | a23debf636ef7f2e54c6486362df996a6123349e | |
parent | 4eea70a2f212a3cf20975f63ad15597da37d40c9 (diff) | |
download | mgarepo-03a5fc9e42f30adfff07d2468b8593c1cc9969d4.tar mgarepo-03a5fc9e42f30adfff07d2468b8593c1cc9969d4.tar.gz mgarepo-03a5fc9e42f30adfff07d2468b8593c1cc9969d4.tar.bz2 mgarepo-03a5fc9e42f30adfff07d2468b8593c1cc9969d4.tar.xz mgarepo-03a5fc9e42f30adfff07d2468b8593c1cc9969d4.zip |
Fixed emptylog to be shown when necessary
As emptylog started working again another problem arose: the first release in
most of the packages is SILENTed and result in a emptlog entry. The problem is
that the log gathered from misc/ already contains (in most of the cases, at
least) the version-release with the right message.
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | RepSys/log.py | 47 | ||||
-rw-r--r-- | default.chlog | 6 |
3 files changed, 34 insertions, 23 deletions
@@ -1,3 +1,7 @@ +* 1.6.19.2 +- fixed emptylog message, which was not being shown when needed +- template: hide the first release when it has only invisible lines + * 1.6.19.1 - fixed bad url used when using -v in getsrpm - the fix for the unreleased commits problem in the previous release was diff --git a/RepSys/log.py b/RepSys/log.py index 730c674..8f4bf69 100644 --- a/RepSys/log.py +++ b/RepSys/log.py @@ -164,49 +164,50 @@ def group_releases_by_author(releases): allauthors = [] grouped = [] for release in releases: + + # group revisions of the release by author authors = {} latest = None for revision in release.revisions: authors.setdefault(revision.author, []).append(revision) - # all the mess below is to sort by author and by revision number + # create _Authors and sort them by their latest revisions decorated = [] for authorname, revs in authors.iteritems(): author = _Author() author.name = revs[0].author_name author.email = revs[0].author_email - revdeco = [(r.revision, r) for r in revs] - revdeco.sort(reverse=1) - author.revisions = [t[1] for t in revdeco] + author.revisions = revs revlatest = author.revisions[0] - # keep the latest revision even for silented authors (below) + # keep the latest revision even for completely invisible + # 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 + # only sort those visible authors, invisible ones are used + # only in "latest" continue - decorated.append((revdeco[0][0], author)) + decorated.append((revlatest.revision, author)) + decorated.sort(reverse=1) - if not decorated: - # skipping release with only authors with silented lines - continue + if release.visible: + release.authors = [t[1] for t in decorated] + firstrel, release.authors = release.authors[0], release.authors[1:] + release.author_name = firstrel.name + release.author_email = firstrel.email + release.release_revisions = firstrel.revisions + else: + # we don't care about other possible authors in completely + # invisible releases + firstrev = release.revisions[0] + release.author_name = firstrev.author_name + release.author_email = firstrev.author_email + release.raw_date = firstrev.raw_date + release.date = firstrev.date - decorated.sort(reverse=1) - release.authors = [t[1] for t in decorated] - # the difference between a released and a not released _Release is - # the way the release numbers is obtained. So, when this is a - # released, we already have it, but if we don't, we should get de - # version/release string using getrelease and then get the first - first, release.authors = release.authors[0], release.authors[1:] - release.author_name = first.name - release.author_email = first.email - release.release_revisions = first.revisions - - #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) diff --git a/default.chlog b/default.chlog index aff3958..93dcd1b 100644 --- a/default.chlog +++ b/default.chlog @@ -1,5 +1,11 @@ ## Sample Changelog template ## +#if not $releases_by_author[-1].visible + ## Hide the first release that contains no changes. It must be a + ## reimported package and the log gathered from misc/ already should + ## contain a correct entry for the version-release: + #set $releases_by_author = $releases_by_author[:-1] +#end if #for $rel in $releases_by_author * $rel.date $rel.author_name <$rel.author_email> $rel.version-$rel.release + Revision: $rel.revision |