#
#
# patch "ChangeLog"
# from [7fb64962e77815890d05f239cfd2ecd41053e1d8]
# to [60be8a4201fc1160a9ad7346f4425ac3328c1abf]
#
# patch "app_state.cc"
# from [4990c26751504dded9cef9b1c6ffa66bef0d2b32]
# to [0ad4ef1e372648127c623dc7ee2c0432417f54f5]
#
# patch "app_state.hh"
# from [03afbc7ba543f0b26f8ddf70d97c05e872cdb36b]
# to [039e4f31355ff9522921c92b02a1f02859c7034f]
#
# patch "commands.cc"
# from [a10d3cb2745a4e0abf8281668b57204b333e03a6]
# to [fbdb47bc98a958fdaf6c0c44b3fc7a7c50867fc2]
#
# patch "database.cc"
# from [4e1b8cd93f1705eb61577322de3b0cf540bc6940]
# to [936e69c6505a0656b4cfbc98e97248090f55403a]
#
# patch "monotone.cc"
# from [29890d9e90e828fa96d845cb881bb024a8267d99]
# to [a7917f741c175240312a0c3f1bb9b7a009affe78]
#
# patch "netsync.cc"
# from [ff048e5f5c432920b0ddbffbe0fb7133b8eb9f46]
# to [ea3c1196dd9e0981ad4ff867bf5d93355b731303]
#
# patch "roster.cc"
# from [ccbdfd50a2a99c49598ae638a013a095f232c876]
# to [66eda9b3b3bb115886e6b0e3cbb5bc20c034ee47]
#
============================================================
--- ChangeLog 7fb64962e77815890d05f239cfd2ecd41053e1d8
+++ ChangeLog 60be8a4201fc1160a9ad7346f4425ac3328c1abf
@@ -1,5 +1,10 @@
2006-02-27 Matt Johnston
+ * monotone.cc, app_state.{cc,hh}, ...: print argv[0] when giving
+ usage of commands to run, rather than just "monotone"
+
+2006-02-27 Matt Johnston
+
* std_hooks.lua (ignore_file, dir_matches): add dir_matches helper
to avoid including ignored dirs such as '.svn', since dirs now
actually exist.
============================================================
--- app_state.cc 4990c26751504dded9cef9b1c6ffa66bef0d2b32
+++ app_state.cc 0ad4ef1e372648127c623dc7ee2c0432417f54f5
@@ -36,7 +36,8 @@
depth(-1), last(-1), next(-1), diff_format(unified_diff), diff_args_provided(false),
use_lca(false), execute(false), bind_address(""), bind_port(""),
missing(false), unknown(false),
- confdir(get_default_confdir()), have_set_key_dir(false), no_files(false)
+ confdir(get_default_confdir()), have_set_key_dir(false), no_files(false),
+ prog_name("monotone")
{
db.set_app(this);
lua.set_app(this);
============================================================
--- app_state.hh 03afbc7ba543f0b26f8ddf70d97c05e872cdb36b
+++ app_state.hh 039e4f31355ff9522921c92b02a1f02859c7034f
@@ -74,6 +74,7 @@
bool have_set_key_dir;
std::set attrs_to_drop;
bool no_files;
+ std::string prog_name;
std::map explicit_option_map; // set if the value of the flag was explicitly given on the command line
void set_is_explicit_option (int option_id);
============================================================
--- commands.cc a10d3cb2745a4e0abf8281668b57204b333e03a6
+++ commands.cc fbdb47bc98a958fdaf6c0c44b3fc7a7c50867fc2
@@ -419,9 +419,9 @@
std::string prefixedline;
prefix_lines_with(_("note: "),
_("branch '%s' has multiple heads\n"
- "perhaps consider 'monotone merge'"),
+ "perhaps consider '%s merge'"),
prefixedline);
- P(i18n_format(prefixedline) % app.branch_name);
+ P(i18n_format(prefixedline) % app.branch_name % app.prog_name);
}
}
@@ -2558,7 +2558,8 @@
get_branch_heads(app.branch_name(), app, heads);
if (heads.size() > old_head_size && old_head_size > 0) {
P(F("note: this revision creates divergence\n"
- "note: you may (or may not) wish to run 'monotone merge'"));
+ "note: you may (or may not) wish to run '%s merge'")
+ % app.prog_name);
}
update_any_attrs(app);
@@ -2958,7 +2959,7 @@
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 'monotone update -r'\n"));
+ P(F("choose one with '%s update -r'\n") % app.prog_name);
N(false, F("multiple candidates remain after selection"));
}
r_chosen_id = *(candidates.begin());
============================================================
--- database.cc 4e1b8cd93f1705eb61577322de3b0cf540bc6940
+++ database.cc 936e69c6505a0656b4cfbc98e97248090f55403a
@@ -143,9 +143,9 @@
N (schema == db_schema_id,
F("layout of database %s doesn't match this version of monotone\n"
"wanted schema %s, got %s\n"
- "try 'monotone db migrate' to upgrade\n"
+ "try '%s db migrate' to upgrade\n"
"(this is irreversible; you may want to make a backup copy first)")
- % filename % schema % db_schema_id);
+ % filename % schema % db_schema_id % __app->prog_name);
}
void
============================================================
--- monotone.cc 29890d9e90e828fa96d845cb881bb024a8267d99
+++ monotone.cc a7917f741c175240312a0c3f1bb9b7a009affe78
@@ -277,6 +277,8 @@
save_initial_path();
utf8_argv uv(argc, argv);
+ string prog_name(uv.argv[0]);
+
// prepare for arg parsing
cleanup_ptr
@@ -299,6 +301,8 @@
{
app_state app;
+ app.prog_name = prog_name;
+
while ((opt = poptGetNextOpt(ctx())) > 0)
{
if (local_options.find(opt) != local_options.end())
@@ -613,7 +617,8 @@
if (count != 0)
{
ostringstream sstr;
- sstr << F("Options specific to 'monotone %s':") % u.which;
+ sstr << F("Options specific to '%s %s':")
+ % prog_name % u.which;
options[0].descrip = strdup(sstr.str().c_str());
options[0].argInfo |= POPT_ARGFLAG_DOC_HIDDEN;
============================================================
--- netsync.cc ff048e5f5c432920b0ddbffbe0fb7133b8eb9f46
+++ netsync.cc ea3c1196dd9e0981ad4ff867bf5d93355b731303
@@ -1195,9 +1195,9 @@
"it is also possible that the server key has just been changed\n"
"remote host sent key %s\n"
"I expected %s\n"
- "'monotone unset %s %s' overrides this check\n")
+ "'%s unset %s %s' overrides this check\n")
% their_key_hash % expected_key_hash
- % their_key_key.first % their_key_key.second);
+ % app.prog_name % their_key_key.first % their_key_key.second);
E(false, F("server key changed"));
}
}
============================================================
--- roster.cc ccbdfd50a2a99c49598ae638a013a095f232c876
+++ roster.cc 66eda9b3b3bb115886e6b0e3cbb5bc20c034ee47
@@ -2102,9 +2102,9 @@
N(missing_files == 0,
F("%d missing files\n"
"to restore consistency, on each missing file run either\n"
- "'monotone drop FILE' to remove it permanently, or\n"
- "'monotone revert FILE' to restore it\n")
- % missing_files);
+ "'%s drop FILE' to remove it permanently, or\n"
+ "'%s revert FILE' to restore it\n")
+ % missing_files % app.prog_name % app.prog_name);
}
void