diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-06-22 01:28:38 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-06-22 01:28:38 -0400 |
commit | 47f26d90e01454c105e1b74188c0f746e5941037 (patch) | |
tree | add3a9b7dc98802552aee339cbb9b03364059c4b /repo | |
parent | 2cb1c74336afa62f5aa7d860662cecc841b89231 (diff) | |
download | gpsd-47f26d90e01454c105e1b74188c0f746e5941037.tar.gz |
Another ciabot update.
Diffstat (limited to 'repo')
-rwxr-xr-x | repo/hooks/ciabot.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/repo/hooks/ciabot.py b/repo/hooks/ciabot.py index 72f13ca5..8ac06fb1 100755 --- a/repo/hooks/ciabot.py +++ b/repo/hooks/ciabot.py @@ -32,7 +32,7 @@ # ciabot.xmlrpc = if true, ship notifications via XML-RPC # ciabot.revformat = format in which the revision is shown # -# The ciabot.repo defaults to ciabot.project lowercased. +# The ciabot.repo value defaults to ciabot.project lowercased. # # The revformat variable may have the following values # raw -> full hex ID of commit @@ -110,7 +110,7 @@ version = "3.5" def do(command): return commands.getstatusoutput(command)[1] -def report(refname, merged): +def report(refname, merged, xmlrpc=False): "Generate a commit notification to be reported to CIA" # Try to tinyfy a reference to a web view for this commit. @@ -151,8 +151,7 @@ def report(refname, merged): context.update(globals()) out = xml % context - - message = '''\ + mail = '''\ Message-ID: <%(merged)s.%(author)s@%(project)s> From: %(fromaddr)s To: %(toaddr)s @@ -161,7 +160,10 @@ Subject: DeliverXML %(out)s''' % locals() - return message + if xmlrpc: + return out + else: + return mail if __name__ == "__main__": import getopt @@ -222,7 +224,7 @@ if __name__ == "__main__": server = smtplib.SMTP('localhost') for merged in merges: - message = report(refname, merged) + message = report(refname, merged, xmlrpc) if not notify: print message elif xmlrpc: |