# # patch "app_state.cc" # from [63120a266ad19ebd72022cf172ccbd0c299aa413] # to [bfb9f8190f10b44774c3b33a03e2960ba0558c05] # # patch "app_state.hh" # from [9cfdb7a5976dc31edda11e99ee74046fdc318469] # to [13148bdc171e873a88649dc8566983fb70c667c5] # # patch "cert.cc" # from [451241f5ac6f41b70211dc92aa500e36688579af] # to [380376e40ffd8838257294103672322008f16796] # # patch "cert.hh" # from [4b8178c3e7303d3465932f7d44039e8315f850a6] # to [0ccd063b3e395cabdeabe7707b7fd32a1f5b891e] # # patch "commands.cc" # from [958cd3bbc982aef81f63b90b24dcebaddf135166] # to [874d307ac2f6a6879781db774a6e6568afb9f3ba] # # patch "monotone.cc" # from [2419f27fdb3cba77c658c0f4eac4d0b5026e1884] # to [25479a1c6baeb778a034708c05bc168378b4b4d1] # --- app_state.cc +++ app_state.cc @@ -273,6 +273,12 @@ } void +app_state::set_date(utf8 const & d) +{ + date = d; +} + +void app_state::set_depth(long d) { N(d > 0, --- app_state.hh +++ app_state.hh @@ -33,6 +33,7 @@ bool rcfiles; options_map options; utf8 message; + utf8 date; utf8 search_root; std::vector revision_selectors; std::vector extra_rcfiles; @@ -62,6 +63,7 @@ void set_signing_key(utf8 const & key); void set_root(utf8 const & root); void set_message(utf8 const & message); + void set_date(utf8 const & date); void set_depth(long depth); void add_revision(utf8 const & selector); --- cert.cc +++ cert.cc @@ -566,7 +566,7 @@ string const testresult_cert_name = "testresult"; -static void +void cert_revision_date(revision_id const & m, boost::posix_time::ptime t, app_state & app, --- cert.hh +++ cert.hh @@ -12,6 +12,7 @@ #include #include #include +#include // certs associate an opaque name/value pair with a particular identifier in // the system (eg. a manifest or file id) and are accompanied by an RSA @@ -118,6 +119,12 @@ packet_consumer & pc); void +cert_revision_date(revision_id const & m, + boost::posix_time::ptime t, + app_state & app, + packet_consumer & pc); + +void cert_revision_date_time(revision_id const & m, time_t time, app_state & app, --- commands.cc +++ commands.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include "commands.hh" #include "constants.hh" @@ -2545,6 +2546,7 @@ "commit working copy to database") { string log_message(""); + string commit_date(""); revision_set rs; revision_id rid; manifest_map m_old, m_new; @@ -2677,7 +2679,13 @@ dbw.consume_revision_data(rid, rdat); cert_revision_in_branch(rid, branchname, app, dbw); - cert_revision_date_now(rid, app, dbw); + if (app.date().length() > 0) { + commit_date = app.date(); + cert_revision_date(rid, boost::posix_time::time_from_string(commit_date), app, dbw); + } + else { + cert_revision_date_now(rid, app, dbw); + } cert_revision_author_default(rid, app, dbw); cert_revision_changelog(rid, log_message, app, dbw); } --- monotone.cc +++ monotone.cc @@ -45,6 +45,7 @@ #define OPT_ROOT 16 #define OPT_DEPTH 17 #define OPT_ARGFILE 18 +#define OPT_DATE 19 // main option processing and exception handling code @@ -70,6 +71,7 @@ {"ticker", 0, POPT_ARG_STRING, &argstr, OPT_TICKER, "set ticker style (count|dot|none) [count]", NULL}, {"revision", 'r', POPT_ARG_STRING, &argstr, OPT_REVISION, "select revision id for operation", NULL}, {"message", 'm', POPT_ARG_STRING, &argstr, OPT_MESSAGE, "set commit changelog message", NULL}, + {"date", 0, POPT_ARG_STRING, &argstr, OPT_DATE, "set commit date (WARNING: do only use for reconstructing)", NULL}, {"root", 0, POPT_ARG_STRING, &argstr, OPT_ROOT, "limit search for working copy to specified root", NULL}, {"depth", 0, POPT_ARG_LONG, &arglong, OPT_DEPTH, "limit the log output to the given number of entries", NULL}, {"xargs", '@', POPT_ARG_STRING, &argstr, OPT_ARGFILE, "insert command line arguments taken from the given file", NULL}, @@ -324,6 +326,10 @@ app.set_message(string(argstr)); break; + case OPT_DATE: + app.set_date(string(argstr)); + break; + case OPT_ROOT: app.set_root(string(argstr)); break;