monotone

monotone Mtn Source Tree

Root/contrib/monotone-log-of-pulled-revs-hook.lua

1-- This is a simple Monotone hook function that prints out information about
2-- revisions received during netsync.
3
4push_hook-functions(
5 {
6 revision_received =
7 function (new_id, revision, certs, session_id)
8 local date=""
9 local author=""
10 local changelog=""
11 local branches=""
12 for i,cert in pairs(certs) do
13 if cert["name"] == "date" then
14 date = date .. cert["value"] .. " "
15 end
16 if cert["name"] == "author" then
17 author = author .. cert["value"] .. " "
18 end
19 if cert["name"] == "branch" then
20 branches = branches .. cert["value"] .. " "
21 end
22 if cert["name"] == "changelog" then
23 changelog = changelog .. cert["value"] .. "\n"
24 end
25 end
26 print("------------------------------------------------------------")
27 print("Revision: " .. new_id)
28 print("Author: " .. author)
29 print("Date: " .. date)
30 print("Branch: " .. branches)
31 print()
32 print(changelog)
33 return "continue",nil
34 end
35 })
36

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status