tags 746428 patch
thanks

Hi

Please find a simple patch for this annoying issue attached.

Regards,
robert
>From fb78901e88d940a31ba5192edddb402b91fc876b Mon Sep 17 00:00:00 2001
From: Robert Luberda <rob...@debian.org>
Date: Sat, 12 Mar 2016 10:21:15 +0100
Subject: [PATCH] Merge binnmu entries with regular changelogs (closes:
 #746428)

---
 apt-listchanges.py             | 12 +++++++-----
 apt-listchanges/DebianFiles.py |  8 ++++++++
 debian/changelog               |  7 +++++++
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/apt-listchanges.py b/apt-listchanges.py
index d73affb..df2788a 100755
--- a/apt-listchanges.py
+++ b/apt-listchanges.py
@@ -167,16 +167,18 @@ def main():
     if config.save_seen:
         seen.close()
 
+    # Merge binnmu entries with regular changelog entries.
+    # Assumption: the binnmu version is greater than the last non-binnmu version.
+    for srcpkg in all_binnmus:
+	all_changelogs[srcpackage].merge_binnmu(all_binnmus[srcpackage], config.reverse)
+
     all_news = all_news.values()
     all_changelogs = all_changelogs.values()
-    all_binnmus = all_binnmus.values()
-    for batch in (all_news, all_changelogs, all_binnmus):
+
+    for batch in (all_news, all_changelogs):
         batch.sort(lambda a, b: -cmp(a.urgency, b.urgency) or
                    cmp(a.package, b.package))
 
-    # FIXME: two headers with -h
-    all_changelogs = all_binnmus + all_changelogs
-
     if config.headers:
         changes = ''
         news = ''
diff --git a/apt-listchanges/DebianFiles.py b/apt-listchanges/DebianFiles.py
index 0efc41e..4b3439e 100644
--- a/apt-listchanges/DebianFiles.py
+++ b/apt-listchanges/DebianFiles.py
@@ -257,4 +257,12 @@ class Changes:
         self.changes = changes
         self.urgency = urgency
 
+    def merge_binnmu(self, other, reverse = False):
+	assert self.package == other.package
+	self.urgency = max(self.urgency, other.urgency)
+	if reverse:
+	    self.changes = self.changes + other.changes
+	else:
+	    self.changes = other.changes + self.changes
+
 __all__ = [ 'ControlParser', 'Package' ]
diff --git a/debian/changelog b/debian/changelog
index 8017f6d..a664d6d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+apt-listchanges (2.85.14+local) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Merge binnmu entries with regular changelogs (closes: #746428).
+
+ -- Robert Luberda <rob...@debian.org>  Sat, 12 Mar 2016 10:04:42 +0100
+
 apt-listchanges (2.85.14) unstable; urgency=medium
 
   * Acknowledge NMU; thanks to Ben Hutchings for it; Closes: #718770, #733921,
-- 
2.7.0

Reply via email to