#
#
# patch "ChangeLog"
# from [ec8f4d2703cf584434b718a6d72a07f11215aa38]
# to [1415e89f0c1023eddc0312dca8dabd278153a81a]
#
# patch "commands.cc"
# from [508c6a60662f6bb50c6a5405c545fc7d87851d09]
# to [6ad33bd7164ad08401f8c6d5bdc2cc67303e095d]
#
============================================================
--- ChangeLog ec8f4d2703cf584434b718a6d72a07f11215aa38
+++ ChangeLog 1415e89f0c1023eddc0312dca8dabd278153a81a
@@ -1,3 +1,10 @@
+2006-03-03 Nathaniel Smith
+
+ * commands.cc (update): Make plain update with multiple heads an
+ Error, not a Naughty.
+ (checkout): If a branch has multiple heads, list candidates, give
+ usage hint, and use Error instead of Naughty.
+
2006-03-01 Matthew Gregan
* transforms.cc: Don't assume wchar_t is wide enough to hold a
============================================================
--- commands.cc 508c6a60662f6bb50c6a5405c545fc7d87851d09
+++ commands.cc 6ad33bd7164ad08401f8c6d5bdc2cc67303e095d
@@ -1486,8 +1486,15 @@
N(!app.branch_name().empty(), F("need --branch argument for branch-based checkout"));
set heads;
get_branch_heads(app.branch_name(), app, heads);
- N(heads.size() > 0, F("branch '%s' is empty\n") % app.branch_name);
- N(heads.size() == 1, F("branch %s has multiple heads") % app.branch_name);
+ N(heads.size() > 0, F("branch '%s' is empty") % app.branch_name);
+ if (heads.size() > 1)
+ {
+ P(F("branch %s has multiple heads:"));
+ for (set::const_iterator i = heads.begin(); i != heads.end(); ++i)
+ P(i18n_format(" %s\n") % describe_revision(app, *i));
+ P(F("choose one with '%s checkout -r'") % app.prog_name);
+ E(false, F("branch %s has multiple heads") % app.branch_name);
+ }
ident = *(heads.begin());
}
else if (app.revision_selectors.size() == 1)
@@ -2955,12 +2962,12 @@
"maybe you want --revision="));
if (candidates.size() != 1)
{
- P(F("multiple update candidates:\n"));
+ P(F("multiple update candidates:"));
for (set::const_iterator i = candidates.begin();
i != candidates.end(); ++i)
- P(i18n_format(" %s\n") % describe_revision(app, *i));
- P(F("choose one with '%s update -r'\n") % app.prog_name);
- N(false, F("multiple candidates remain after selection"));
+ P(i18n_format(" %s") % describe_revision(app, *i));
+ P(F("choose one with '%s update -r'") % app.prog_name);
+ E(false, F("multiple update candidates remain after selection"));
}
r_chosen_id = *(candidates.begin());
}