#
# patch "ChangeLog"
# from [38099db924c0943fae7d5896fc743c8eed8e15e9]
# to [d9c386cf4ff1be6cf38f59090d2c95c9c3b3f373]
#
# patch "commands.cc"
# from [958cd3bbc982aef81f63b90b24dcebaddf135166]
# to [9d18a4b6ad3322a78fc0be54d91d480a42a9f571]
#
# patch "testsuite.at"
# from [14b8600c48fdafc19eba6942e2270738b4bd8c71]
# to [bfd94577b8716185ba8140676024523e0baefd95]
#
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,11 @@
+2005-04-20 Jeremy Cowgar
+
+ * commands.cc: Added maybe_show_multiple_heads, update now notifies
+ user of multiple heads if they exist, commit now notifies user
+ if their commit created a divergence.
+ * tests/t_multiple_heads_msg.at: Added
+ * testsuite.at: Added above test
+
2005-04-14 Jeremy Cowgar
* monotone.texi (Making Changes): Fixed duplicate paragraph
--- commands.cc
+++ commands.cc
@@ -673,6 +673,16 @@
F("edit of log message failed"));
}
+static void
+maybe_show_multiple_heads(app_state & app) {
+ set heads;
+ get_branch_heads(app.branch_name(), app, heads);
+ if (heads.size() > 1) {
+ P(F("note: branch '%s' has multiple heads\nnote: perhaps consider 'monotone merge'")
+ % app.branch_name);
+ }
+}
+
static string
describe_revision(app_state & app, revision_id const & id)
{
@@ -2564,8 +2574,12 @@
cert_value branchname;
I(rs.edges.size() == 1);
+ set heads;
+ get_branch_heads(app.branch_name(), app, heads);
+ unsigned int headSize = heads.size();
+
guess_branch(edge_old_revision(rs.edges.begin()), app, branchname);
-
+
P(F("beginning commit on branch '%s'\n") % branchname);
L(F("new manifest %s\n") % rs.new_manifest);
L(F("new revision %s\n") % rid);
@@ -2690,7 +2704,13 @@
P(F("committed revision %s\n") % rid);
blank_user_log();
-
+
+ get_branch_heads(app.branch_name(), app, heads);
+ if (heads.size() > headSize) {
+ P(F("note: this revision creates divergence\n"
+ "note: you may (or may not) wish to run 'monotone merge'"));
+ }
+
update_any_attrs(app);
maybe_update_inodeprints(app);
@@ -3144,6 +3164,8 @@
else
complete(app, idx(args, 0)(), r_chosen_id);
+ maybe_show_multiple_heads(app);
+
if (r_old_id == r_chosen_id)
{
P(F("already up to date at %s\n") % r_old_id);
@@ -3382,7 +3404,7 @@
P(F("[merged] %s\n") % merged);
left = merged;
}
- P(F("your working copies have not been updated\n"));
+ P(F("note: your working copies have not been updated\n"));
}
CMD(propagate, "tree", "SOURCE-BRANCH DEST-BRANCH",
--- testsuite.at
+++ testsuite.at
@@ -551,3 +551,4 @@
m4_include(tests/t_netsync_largish_file.at)
m4_include(tests/t_update_off_branch.at)
m4_include(tests/t_setup_checkout_modify_new_dir.at)
+m4_include(tests/t_multiple_heads_msg.at)