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
4function note_netsync_revision_received(new_id, revision, certs, session_id)
5 local date=""
6 local author=""
7 local changelog=""
8 local branches=""
9 for i,cert in pairs(certs) do
10 if cert["name"] == "date" then
11 date = date .. cert["value"] .. " "
12 end
13 if cert["name"] == "author" then
14 author = author .. cert["value"] .. " "
15 end
16 if cert["name"] == "branch" then
17 branches = branches .. cert["value"] .. " "
18 end
19 if cert["name"] == "changelog" then
20 changelog = changelog .. cert["value"] .. "\n"
21 end
22 end
23 print("------------------------------------------------------------")
24 print("Revision: " .. new_id)
25 print("Author: " .. author)
26 print("Date: " .. date)
27 print("Branch: " .. branches)
28 print()
29 print(changelog)
30end
31

Archive Download this file

Branches

Tags

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