← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~huwshimi/launchpad/email-tag-order-645962 into lp:launchpad

 

Huw Wilkins has proposed merging lp:~huwshimi/launchpad/email-tag-order-645962 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #645962 in Launchpad itself: "Tag changes in emails a little awkward"
  https://bugs.launchpad.net/launchpad/+bug/645962

For more details, see:
https://code.launchpad.net/~huwshimi/launchpad/email-tag-order-645962/+merge/68207

In email notifications of tag changes on a bug it used to show "Tags added" before "Tags removed". This is the opposite of how we expect to read these changes; it was telling the story in reverse.
-- 
https://code.launchpad.net/~huwshimi/launchpad/email-tag-order-645962/+merge/68207
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~huwshimi/launchpad/email-tag-order-645962 into lp:launchpad.
=== modified file 'lib/lp/bugs/adapters/bugchange.py'
--- lib/lp/bugs/adapters/bugchange.py	2011-05-18 13:00:11 +0000
+++ lib/lp/bugs/adapters/bugchange.py	2011-07-18 03:18:28 +0000
@@ -594,12 +594,12 @@
         removed_tags = old_tags.difference(new_tags)
 
         messages = []
+        if len(removed_tags) > 0:
+            messages.append(
+                "** Tags removed: %s" % " ".join(sorted(removed_tags)))
         if len(added_tags) > 0:
             messages.append(
                 "** Tags added: %s" % " ".join(sorted(added_tags)))
-        if len(removed_tags) > 0:
-            messages.append(
-                "** Tags removed: %s" % " ".join(sorted(removed_tags)))
 
         return {'text': "\n".join(messages)}
 

=== modified file 'lib/lp/bugs/doc/bug-change.txt'
--- lib/lp/bugs/doc/bug-change.txt	2011-05-18 13:00:11 +0000
+++ lib/lp/bugs/doc/bug-change.txt	2011-07-18 03:18:28 +0000
@@ -383,8 +383,8 @@
 Addtions and removals are expressed separately in the notification.
 
     >>> print tags_change.getBugNotification()['text']
+    ** Tags removed: first-tag
     ** Tags added: zillionth-tag
-    ** Tags removed: first-tag
 
 
 === BugSecurityChange ===

=== modified file 'lib/lp/bugs/doc/bugnotification-email.txt'
--- lib/lp/bugs/doc/bugnotification-email.txt	2011-05-27 19:53:20 +0000
+++ lib/lp/bugs/doc/bugnotification-email.txt	2011-07-18 03:18:28 +0000
@@ -272,8 +272,8 @@
     ...     notification = change.getBugNotification()
     ...     print notification['text'] #doctest: -NORMALIZE_WHITESPACE
     ...     print "-----------------------------"
+    ** Tags removed: bar
     ** Tags added: baz
-    ** Tags removed: bar
     -----------------------------