# # # add_file "contrib/ciabot_monotone_hookversion.lua" # content [2fa138b000cb81ecead2b6e0e0625ce4fafb7a8e] # # patch "contrib/ciabot_monotone_hookversion.py" # from [8303aa799241fc91a81fa4942bfb19765cbb310c] # to [8cc3695e2d3d12260b583623720d7b1cdfd811c7] # ============================================================ --- contrib/ciabot_monotone_hookversion.lua 2fa138b000cb81ecead2b6e0e0625ce4fafb7a8e +++ contrib/ciabot_monotone_hookversion.lua 2fa138b000cb81ecead2b6e0e0625ce4fafb7a8e @@ -0,0 +1,37 @@ +-- Copyright (C) Nathaniel Smith +-- Timothy Brownawell +-- Thomas Moschny +-- Richard Levitte +-- Licensed under the MIT license: +-- http://www.opensource.org/licenses/mit-license.html +-- I.e., do what you like, but keep copyright and there's NO WARRANTY. +-- +-- CIA bot client for monotone, Lua part. This works in conjuction with +-- ciabot_monotone_hookversion.py. + +do + -- Configure with the path to the corresponding python script + local exe = "/PATH/TO/ciabot_monotone_hookversion.py" + + push_netsync_notifier({ + revision_received = + function (rid, rdat, certs) + local branch, author, changelog + for i, cert in pairs(certs) + do + if (cert.name == "branch") then + branch = cert.value + end + if (cert.name == "author") then + author = cert.value + end + if (cert.name == "changelog") then + changelog = cert.value + end + end + wait(spawn(exe, rid, + branch, author, changelog, rdat)) + return + end + }) +end ============================================================ --- contrib/ciabot_monotone_hookversion.py 8303aa799241fc91a81fa4942bfb19765cbb310c +++ contrib/ciabot_monotone_hookversion.py 8cc3695e2d3d12260b583623720d7b1cdfd811c7 @@ -17,25 +17,7 @@ # To use: # -- make a copy of it somewhere # -- edit the configuration values below -# -- put the following in the server's monotonerc: -# function note_netsync_revision_received(rid, rdat, certs) -# local branch, author, changelog -# for i, cert in pairs(certs) -# do -# if (cert.name == "branch") then -# branch = cert.value -# end -# if (cert.name == "author") then -# author = cert.value -# end -# if (cert.name == "changelog") then -# changelog = cert.value -# end -# end -# local exe = "/path/to/this/script" -# wait(spawn(exe, rid, branch, author, changelog, rdat)) -# return -# end +# -- include ciabot_monotone_hookversion.lua in the server's monotonerc: class config: def project_for_branch(self, branchname):