From c833e94426e3bf317d4780bd4cd240f9a8ede984 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Thu, 17 Jan 2013 21:49:51 -0500 Subject: Make changing status and patch complexity at the same time work --- git-bz | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/git-bz b/git-bz index d569bdb..65b4d7c 100755 --- a/git-bz +++ b/git-bz @@ -1867,17 +1867,21 @@ def attach_commits(bug, commits, include_comments=True, edit_comments=False, sta statuses = [] patch_complexities = [] + bug_changes = {} + if len(statuses) > 0: - bug_changes = {} bug_changes['bug_status'] = statuses[0] - bug.update(**bug_changes) - print "Updated bug status to '%s'" % bug_changes['bug_status'] if len(patch_complexities) > 0: - bug_changes = {} bug_changes['cf_patch_complexity'] = patch_complexities[0] + + if len(statuses) > 0 or len(patch_complexities) > 0: bug.update(**bug_changes) - print "Updated patch complexity to '%s'" % bug_changes['cf_patch_complexity'] + if len(patch_complexities) > 0: + print "Updated patch complexity to '%s'" % bug_changes['cf_patch_complexity'] + + if len(statuses) > 0: + print "Updated bug status to '%s'" % bug_changes['bug_status'] bug.create_patch(description, body, filename, patch, obsoletes=obsoletes, status=status) -- cgit