diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2009-08-30 11:52:16 -0400 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2009-08-30 11:57:56 -0400 |
commit | 6a848de2bb7621c9050eecd888ad61ca7149116b (patch) | |
tree | cb1c0cd703fbf3315cc3906659607ca78569a1cb | |
parent | 7f92c1b30f4d0e56ff8840cbdd7fc109085af696 (diff) |
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-x | git-bz | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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, |