# # patch "ChangeLog" # from [84dfe063beab3a3c5a0de771f53dfaec013f73e0] # to [578d20a398a68f521d13deeb5ac94f9fb5b2678a] # # patch "commands.cc" # from [3e8ad65cb96a478855b3b9b756f498eb23269f3e] # to [424f850ae2487b1b867a6c12b798cf083ca8a0ac] # # patch "work.cc" # from [03e2d34586d97166f56da21afac9de985614f86a] # to [b165e29831c433d9866bb5d3e03ceccdefd6be39] # # patch "work.hh" # from [88af9184d605b4c3c59fb45c7c54806cc4afd6e2] # to [70d8503b81c8ab4d49481cd740f49fa7e4375498] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,10 @@ +2005-05-21 Matt Johnston
+ + * commands.cc (commit): write the log message to MT/log + during the commit, so it will be available later if the commit + fails. + * work.{cc,hh} (write_user_log): new function + 2005-05-20 Nathaniel Smith * contrib/mtbrowse.sh: New file. --- commands.cc +++ commands.cc @@ -2291,6 +2291,10 @@ else get_log_message(rs, app, log_message); + // we write it out so that if the commit fails, the log + // message will be preserved for a retry + write_user_log(data(log_message)); + N(log_message.find_first_not_of(" \r\t\n") != string::npos, F("empty log message")); --- work.cc +++ work.cc @@ -464,6 +464,15 @@ } void +write_user_log(data const & dat) +{ + local_path ul_path; + get_user_log_path(ul_path); + + write_data(ul_path, dat); +} + +void blank_user_log() { data empty; --- work.hh +++ work.hh @@ -104,6 +104,8 @@ void read_user_log(data & dat); +void write_user_log(data const & dat); + void blank_user_log(); bool has_contents_user_log();