# # # patch "lua_hooks.cc" # from [7455b70dc877298e9c99d421a6f6e3a219ddfb3e] # to [9f844c1bf6692f8bb488e5a596caa2f622f8a454] # # patch "lua_hooks.hh" # from [3136f049c267df992198a278d5e71ee0ee687562] # to [4d1020534c8163ec6f99b87ccffe13296f13feb0] # # patch "monotone.cc" # from [68b3ece2703bb23d90d2df357b7448ef32a01658] # to [c1d774218a91a191fcd1894c3fc02c9aa0747dcf] # # patch "monotone.texi" # from [917f28e0eb2b7bbb3d4922872add167f820da0a4] # to [b2c46fc1c9e38f589b88650203f08f5752acf5bf] # ============================================================ --- lua_hooks.cc 7455b70dc877298e9c99d421a6f6e3a219ddfb3e +++ lua_hooks.cc 9f844c1bf6692f8bb488e5a596caa2f622f8a454 @@ -918,7 +918,22 @@ lua_hooks::hook_note_netsync_end(size_t .ok(); } +bool +lua_hooks::hook_note_mtn_startup(vector const & args) +{ + Lua ll(st); + ll.func("note_mtn_startup"); + + int n=0; + for (vector::const_iterator i = args.begin(); i != args.end(); ++i, ++n) + ll.push_str(*i); + + ll.call(n, 0); + return ll.ok(); +} + + // Local Variables: // mode: C++ // fill-column: 76 ============================================================ --- lua_hooks.hh 3136f049c267df992198a278d5e71ee0ee687562 +++ lua_hooks.hh 4d1020534c8163ec6f99b87ccffe13296f13feb0 @@ -147,6 +147,7 @@ public: size_t certs_in, size_t certs_out, size_t revs_in, size_t revs_out, size_t keys_in, size_t keys_out); + bool hook_note_mtn_startup(std::vector const & args); }; // Local Variables: ============================================================ --- monotone.cc 68b3ece2703bb23d90d2df357b7448ef32a01658 +++ monotone.cc c1d774218a91a191fcd1894c3fc02c9aa0747dcf @@ -246,6 +246,8 @@ cpp_main(int argc, char ** argv) if (!app.found_workspace && global_sanity.filename.empty()) global_sanity.filename = (app.opts.conf_dir / "dump").as_external(); + app.lua.hook_note_mtn_startup(args); + // main options processed, now invoke the // sub-command w/ remaining args if (cmd.empty()) ============================================================ --- monotone.texi 917f28e0eb2b7bbb3d4922872add167f820da0a4 +++ monotone.texi b2c46fc1c9e38f589b88650203f08f5752acf5bf @@ -7921,6 +7921,15 @@ @subsection Event Notifications and Trig have been transferred, xx2 means no data was transferred, and xx0 means all data was transferred. address@hidden note_mtn_startup (...) + +Called by monotone when it is first started, this hook was added so that +usage of monotone could be monitored for user interface testing. Note +that by default, no monitoring occurs. The arguments to the hook +function are the arguments to monotone, without the initial address@hidden command. They can be accessed through the lua @var{arg} +variable which contains the variable list of arguments. + @end ftable @subsection User Defaults