view hgweb.cgi @ 13802:49b5a1aaf726

bugzilla: add modified XMLRPC mode that uses email to send bug comments. If Bugzilla has its email interface configured, an email can be used to update bugs. If the From: address in the email matches a valid user email, Bugzillas make the update as that user. So comments attached to a bug appear under the name of the user making the change, and the user does not receive email about the change, exactly as if they had made the change via the web interface. So add a modified XMLRPC mode that uses email to modify bugs. The format of the mails is documented in the Bugzilla email_in.pl specification. Briefly, initial non-blank lines in the message body starting '@<field> = <value> modify bug fields. A blank line signals the end of the command lines, and the rest of the message is used as bug comment. Invoke the same Mercurial user to Bugzilla user email mapping currently used in the MySQL mode. All other processing - checking the bug numbers, checking user ids, etc. continues to be done via XMLRPC.
author Jim Hague <jim.hague@acm.org>
date Wed, 30 Mar 2011 09:49:45 +0100
parents 227b9f13db13
children 85cba926cb59
line wrap: on
line source

#!/usr/bin/env python
#
# An example hgweb CGI script, edit as necessary
# See also http://mercurial.selenic.com/wiki/PublishingRepositories

# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/path/to/repo/or/config"

# Uncomment and adjust if Mercurial is not installed system-wide:
#import sys; sys.path.insert(0, "/path/to/python/lib")

# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()

from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb(config)
wsgicgi.launch(application)