summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2008-11-18 22:31:12 -0500
committerOwen W. Taylor <otaylor@fishsoup.net>2008-11-18 22:31:12 -0500
commit7f34fb8f13cce5be52d5910ac86f81245e8d81d9 (patch)
tree75502a8de86d760782e7f9b494d6720a1255c2dd
parent4e3116c5762b2c0424ad68d5507df2e82d87b83c (diff)
downloadgit-bz-7f34fb8f13cce5be52d5910ac86f81245e8d81d9.tar.gz
Try to catch failure when attaching a patch
If the response to attaching a patch doesn't have "Changes Submitted" as the, assume the attachment failed and dump out an error message and the response body.
-rwxr-xr-xgit-bz9
1 files changed, 8 insertions, 1 deletions
diff --git a/git-bz b/git-bz
index fd36d74..c1493ac 100755
--- a/git-bz
+++ b/git-bz
@@ -571,7 +571,14 @@ class Bug(object):
response_data = response.read()
if response.status != 200:
- die ("Failed to attach bug: %d" % response.status)
+ die ("Failed to attach patch to bug: status=%d" % response.status)
+
+ # We hope that this is constant across bugzilla versions for a
+ # successful attachment
+ m = re.search(r"<title>\s*Changes\s+Submitted", response_data)
+ if not m:
+ print response_data
+ die ("Failed to attach patch to bug")
print "Attached %s" % filename