[python-fedmsg-meta-fedora-infrastructure] Patch to not declare tickets closed unless that value actually changes.

Ralph Bean ralph at fedoraproject.org
Tue May 14 00:15:56 UTC 2013


commit b3b5ecdb7ecd1941f491908db88f732e5cb447b3
Author: Ralph Bean <rbean at redhat.com>
Date:   Mon May 13 20:15:50 2013 -0400

    Patch to not declare tickets closed unless that value actually changes.

 0001-dont-declare-tickets.patch               |   32 +++++++++++++++++++++++++
 python-fedmsg-meta-fedora-infrastructure.spec |    7 ++++-
 2 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/0001-dont-declare-tickets.patch b/0001-dont-declare-tickets.patch
new file mode 100644
index 0000000..3619350
--- /dev/null
+++ b/0001-dont-declare-tickets.patch
@@ -0,0 +1,32 @@
+From 9e7b13a64dbc285ef68249dd7283b87c2df54000 Mon Sep 17 00:00:00 2001
+From: Ralph Bean <rbean at redhat.com>
+Date: Mon, 13 May 2013 20:12:19 -0400
+Subject: [PATCH] Don't declare tickets open or closed unless the status has
+ actually changed.
+
+---
+ fedmsg_meta_fedora_infrastructure/trac.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/fedmsg_meta_fedora_infrastructure/trac.py b/fedmsg_meta_fedora_infrastructure/trac.py
+index e410330..37aab32 100644
+--- a/fedmsg_meta_fedora_infrastructure/trac.py
++++ b/fedmsg_meta_fedora_infrastructure/trac.py
+@@ -81,11 +81,12 @@ class TracProcessor(BaseProcessor):
+                     "{user} updated a ticket "
+                     "on the {project} trac instance")
+                 status = msg['msg']['ticket']['status']
+-                if status == 'reopened':
++                old_values = msg['msg']['old_values']
++                if status == 'reopened' and 'status' in old_values:
+                     tmpl = self._(
+                         "{user} reopened a ticket "
+                         "on the {project} trac instance")
+-                elif status == 'closed':
++                elif status == 'closed' and 'status' in old_values:
+                     resolution = msg['msg']['ticket']['resolution']
+                     tmpl = self._(
+                         "{user} closed a ticket "
+-- 
+1.8.1.4
+
diff --git a/python-fedmsg-meta-fedora-infrastructure.spec b/python-fedmsg-meta-fedora-infrastructure.spec
index 0326e70..9da6af1 100644
--- a/python-fedmsg-meta-fedora-infrastructure.spec
+++ b/python-fedmsg-meta-fedora-infrastructure.spec
@@ -2,7 +2,7 @@
 
 Name:               python-fedmsg-meta-fedora-infrastructure
 Version:            0.1.5
-Release:            1%{?dist}
+Release:            2%{?dist}
 Summary:            Metadata providers for Fedora Infrastructure's fedmsg deployment
 
 Group:              Development/Libraries
@@ -10,6 +10,7 @@ License:            LGPLv2+
 URL:                http://pypi.python.org/pypi/%{modname}
 Source0:            http://pypi.python.org/packages/source/f/%{modname}/%{modname}-%{version}.tar.gz
 Patch0:             0001-temporarily-remove-avatar-test.patch
+Patch1:             0001-dont-declare-tickets.patch
 
 BuildArch:          noarch
 
@@ -46,6 +47,7 @@ your messages.
 %prep
 %setup -q -n %{modname}-%{version}
 %patch0 -p1
+%patch1 -p1
 
 # Remove bundled egg-info in case it exists
 rm -rf %{modname}.egg-info
@@ -66,6 +68,9 @@ rm -rf %{modname}.egg-info
 
 
 %changelog
+* Mon May 13 2013 Ralph Bean <rbean at redhat.com> - 0.1.5-2
+- Patch: don't declare tickets closed unless that value actually changes.
+
 * Mon May 13 2013 Ralph Bean <rbean at redhat.com> - 0.1.5-1
 - New upstream with new avatars and emails interfaces.
 - New dep on python-fedora


More information about the scm-commits mailing list