summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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))