summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2015-02-23 20:32:52 -0500
committerOwen W. Taylor <otaylor@fishsoup.net>2015-02-23 20:32:52 -0500
commit303e63f309865cda8856c325c9a602c9283a7c81 (patch)
tree1ee92f8c2ac039220aec7aa1bc7b5308d85c9c28
parent4043b7ad760d73ae618ce7a2775b1b987797a8be (diff)
downloadgit-bz-303e63f309865cda8856c325c9a602c9283a7c81.tar.gz
Get attachment status editing working again for bugzilla.gnome.org
Handle the changed name of the attachment status field; status on creation isn't supported with the current b.g.o code, so leave that as a FIXME for now.
-rwxr-xr-xgit-bz16
1 files changed, 11 insertions, 5 deletions
diff --git a/git-bz b/git-bz
index 894f8e4..666e8f4 100755
--- a/git-bz
+++ b/git-bz
@@ -1159,7 +1159,7 @@ class Bug(object):
patch.description = attachment.find("desc").text
patch.date = attachment.find("date").text
patch.attacher = attachment.find("attacher").text
- status = attachment.find("status")
+ status = attachment.find("gnome_attachment_status")
patch.status = None if status is None else status.text
patch.filename = attachment.find("filename").text
patch.isprivate = attachment.get("isprivate") == "1"
@@ -1250,6 +1250,9 @@ class Bug(object):
print self.get_url()
def create_patch(self, description, comment, filename, data, obsoletes=[], status='none'):
+ # FIXME: Currently there is no way to set status on creation for bugzilla.gnome.org
+ # (and other bugzilla instances don't support patch status)
+
# Bugzilla 4.2+ requires you to grab a fresh token from attachment.cgi.
url = "/attachment.cgi?bugid=" + str(self.id) + "&action=enter"
@@ -1270,7 +1273,6 @@ class Bug(object):
if token is not None:
fields['token'] = token.group(1)
fields['ispatch'] = '1'
- fields['attachments.status'] = status
fields['description'] = description
if comment:
fields['comment'] = comment
@@ -1303,6 +1305,7 @@ class Bug(object):
print "Attached %s" % filename
+
# Update specified fields of a bug; keyword arguments are interpreted
# as field_name=value
def update(self, **changes):
@@ -1346,11 +1349,11 @@ class Bug(object):
if patch.token:
fields['token'] = patch.token
if patch.status is not None:
- fields['attachments.status'] = patch.status
+ fields['gnome_attachment_status'] = patch.status
for (field, value) in changes.iteritems():
if field == 'status': # encapsulate oddball form field name
- field = 'attachments.status'
+ field = 'gnome_attachment_status'
fields[field] = value
try:
@@ -1953,7 +1956,10 @@ def edit_bug(bug, applied_commits=None, fix_commits=None):
template.write("\n# Lines below change patch status, unless commented out\n")
else:
template.write("\n# To change patch status, uncomment below, edit 'committed' as appropriate.\n")
- legal_statuses = bug.server.legal_values('attachments.status')
+ fields = bug.server.get_xmlrpc_proxy().Bug.fields({ 'names': ['attachments.gnome_attachment_status']})
+ values = fields['fields'][0]['values']
+ legal_statuses = [v['name'] for v in values]
+
if legal_statuses:
legal_statuses.append('obsolete')
template.write("# possible statuses: %s\n" % abbreviation_help_string(legal_statuses))