Commit 12d972e2 authored by Robert Lyon's avatar Robert Lyon
parents 0ba571da 4a0c7946
#!/usr/bin/python
#
# Gerrit Launchpad and CIA Hook, inspired by:
# Gerrit hook script to write a message about each merged patch in its
# associated Launchpad bug.
#
# Copy/symlink this to GERRIT_HOME/hooks/change_merged
#
# Inspired by:
# https://github.com/hobbs/jirret
# http://cia.vc/clients/git/ciabot.bash
# http://cia.vc/clients/bzr/cia_bzr.py
#
# Copyright (C) 2011, 2012 Catalyst IT (http://www.catalyst.net.nz)
# Copyright (C) 2011 - 2015 Catalyst IT (http://www.catalyst.net.nz)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -159,7 +164,17 @@ def main():
# See https://reviews.mahara.org/Documentation/config-hooks.html
# This should be replaced with argparse instead of getopt, when
# we upgrade the server to python 3.2 or later.
gerrit_args = ['change=', 'change-url=', 'project=', 'branch=', 'topic=', 'submitter=', 'commit=']
gerrit_args = [
'change=',
'change-url=',
'change-owner=',
'project=',
'branch=',
'topic=',
'submitter=',
'commit=',
'newrev=',
]
args, unused = getopt(sys.argv[1:], '', gerrit_args)
change_url = project = branch = submitter = commit = None
......
#!/usr/bin/python
#
# Gerrit Launchpad and CIA Hook, inspired by:
# Gerrit hook script to write a message about each new patch in its
# associated Launchpad bug.
#
# Copy/symlink this to GERRIT_HOME/hooks/patchset-created
#
# Inspired by:
# https://github.com/hobbs/jirret
# http://cia.vc/clients/git/ciabot.bash
# http://cia.vc/clients/bzr/cia_bzr.py
#
# Copyright (C) 2011 - 2013 Catalyst IT (http://www.catalyst.net.nz)
# Copyright (C) 2011 - 2015 Catalyst IT (http://www.catalyst.net.nz)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -74,10 +79,22 @@ def main():
# See https://reviews.mahara.org/Documentation/config-hooks.html
# This should be replaced with argparse instead of getopt, when
# we upgrade the server to python 3.2 or later.
gerrit_args = ['change=', 'is-draft=', 'change-url=', 'project=', 'branch=', 'topic=', 'uploader=', 'commit=', 'patchset=']
gerrit_args = [
'change=',
'is-draft=',
'kind=',
'change-url=',
'change-owner=',
'project=',
'branch=',
'topic=',
'uploader=',
'commit=',
'patchset='
]
args, unused = getopt(sys.argv[1:], '', gerrit_args)
change_url = project = branch = uploader = commit = None
change_url = project = branch = uploader = commit = patchset = is_draft = None
for argname, argv in args:
if argname == '--change-url':
change_url = argv
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment