monotone-commits-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-commits-diffs] net.venge.monotone: 59a7cd8b5030421f2bc7200b64


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone: 59a7cd8b5030421f2bc7200b64098ef99e952698
Date: Tue, 8 Mar 2011 12:36:03 +0100 (CET)

revision:            59a7cd8b5030421f2bc7200b64098ef99e952698
date:                2011-03-08T11:31:58
author:              Richard Levitte <address@hidden>
branch:              net.venge.monotone
changelog:
* extra/mtn-hooks/monotone-mail-notify.lua: Output an error message if
  the files couldn't be written.

manifest:
format_version "1"

new_manifest [dfabb6abe6c447d57a8667397273e8b3585ce61c]

old_revision [e1346a75af4692c50ad8a00112a4e4190abd588b]

patch "extra/mtn-hooks/monotone-mail-notify.lua"
 from [f498fdf33ee9e4a453665f66fb72f0a17a0ee624]
   to [1e45964d8ffc1ce606767ad6d5702d3e664c86ab]
============================================================
--- extra/mtn-hooks/monotone-mail-notify.lua	f498fdf33ee9e4a453665f66fb72f0a17a0ee624
+++ extra/mtn-hooks/monotone-mail-notify.lua	1e45964d8ffc1ce606767ad6d5702d3e664c86ab
@@ -41,6 +41,10 @@ do
    _shellscript_log = get_confdir() .. "/notify.log"
    _shellscript_errlog = get_confdir() .. "/notify.err"
 
+   function write_error(msg)
+      io.stderr:write("monotone-mail-notify.lua: " .. msg .. "\n")
+   end
+
    local function table_print(T)
       local done = {}
       local function tprint_r(T, prefix)
@@ -293,10 +297,28 @@ do
 		     --       rev_data["revision"], "to files with base",
 		     --       base .. "/" .. now .. "." .. rev_data["revision"])
 
-		     local outputFileRev = io.open(base .. "/" .. now .. "." .. rev_data["revision"] .. ".rev.txt", "w+")
-		     local outputFileHdr = io.open(base .. "/" .. now .. "." .. rev_data["revision"] .. ".hdr.txt", "w+")
-		     local outputFileDat = io.open(base .. "/" .. now .. "." .. rev_data["revision"] .. ".dat.txt", "w+")
+		     local outputFileRev, rev_errmsg =
+			io.open(base .. "/" .. now .. "." .. rev_data["revision"] .. ".rev.txt", "w+")
+		     local outputFileHdr, hdr_errmsg =
+			io.open(base .. "/" .. now .. "." .. rev_data["revision"] .. ".hdr.txt", "w+")
+		     local outputFileDat, dat_errmsg =
+			io.open(base .. "/" .. now .. "." .. rev_data["revision"] .. ".dat.txt", "w+")
 
+		     if (outputFileRev == nil) then
+			write_error(rev_errmsg)
+		     end
+		     if (outputFileHdr == nil) then
+			write_error(hdr_errmsg)
+		     end
+		     if (outputFileDat == nil) then
+			write_error(dat_errmsg)
+		     end
+		     if (outputFileRev == nil
+			 or outputFileHdr == nil
+			 or outputFileDat == nil) then
+			return "continue",nil
+		     end
+
 		     local to = ""
 		     for j,addr in pairs(rev_data["recipients"]) do
 			to = to .. addr

reply via email to

[Prev in Thread] Current Thread [Next in Thread]