monotone

monotone Mtn Source Tree

Root/contrib/edit_comment_from_changelog.lua

1std_edit_comment = edit_comment
2function edit_comment(basetext, user_log_message)
3local tmp, tname = temp_file()
4if (tmp == nil) then return nil end
5if (user_log_message == "") then
6local ChangeLog = io.open("ChangeLog", "r")
7if ChangeLog == nil then
8return std_edit_comment(basetext, user_log_message)
9end
10local line = ChangeLog:read()
11local msg = ""
12local n = 0
13while(line ~= nil and n < 2) do
14if (string.find(line, "^[^%s]")) then
15n = n + 1
16end
17if (n < 2 and not string.find(line, "^%s*$"))
18then
19msg = msg .. line .. "\n"
20end
21line = ChangeLog:read()
22end
23user_log_message = msg
24io.close(ChangeLog)
25end
26return std_edit_comment(basetext, user_log_message)
27end

Archive Download this file

Branches

Tags

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