# # patch "ChangeLog" # from [a87b9ea962503ad8ac89e2ddf3e6a2e76a10b359] # to [dfa5afbb8f37eaf1efb8a466b6e35c7fbcb117ef] # # patch "commands.cc" # from [6cddc3974fb86f0bd88df87c30252522bb142f97] # to [711e8e878e0b90261086a5a2118f9bc221c692a1] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,9 @@ +2005-05-16 Matt Johnston
+ + * commands.cc (commit): change scope of the transaction guard so that + the transaction will fail before MT/revision is written (which could + leave a non-committed revision/bad working dir). + 2005-05-16 Grahame Bowland * monotone.texi: update "monotone log" documentation --- commands.cc +++ commands.cc @@ -2294,8 +2294,8 @@ N(log_message.find_first_not_of(" \r\t\n") != string::npos, F("empty log message")); - transaction_guard guard(app.db); { + transaction_guard guard(app.db); packet_db_writer dbw(app); if (app.db.revision_exists(rid)) @@ -2396,10 +2396,9 @@ else cert_revision_author_default(rid, app, dbw); cert_revision_changelog(rid, log_message, app, dbw); + guard.commit(); } - guard.commit(); - // small race condition here... put_path_rearrangement(excluded_work); put_revision_id(rid);