allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [2/3] git commit: [#5383] record label changelog when labels are removed
Date Fri, 14 Dec 2012 16:12:04 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/10f8d8b1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/10f8d8b1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/10f8d8b1

Branch: refs/heads/master
Commit: 10f8d8b1ac19742b443861ed5495eb26bed05397
Parents: acf0f90
Author: Dave Brondsema <dbrondsema@geek.net>
Authored: Wed Dec 12 16:35:59 2012 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Fri Dec 14 16:11:45 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/10f8d8b1/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 f9e17f4..e20bb95 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/10f8d8b1/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