incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [2/3] git commit: [#5383] record label changelog when labels are removed
Date Wed, 12 Dec 2012 17:11:44 GMT
[#5383] record label changelog when labels are removed


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/a08fff4c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a08fff4c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a08fff4c

Branch: refs/heads/db/5383
Commit: a08fff4cb1ca8e774d4ef00d6360c869fc882cc6
Parents: c4fa6ac
Author: Dave Brondsema <dbrondsema@geek.net>
Authored: Wed Dec 12 16:35:59 2012 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Wed Dec 12 17:11:33 2012 +0000

----------------------------------------------------------------------
 .../forgetracker/tests/functional/test_root.py     |   15 +++++++++++++--
 ForgeTracker/forgetracker/tracker_main.py          |    5 ++---
 2 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a08fff4c/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 97c1982..b4c914b 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -299,6 +299,7 @@ class TestFunctionalController(TrackerTestController):
         response = self.app.get('/bugs/1/')
         assert_true('yellow' in response)
         assert_true(u'greén' in response)
+        assert_true('<li><strong>labels</strong>:  --&gt; yellow, greén</li>'
in response)
         self.app.post('/bugs/1/update_ticket',{
             'summary':'zzz',
             'description':'bbb',
@@ -310,8 +311,18 @@ class TestFunctionalController(TrackerTestController):
         })
         response = self.app.get('/bugs/1/')
         assert_true('yellow' in response)
-        # the following assert is no longer true since "green" is shown in changelog
-        # assert_true('green' not in response)
+        assert_true('<li><strong>labels</strong>: yellow, greén --&gt;
yellow</li>' in response)
+        self.app.post('/bugs/1/update_ticket',{
+            'summary':'zzz',
+            'description':'bbb',
+            'status':'ccc',
+            '_milestone':'',
+            'assigned_to':'',
+            'labels':'',
+            'comment': ''
+        })
+        response = self.app.get('/bugs/1/')
+        assert_true('<li><strong>labels</strong>: yellow --&gt; </li>'
in response)
 
     def test_new_attachment(self):
         file_name = 'test_root.py'

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a08fff4c/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index c329c28..bbf4e44 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -1100,10 +1100,9 @@ class TicketController(BaseController):
         changes = changelog()
         comment = post_data.pop('comment', None)
         labels = post_data.pop('labels', None) or []
-        if labels:
-            changes['labels'] = self.ticket.labels
-            changes['labels'] = labels
+        changes['labels'] = self.ticket.labels
         self.ticket.labels = labels
+        changes['labels'] = self.ticket.labels
         for k in ['summary', 'description', 'status']:
             changes[k] = getattr(self.ticket, k)
             setattr(self.ticket, k, post_data.pop(k, ''))


Mime
View raw message