#
# add_file "tests/t_override_author_date.at"
#
# patch "ChangeLog"
# from [4ce033ead67135a5abedd314c72a2c140041ff94]
# to [ac4b2df4b7132e8a010350e135f645ab6bb7ae7d]
#
# patch "app_state.cc"
# from [63120a266ad19ebd72022cf172ccbd0c299aa413]
# to [b821fb66100e7626444a2f1e4bc2af4d572880b1]
#
# patch "app_state.hh"
# from [9cfdb7a5976dc31edda11e99ee74046fdc318469]
# to [27b58d6683bc026b41c07308738952067bf82926]
#
# patch "cert.cc"
# from [451241f5ac6f41b70211dc92aa500e36688579af]
# to [07be077e4c0d53abd9cac0bbdf201e808cf221a5]
#
# patch "cert.hh"
# from [4b8178c3e7303d3465932f7d44039e8315f850a6]
# to [e2b1d86c8f2610e854afed7ab661c4c2554e7004]
#
# patch "commands.cc"
# from [5c5ffeb1c705633a442c8abe9d14ffd03db99869]
# to [e24b9d3f4cf1db10ea68ce3733c1a8bdafb5371d]
#
# patch "monotone.1"
# from [9a00ecadd333fe803fe4788d579afb75f3a8aa51]
# to [33e5e256e415dd185535ac1331d44a9de3f243cc]
#
# patch "monotone.cc"
# from [0139d2c71dbb12198e6206749b71ecb1e6286459]
# to [daff288cbe075dc65c3dfd45e89ea3e71d438ed8]
#
# patch "monotone.texi"
# from [31fabd3d2cdf017dfc5af29af363dbd9e6f74c21]
# to [412d8c60e2a7e06ae07a6b8350393421d7f87b2b]
#
# patch "tests/t_override_author_date.at"
# from []
# to [0f0499f19e887a4dbe83663f5e704110ca270bb3]
#
# patch "testsuite.at"
# from [43031d5d196cfda4496ed11d9f46f448bc973697]
# to [63f222bf1549f1b5ea773c38860809fd131a88e4]
#
--- ChangeLog
+++ ChangeLog
@@ -10,6 +10,24 @@
2005-04-16 Nathaniel Smith
+ * app_state.{cc,hh} (set_author, set_date): New methods.
+ * cert.cc (cert_revision_date): Rename to...
+ (cert_revision_date_time): ...an overloaded version of this.
+ (cert_revision_author_default): Check app.date.
+ * cert.hh: Expose cert_revision_date_time.
+ * commands.cc (commit): Handle --date.
+ * main.cc: Parse --date and --author options.
+ * monotone.1: Document --date, --author.
+ * monotone.texi (Working Copy, OPTIONS): Likewise.
+
+ * tests/t_override_author_date.at: New test.
+ * testsuite.at: Add it.
+
+ This commit heavily based on a patch by Markus Schiltknecht
+ .
+
+2005-04-16 Nathaniel Smith
+
* ChangeLog: Fixup after merge.
2005-04-17 Matthew Gregan
--- app_state.cc
+++ app_state.cc
@@ -273,6 +273,18 @@
}
void
+app_state::set_date(utf8 const & d)
+{
+ date = d;
+}
+
+void
+app_state::set_author(utf8 const & a)
+{
+ author = a;
+}
+
+void
app_state::set_depth(long d)
{
N(d > 0,
--- app_state.hh
+++ app_state.hh
@@ -33,6 +33,8 @@
bool rcfiles;
options_map options;
utf8 message;
+ utf8 date;
+ utf8 author;
utf8 search_root;
std::vector revision_selectors;
std::vector extra_rcfiles;
@@ -62,6 +64,8 @@
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_author(utf8 const & author);
void set_depth(long depth);
void add_revision(utf8 const & selector);
--- cert.cc
+++ cert.cc
@@ -566,11 +566,11 @@
string const testresult_cert_name = "testresult";
-static 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,
+ boost::posix_time::ptime t,
+ app_state & app,
+ packet_consumer & pc)
{
string val = boost::posix_time::to_iso_extended_string(t);
put_simple_revision_cert(m, date_cert_name, val, app, pc);
@@ -585,7 +585,7 @@
// make sure you do all your CVS conversions by 2038!
boost::posix_time::ptime tmp(boost::gregorian::date(1970,1,1),
boost::posix_time::seconds(static_cast(t)));
- cert_revision_date(m, tmp, app, pc);
+ cert_revision_date_time(m, tmp, app, pc);
}
void
@@ -593,7 +593,7 @@
app_state & app,
packet_consumer & pc)
{
- cert_revision_date(m, boost::posix_time::second_clock::universal_time(), app, pc);
+ cert_revision_date_time(m, boost::posix_time::second_clock::universal_time(), app, pc);
}
void
@@ -620,8 +620,7 @@
% app.branch_name);
author = key();
}
- put_simple_revision_cert(m, author_cert_name,
- author, app, pc);
+ cert_revision_author(m, author, app, pc);
}
void
--- cert.hh
+++ cert.hh
@@ -12,6 +12,7 @@
#include