Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara-scripts
Commits
12d972e2
Commit
12d972e2
authored
May 18, 2015
by
Robert Lyon
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.nzoss.org.nz/mahara/mahara-scripts
parents
0ba571da
4a0c7946
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
7 deletions
+39
-7
gerrit/change-merged
gerrit/change-merged
+18
-3
gerrit/patchset-created
gerrit/patchset-created
+21
-4
No files found.
change-merged
→
gerrit/
change-merged
View file @
12d972e2
#!/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
,
201
2
Catalyst IT (http://www.catalyst.net.nz)
# Copyright (C) 2011
-
201
5
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
...
...
patchset-created
→
gerrit/
patchset-created
View file @
12d972e2
#!/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 - 201
3
Catalyst IT (http://www.catalyst.net.nz)
# Copyright (C) 2011 - 201
5
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment