summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2009-08-30 11:52:16 -0400
committerOwen W. Taylor <otaylor@fishsoup.net>2009-08-30 11:57:56 -0400
commit6a848de2bb7621c9050eecd888ad61ca7149116b (patch)
treecb1c0cd703fbf3315cc3906659607ca78569a1cb
parent7f92c1b30f4d0e56ff8840cbdd7fc109085af696 (diff)
downloadgit-bz-6a848de2bb7621c9050eecd888ad61ca7149116b.tar.gz
Add a method to update a bug
Add Bug.update() to allow changing fields in an existing bug. (adding comments, setting the status/resolution, etc.)
-rwxr-xr-xgit-bz19
1 files changed, 19 insertions, 0 deletions
diff --git a/git-bz b/git-bz
index 792d0b7..09bf72d 100755
--- a/git-bz
+++ b/git-bz
@@ -977,6 +977,25 @@ 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):
+ changes['id'] = str(self.id)
+ changes['token'] = self.token
+ # Since we don't send delta_ts we'll never get a mid-air collision
+ # This is probably a good thing
+
+ response = self.server.send_post("/process_bug.cgi", changes)
+ response_data = response.read()
+ if not check_for_success(response, response_data,
+ r"<title>\s*Bug[\S\s]*processed\s*</title>"):
+
+ # Mid-air collisions would be indicated by
+ # "<title>Mid-air collision!</title>"
+
+ print response_data
+ die ("Failed to update bug %d, status=%d" % (self.id, response.status))
+
def get_url(self):
return "%s://%s/show_bug.cgi?id=%d" % ("https" if self.server.https else "http",
self.server.host,