aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdano Arendartchuk <bogdano@mandriva.org>2008-02-06 01:39:28 +0000
committerBogdano Arendartchuk <bogdano@mandriva.org>2008-02-06 01:39:28 +0000
commit11c6a91f79529e1e6ab029f81f8b1582fff74842 (patch)
treed68192e83a533482754b06019e2f1bcf2c3f6341
parent05810ef9f0e1dc761317f909146f1a201c876a64 (diff)
downloadmgarepo-11c6a91f79529e1e6ab029f81f8b1582fff74842.tar
mgarepo-11c6a91f79529e1e6ab029f81f8b1582fff74842.tar.gz
mgarepo-11c6a91f79529e1e6ab029f81f8b1582fff74842.tar.bz2
mgarepo-11c6a91f79529e1e6ab029f81f8b1582fff74842.tar.xz
mgarepo-11c6a91f79529e1e6ab029f81f8b1582fff74842.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--CHANGES2
-rw-r--r--RepSys/log.py53
-rw-r--r--default.chlog6
3 files changed, 38 insertions, 23 deletions
diff --git a/CHANGES b/CHANGES
index cfed07f..c605e5e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,8 @@
- force svn+ssh:// URLs to be in BatchMode, in order to not have any
interactivity at all with ssh
- fixed incompatibility with Python-2.4 on urlparse
+- fixed emptylog message, which was not being shown when needed
+- template: hide the first release when it has only invisible lines
- fixed bad url used when using -v in getsrpm
- make 'repsys submit' without package name or revision number work again
- if REPSYS_CONF is set, /etc/repsys.conf and ~/.repsys/config will not be
diff --git a/RepSys/log.py b/RepSys/log.py
index 68cbbc0..60cf0d5 100644
--- a/RepSys/log.py
+++ b/RepSys/log.py
@@ -21,6 +21,12 @@ import shutil
locale.setlocale(locale.LC_ALL, "C")
default_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
@@ -174,49 +180,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