From fa0b3a32ae62430609c52f62e658f6bc114a320e Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sat, 15 Aug 2009 19:41:57 -0400 Subject: Fix to work with Bugzilla 3.4 Bugzilla 3.4 (like the new GNOME bugzilla) - Requires a status for attached patches - Uses a different title for succesful attachments --- git-bz | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/git-bz b/git-bz index f6b1b54..0caff57 100755 --- a/git-bz +++ b/git-bz @@ -798,6 +798,7 @@ class Bug(object): fields['bugid'] = str(self.id) fields['action'] = 'insert' fields['ispatch'] = '1' + fields['attachments.status'] = 'none' fields['description'] = description if comment: fields['comment'] = comment @@ -817,9 +818,11 @@ class Bug(object): if response.status != 200: die ("Failed to attach patch to bug: status=%d" % response.status) - # We hope that this is constant across bugzilla versions for a - # successful attachment + # Older bugzilla's used this for successful attachments m = re.search(r"\s*Changes\s+Submitted", response_data) + if not m: + # Newer bugzilla's, use, instead: + m = re.search(r"<title>\s*Attachment\s+\d+\s+added", response_data) if not m: print response_data die ("Failed to attach patch to bug") -- cgit v1.2.3