]> granicus.if.org Git - icinga2/commitdiff
Add the category to the generated changelog
authorMichael Friedrich <michael.friedrich@netways.de>
Wed, 11 May 2016 14:52:52 +0000 (16:52 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Wed, 11 May 2016 14:53:41 +0000 (16:53 +0200)
fixes #11768

changelog.py

index 8ad0a0155abc38e75725964eda5ab6ba74bdff10..64c8cb58a8002a606afc514b5f4410e5c3836cfc 100755 (executable)
@@ -43,14 +43,14 @@ def format_header(text, lvl, ftype = ftype):
 def format_logentry(log_entry, args = args, issue_url = ISSUE_URL):
    if args.links:
        if args.html:
-           return "<li> {0} <a href=\"{3}{1}\">{1}</a>: {2}</li>".format(log_entry[0], log_entry[1], log_entry[2], issue_url)
+           return "<li> {0} <a href=\"{4}{1}\">{1}</a> ({2}): {3}</li>".format(log_entry[0], log_entry[1], log_entry[2], log_entry[3],issue_url)
        else:
-           return "* {0} [{1}]({3}{1} \"{0} {1}\"): {2}".format(log_entry[0], log_entry[1], log_entry[2], issue_url)
+           return "* {0} [{1}]({4}{1} \"{0} {1}\") ({2}): {3}".format(log_entry[0], log_entry[1], log_entry[2], log_entry[3], issue_url)
    else:
        if args.html:
-           return "<li>%s %d: %s</li>" % log_entry
+           return "<li>%s %d (%s): %s</li>" % log_entry
        else:
-           return "* %s %d: %s" % log_entry
+           return "* %s %d (%s): %s" % log_entry
 
 def print_category(category, entries):
     if len(entries) > 0:
@@ -135,7 +135,13 @@ while True:
             if ignore_issue:
                 continue
 
-        entry = (issue["tracker"]["name"], issue["id"], issue["subject"].strip())
+        if "category" in issue:
+            category = issue["category"]["name"]
+        else:
+            category = "no category"
+
+        # the order is important for print_category()
+        entry = (issue["tracker"]["name"], issue["id"], category, issue["subject"].strip())
 
        if issue["tracker"]["name"] == "Feature":
             features.append(entry)