Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 22 additions and 2 deletions.
  1. +8 −1 etc/gitzillarc
  2. +13 −1 hooks.py
  3. +1 −0  hookscripts.py
View
9 etc/gitzillarc
@@ -110,6 +110,11 @@
# - bug# 123
# - Bug #123
#
+# New bug regex, which is also used for status, is as follows:
+# - BUG:COMMENT:ID
+# - BUG:FIXED:ID
+# - BUG:CLOSED:ID
+#
# * git_ref_prefix
#
# the string which must start a git reference for its commits to be
@@ -143,4 +148,6 @@
# bugzilla_password: barbarblah
# allowed_bug_states: NEW, ASSIGNED, REOPENED
# user_config: deny
-
+#
+#bug_regex: ^bug\:(?P<status>Fixed|Comment|Closed){1}\:(?P<bug>\d*)
+#
View
14 hooks.py
@@ -98,7 +98,19 @@ def post_receive(sBZUrl, sBZUser=None, sBZPasswd=None, sFormatSpec=None, oBugReg
iBugId = int(oMatch.group("bug"))
logger.debug("Found bugid %d" % (iBugId,))
try:
- oBZ.modify(iBugId, comment=sMessage)
+ sStatus = None
+ sResolution = None
+ st = oMatch.group("status")
+ if (st):
+ logger.debug("Match on status: %s" % st)
+ if st == "FIXED":
+ sStatus = 'RESOLVED'
+ sResolution = 'FIXED'
+ elif st == "CLOSED":
+ sStatus = 'CLOSED'
+
+ oBZ.modify(iBugId, comment=sMessage, status=sStatus, resolution=sResolution)
+
except Exception, e:
logger.exception("Could not add comment to bug %d" % (iBugId,))
View
1  hookscripts.py
@@ -13,6 +13,7 @@
import logging
import ConfigParser
import bugz
+import re
DEFAULT = 'DEFAULT'

No commit comments for this range

Something went wrong with that request. Please try again.