# # # patch "contrib/monotone-inotify.lua" # from [7278de73828e38017afde6a9ca34f77a3ca7258e] # to [bcdd6591ec28700e8c36d40bea005587039101c4] # ============================================================ --- contrib/monotone-inotify.lua 7278de73828e38017afde6a9ca34f77a3ca7258e +++ contrib/monotone-inotify.lua bcdd6591ec28700e8c36d40bea005587039101c4 @@ -56,11 +56,31 @@ if not MI_flagfile then MI_flagfile = MI ------------------------------------------------------------------------------- -- Local hack of the note_netsync_* functions ------------------------------------------------------------------------------- +do + local debug = false + + push_netsync_notifier( + { + ["end"] = + function (nonce, status, + bytes_in, bytes_out, + certs_in, certs_out, + revs_in, revs_out, + keys_in, keys_out, + ...) + if debug then + io.stderr:write("note_netsync_end: ", + string.format("%d certs, %d revs, %d keys", + certs_in, revs_in, keys_in), + "\n") + end + if certs_in > 0 or revs_in > 0 or keys_in > 0 then + if debug then + io.stderr:write("note_netsync_end: touching ", MI_flagfile, "\n") + end + local handle = io.open(MI_flagfile, "w+") + io.close(handle) + end + end + }) +end -push_netsync_notifier( - { - ["end"] = - function (...) - local handle = io.open(MI_flagfile, "w+") - io.close(handle) - end - })