# # # patch "cmd.hh" # from [83378fbb4480212de8093f8c4efa23b2af35522e] # to [9cdc32af87ddb16aa8be8db555a3e2be6b43a03d] # # patch "cmd_automate.cc" # from [36d6c13d240cbea51c445d6588e01d6669b18ddf] # to [a24d742ae4e84d50beaa4a13d0bdb2fcf58de131] # # patch "cmd_db.cc" # from [6446b538ba18b5affc287104b4771a83b8affdab] # to [bc7f46a061d987e96a55928be3126023ed822e97] # # patch "cmd_files.cc" # from [2e732f6ad02aab8f4572d41a1de06e5d460f6760] # to [9c5f3cfc27283b7f749093e4ac47bff1b0ff22e2] # # patch "cmd_key_cert.cc" # from [99d48e6e7a7716bded2d67533c946b516db972ac] # to [283a1ad656d29a2845001c076653214369952c76] # # patch "cmd_list.cc" # from [0061f36029425ffd1ad0d58016cb38a9742bc380] # to [097180da9a25f0ce457ee38808fa21e4dc9c367e] # # patch "cmd_merging.cc" # from [e4dbad5b2cb356a53ef126cc9bcdd007953784cf] # to [02a90c3f0193bc5739a547795b9afc770400bf5b] # # patch "cmd_netsync.cc" # from [e5e2ce383a6e9d7fa9148682443c7a81da66b3c0] # to [8ced2efe531dc5805532ba6eb98581660514542a] # # patch "cmd_othervcs.cc" # from [fb12125d16db52e0ac197b97686ad2c7a6bdb47a] # to [683cf3e1677586855cb5f6e8601997b588ff0535] # # patch "cmd_packet.cc" # from [67418301746163151fd844c9c4d80a57f9310049] # to [84a8725a5a912ad991c8d94948172ce83ae9925e] # # patch "cmd_ws_commit.cc" # from [c3529256b751d83f6ce697829c48e046333b475e] # to [cccc112e3f9ea877e1c5932a3e08244a02dacbc4] # # patch "commands.cc" # from [ab682a798b0f98934c6638e98b70245e5f573a6e] # to [b113c466e6fd2853f85e2b22ff60d983bf951e0b] # # patch "revision.cc" # from [c4c178a6e314921aa37997f7f6fc9b56d5fa51de] # to [b11b83b54d4b07e23ff3c30749008f300dd0f815] # # patch "revision.hh" # from [5f873cb70641d7a40d9e17a897f318ab8f34026c] # to [c8ba22a180653cff9231e65e3fbe936abc46e8b7] # ============================================================ --- cmd.hh 83378fbb4480212de8093f8c4efa23b2af35522e +++ cmd.hh 9cdc32af87ddb16aa8be8db555a3e2be6b43a03d @@ -77,7 +77,7 @@ namespace commands bool operator<(command const & cmd) const; virtual void exec(app_state & app, - std::string const & name, // XXX Extra parameter + command_id const & execid, args_vector const & args) = 0; bool has_name(utf8 const & name) const; @@ -150,13 +150,13 @@ namespace commands { options::options_type() | opts) \ {} \ virtual void exec(app_state & app, \ - std::string const & name, \ + command_id const & execid, \ args_vector const & args); \ }; \ cmd_ ## C C ## _cmd; \ } \ void commands::cmd_ ## C::exec(app_state & app, \ - std::string const & name, \ + command_id const & execid, \ args_vector const & args) #define CMD(C, aliases, parent, params, abstract, desc, opts) \ @@ -178,7 +178,7 @@ namespace commands { options::options_type() | opts) \ {} \ virtual void exec(app_state & app, \ - std::string const & name, \ + command_id const & execid, \ args_vector const & args); \ std::string params(); \ options::options_type get_options(args_vector const & args); \ @@ -186,7 +186,7 @@ void commands::cmd_ ## C::exec(app_state cmd_ ## C C ## _cmd; \ } \ void commands::cmd_ ## C::exec(app_state & app, \ - std::string const & name, \ + command_id const & execid, \ args_vector const & args) // XXX Should the 'opts' parameter go away? @@ -200,17 +200,17 @@ namespace commands { options::options_type() | opts) \ {} \ virtual void exec(app_state & app, \ - std::string const & name, \ + command_id const & execid, \ args_vector const & args); \ }; \ cmd_ ## C C ## _cmd; \ } \ void commands::cmd_ ## C::exec(app_state & app, \ - std::string const & name, \ + command_id const & execid, \ args_vector const & args) \ { \ if (args.size() == 0) \ - throw usage(ident()); \ + throw usage(execid); \ \ args_vector::const_iterator i = args.begin(); \ ++i; \ @@ -218,7 +218,7 @@ void commands::cmd_ ## C::exec(app_state /* XXX Command completion... */ \ /*command * child = find_command(this, idx(args, 0)()); \ if (child == NULL) \ - throw usage(ident()); \ + throw usage(execid); \ else \ child->exec(app, idx(args, 0)(), removed); */ \ } @@ -236,13 +236,13 @@ namespace commands { options::options_type() | opts) \ {} \ virtual void exec(app_state & app, \ - std::string const & name, \ + command_id const & execid, \ args_vector const & args); \ }; \ cmd_ ## C C ## _cmd; \ } \ void commands::cmd_ ## C::exec(app_state & app, \ - std::string const & name, \ + command_id const & execid, \ args_vector const & args) \ CMD_FWD_DECL(__root__); ============================================================ --- cmd_automate.cc 36d6c13d240cbea51c445d6588e01d6669b18ddf +++ cmd_automate.cc a24d742ae4e84d50beaa4a13d0bdb2fcf58de131 @@ -54,11 +54,12 @@ automate_command(arg_type cmd, args_vect void automate_command(arg_type cmd, args_vector args, - string const & root_cmd_name, + commands::command_id const & root_cmd_name, app_state & app, ostream & output) { - find_automation(cmd, root_cmd_name).run(args, root_cmd_name, app, output); + string const & leaf = root_cmd_name[root_cmd_name.size() - 1](); + find_automation(cmd, leaf).run(args, leaf, app, output); } static string const interface_version = "4.2"; @@ -360,6 +361,7 @@ AUTOMATE(stdio, "", options::opts::autom opts = options::opts::globals(); opts = opts | find_automation(cmd, help_name).opts; opts.instantiate(&app.opts).from_key_value_pairs(params); + commands::command_id help_name; // XXX automate_command(cmd, args, help_name, app, os); } catch(informative_failure & f) @@ -383,7 +385,7 @@ CMD_WITH_SUBCMDS(automate, "", CMD_REF(a options::opts::none) { if (args.size() == 0) - throw usage(ident()); + throw usage(execid); args_vector::const_iterator i = args.begin(); arg_type cmd = *i; @@ -392,7 +394,7 @@ CMD_WITH_SUBCMDS(automate, "", CMD_REF(a make_io_binary(); - automate_command(cmd, cmd_args, name, app, std::cout); + automate_command(cmd, cmd_args, execid, app, std::cout); } std::string commands::cmd_automate::params() ============================================================ --- cmd_db.cc 6446b538ba18b5affc287104b4771a83b8affdab +++ cmd_db.cc bc7f46a061d987e96a55928be3126023ed822e97 @@ -89,7 +89,7 @@ CMD(db, "", CMD_REF(database), else if (idx(args, 0)() == "regenerate_caches") regenerate_caches(app); else - throw usage(ident()); + throw usage(execid); } else if (args.size() == 2) { @@ -104,7 +104,7 @@ CMD(db, "", CMD_REF(database), else if (idx(args, 0)() == "kill_tag_locally") app.db.delete_tag_named(cert_value(idx(args, 1)())); else - throw usage(ident()); + throw usage(execid); } else if (args.size() == 3) { @@ -117,10 +117,10 @@ CMD(db, "", CMD_REF(database), app.db.set_epoch(branch_name(idx(args, 1)()), ed); } else - throw usage(ident()); + throw usage(execid); } else - throw usage(ident()); + throw usage(execid); } CMD(set, "", CMD_REF(variables), N_("DOMAIN NAME VALUE"), @@ -131,7 +131,7 @@ CMD(set, "", CMD_REF(variables), N_("DOM options::opts::none) { if (args.size() != 3) - throw usage(ident()); + throw usage(execid); var_domain d; var_name n; @@ -149,7 +149,7 @@ CMD(unset, "", CMD_REF(variables), N_("D options::opts::none) { if (args.size() != 2) - throw usage(ident()); + throw usage(execid); var_domain d; var_name n; @@ -167,7 +167,7 @@ CMD(complete, "", CMD_REF(informative), options::opts::verbose) { if (args.size() != 2) - throw usage(ident()); + throw usage(execid); bool verbose = app.opts.verbose; @@ -207,7 +207,7 @@ CMD(complete, "", CMD_REF(informative), } } else - throw usage(ident()); + throw usage(execid); } CMD_HIDDEN(test_migration_step, "", CMD_REF(database), "SCHEMA", @@ -217,7 +217,7 @@ CMD_HIDDEN(test_migration_step, "", CMD_ options::opts::none) { if (args.size() != 1) - throw usage(ident()); + throw usage(execid); app.db.test_migration_step(idx(args,0)()); } ============================================================ --- cmd_files.cc 2e732f6ad02aab8f4572d41a1de06e5d460f6760 +++ cmd_files.cc 9c5f3cfc27283b7f749093e4ac47bff1b0ff22e2 @@ -50,7 +50,7 @@ CMD(fmerge, "", CMD_REF(debug), N_(" 1)) - throw usage(ident()); + throw usage(execid); file_path file = file_path_external(idx(args, 0)); split_path sp; @@ -196,7 +196,7 @@ CMD(identify, "", CMD_REF(debug), N_("[P options::opts::none) { if (!(args.size() == 0 || args.size() == 1)) - throw usage(ident()); + throw usage(execid); data dat; @@ -290,7 +290,7 @@ CMD(cat, "", CMD_REF(informative), options::opts::revision) { if (args.size() != 1) - throw usage(ident()); + throw usage(execid); revision_id rid; if (app.opts.revision_selectors.size() == 0) ============================================================ --- cmd_key_cert.cc 99d48e6e7a7716bded2d67533c946b516db972ac +++ cmd_key_cert.cc 283a1ad656d29a2845001c076653214369952c76 @@ -35,7 +35,7 @@ CMD(genkey, "", CMD_REF(key_and_cert), N options::opts::none) { if (args.size() != 1) - throw usage(ident()); + throw usage(execid); rsa_keypair_id ident; internalize_rsa_keypair_id(idx(args, 0), ident); @@ -65,7 +65,7 @@ CMD(dropkey, "", CMD_REF(key_and_cert), bool key_deleted = false; if (args.size() != 1) - throw usage(ident()); + throw usage(execid); rsa_keypair_id ident(idx(args, 0)()); bool checked_db = false; @@ -105,7 +105,7 @@ CMD(passphrase, "", CMD_REF(key_and_cert options::opts::none) { if (args.size() != 1) - throw usage(ident()); + throw usage(execid); rsa_keypair_id ident; internalize_rsa_keypair_id(idx(args, 0), ident); @@ -128,7 +128,7 @@ CMD(ssh_agent_export, "", CMD_REF(key_an options::opts::none) { if (args.size() > 1) - throw usage(ident()); + throw usage(execid); rsa_keypair_id id; keypair key; @@ -167,7 +167,7 @@ CMD(ssh_agent_add, "", CMD_REF(key_and_c options::opts::none) { if (args.size() > 1) - throw usage(ident()); + throw usage(execid); rsa_keypair_id id; keypair key; @@ -184,7 +184,7 @@ CMD(cert, "", CMD_REF(key_and_cert), N_( options::opts::none) { if ((args.size() != 3) && (args.size() != 2)) - throw usage(ident()); + throw usage(execid); transaction_guard guard(app.db); @@ -218,7 +218,7 @@ CMD(trusted, "", CMD_REF(key_and_cert), options::opts::none) { if (args.size() < 4) - throw usage(ident()); + throw usage(execid); revision_id rid; complete(app, idx(args, 0)(), rid, false); @@ -265,7 +265,7 @@ CMD(tag, "", CMD_REF(review), N_("REVISI options::opts::none) { if (args.size() != 2) - throw usage(ident()); + throw usage(execid); revision_id r; complete(app, idx(args, 0)(), r); @@ -279,7 +279,7 @@ CMD(testresult, "", CMD_REF(review), N_( options::opts::none) { if (args.size() != 2) - throw usage(ident()); + throw usage(execid); revision_id r; complete(app, idx(args, 0)(), r); @@ -293,7 +293,7 @@ CMD(approve, "", CMD_REF(review), N_("RE options::opts::branch) { if (args.size() != 1) - throw usage(ident()); + throw usage(execid); revision_id r; complete(app, idx(args, 0)(), r); @@ -308,7 +308,7 @@ CMD(comment, "", CMD_REF(review), N_("RE options::opts::none) { if (args.size() != 1 && args.size() != 2) - throw usage(ident()); + throw usage(execid); utf8 comment; if (args.size() == 2) ============================================================ --- cmd_list.cc 0061f36029425ffd1ad0d58016cb38a9742bc380 +++ cmd_list.cc 097180da9a25f0ce457ee38808fa21e4dc9c367e @@ -53,7 +53,7 @@ CMD(certs, "", CMD_REF(list), "ID", options::opts::depth | options::opts::exclude) { if (args.size() != 1) - throw usage(ident()); + throw usage(execid); vector certs; @@ -161,7 +161,7 @@ CMD(keys, "", CMD_REF(list), "[PATTERN]" if (args.size() == 1) pattern = idx(args, 0)(); else if (args.size() > 1) - throw usage(ident()); + throw usage(execid); if (app.db.database_specified()) { @@ -254,7 +254,7 @@ CMD(branches, "", CMD_REF(list), "[PATTE if (args.size() == 1) inc = globish(idx(args,0)()); else if (args.size() > 1) - throw usage(ident()); + throw usage(execid); vector excludes; typecast_vocab_container(app.opts.exclude_patterns, excludes); combine_and_check_globish(excludes, exc); @@ -335,7 +335,7 @@ CMD(vars, "", CMD_REF(list), "[DOMAIN]", internalize_var_domain(idx(args, 0), filter); } else - throw usage(ident()); + throw usage(execid); map vars; app.db.get_vars(vars); @@ -412,13 +412,14 @@ CMD(unknown, "ignored", CMD_REF(list), " app.work.find_unknown_and_ignored(mask, roots, unknown, ignored); - if (name == "ignored") + utf8 const & realname = execid[execid.size() - 1]; + if (realname() == "ignored") for (path_set::const_iterator i = ignored.begin(); i != ignored.end(); ++i) cout << file_path(*i) << '\n'; else { - I(name == "unknown"); + I(realname() == "unknown"); for (path_set::const_iterator i = unknown.begin(); i != unknown.end(); ++i) cout << file_path(*i) << '\n'; ============================================================ --- cmd_merging.cc e4dbad5b2cb356a53ef126cc9bcdd007953784cf +++ cmd_merging.cc 02a90c3f0193bc5739a547795b9afc770400bf5b @@ -23,6 +23,7 @@ #include "safe_map.hh" #include "ui.hh" #include "app_state.hh" +#include "simplestring_xform.hh" using std::cout; using std::make_pair; @@ -135,10 +136,10 @@ CMD(update, "", CMD_REF(workspace), "", options::opts::branch | options::opts::revision) { if (args.size() > 0) - throw usage(ident()); + throw usage(execid); if (app.opts.revision_selectors.size() > 1) - throw usage(ident()); + throw usage(execid); app.require_workspace(); @@ -338,7 +339,7 @@ CMD(merge, "", CMD_REF(tree), "", typedef set::const_iterator rid_set_iter; if (args.size() != 0) - throw usage(ident()); + throw usage(execid); N(app.opts.branchname() != "", F("please specify a branch, with --branch=BRANCH")); @@ -436,7 +437,7 @@ CMD(propagate, "", CMD_REF(tree), N_("SO options::opts::date | options::opts::author | options::opts::message | options::opts::msgfile) { if (args.size() != 2) - throw usage(ident()); + throw usage(execid); args_vector a = args; a.push_back(arg_type()); process(app, make_command_id("tree merge_into_dir"), a); @@ -477,7 +478,7 @@ CMD(merge_into_dir, "", CMD_REF(tree), N set src_heads, dst_heads; if (args.size() != 3) - throw usage(ident()); + throw usage(execid); app.get_project().get_branch_heads(branch_name(idx(args, 0)()), src_heads); app.get_project().get_branch_heads(branch_name(idx(args, 1)()), dst_heads); @@ -614,7 +615,7 @@ CMD(merge_into_workspace, "", CMD_REF(tr roster_t working_roster; if (args.size() != 1) - throw usage(ident()); + throw usage(execid); app.require_workspace(); @@ -633,7 +634,8 @@ CMD(merge_into_workspace, "", CMD_REF(tr app.work.update_current_roster_from_filesystem(working_roster); N(parent_roster(parents.begin()) == working_roster, - F("'%s' can only be used in a workspace with no pending changes") % name); + F("'%s' can only be used in a workspace with no pending changes") % + join_words(execid)()); left_id = parent_id(parents.begin()); left = parent_cached_roster(parents.begin()); @@ -704,7 +706,7 @@ CMD(explicit_merge, "", CMD_REF(tree), branch_name branch; if (args.size() != 3) - throw usage(ident()); + throw usage(execid); complete(app, idx(args, 0)(), left); complete(app, idx(args, 1)(), right); @@ -727,7 +729,7 @@ CMD(show_conflicts, "", CMD_REF(informat options::opts::branch | options::opts::date | options::opts::author) { if (args.size() != 2) - throw usage(ident()); + throw usage(execid); revision_id l_id, r_id; complete(app, idx(args,0)(), l_id); complete(app, idx(args,1)(), r_id); @@ -803,7 +805,7 @@ CMD(pluck, "", CMD_REF(workspace), N_("[ F("no such revision '%s'") % to_rid); } else - throw usage(ident()); + throw usage(execid); app.require_workspace(); @@ -936,7 +938,7 @@ CMD(heads, "", CMD_REF(tree), "", { set heads; if (args.size() != 0) - throw usage(ident()); + throw usage(execid); N(app.opts.branchname() != "", F("please specify a branch, with --branch=BRANCH")); @@ -1018,7 +1020,7 @@ CMD(get_roster, "", CMD_REF(debug), N_(" app.db.get_roster(rid, roster, mm); } else - throw usage(ident()); + throw usage(execid); roster_data dat; write_roster_and_marking(roster, mm, dat); ============================================================ --- cmd_netsync.cc e5e2ce383a6e9d7fa9148682443c7a81da66b3c0 +++ cmd_netsync.cc 8ced2efe531dc5805532ba6eb98581660514542a @@ -208,7 +208,7 @@ CMD(clone, "", CMD_REF(network), N_("ADD options::opts::exclude | options::opts::branch | options::opts::revision) { if (args.size() < 1 || args.size() > 2 || app.opts.revision_selectors.size() > 1) - throw usage(ident()); + throw usage(execid); revision_id ident; system_path workspace_dir; @@ -394,7 +394,7 @@ CMD_NO_WORKSPACE(serve, "", CMD_REF(netw options::opts::bind_stdio | options::opts::no_transport_auth) { if (!args.empty()) - throw usage(ident()); + throw usage(execid); pid_file pid(app.opts.pidfile); ============================================================ --- cmd_othervcs.cc fb12125d16db52e0ac197b97686ad2c7a6bdb47a +++ cmd_othervcs.cc 683cf3e1677586855cb5f6e8601997b588ff0535 @@ -20,7 +20,7 @@ CMD(rcs_import, "", CMD_REF(debug), N_(" options::opts::branch) { if (args.size() < 1) - throw usage(ident()); + throw usage(execid); for (args_vector::const_iterator i = args.begin(); i != args.end(); ++i) @@ -36,7 +36,7 @@ CMD(cvs_import, "", CMD_REF(rcs), N_("CV options::opts::branch) { if (args.size() != 1) - throw usage(ident()); + throw usage(execid); import_cvs_repo(system_path(idx(args, 0)()), app); } ============================================================ --- cmd_packet.cc 67418301746163151fd844c9c4d80a57f9310049 +++ cmd_packet.cc 84a8725a5a912ad991c8d94948172ce83ae9925e @@ -25,7 +25,7 @@ CMD(pubkey, "", CMD_REF(packet_io), N_(" options::opts::none) { if (args.size() != 1) - throw usage(ident()); + throw usage(execid); rsa_keypair_id ident(idx(args, 0)()); bool exists(false); @@ -55,7 +55,7 @@ CMD(privkey, "", CMD_REF(packet_io), N_( options::opts::none) { if (args.size() != 1) - throw usage(ident()); + throw usage(execid); rsa_keypair_id ident(idx(args, 0)()); N(app.keys.key_pair_exists(ident), ============================================================ --- cmd_ws_commit.cc c3529256b751d83f6ce697829c48e046333b475e +++ cmd_ws_commit.cc cccc112e3f9ea877e1c5932a3e08244a02dacbc4 @@ -217,7 +217,7 @@ CMD(disapprove, "", CMD_REF(review), N_( options::opts::author) { if (args.size() != 1) - throw usage(ident()); + throw usage(execid); utf8 log_message(""); bool log_message_given; @@ -270,7 +270,7 @@ CMD(mkdir, "", CMD_REF(workspace), N_("[ options::opts::no_ignore) { if (args.size() < 1) - throw usage(ident()); + throw usage(execid); app.require_workspace(); @@ -316,7 +316,7 @@ CMD(add, "", CMD_REF(workspace), N_("[PA options::opts::recursive) { if (!app.opts.unknown && (args.size() < 1)) - throw usage(ident()); + throw usage(execid); app.require_workspace(); @@ -349,7 +349,7 @@ CMD(drop, "rm", CMD_REF(workspace), N_(" options::opts::bookkeep_only | options::opts::missing | options::opts::recursive) { if (!app.opts.missing && (args.size() < 1)) - throw usage(ident()); + throw usage(execid); app.require_workspace(); @@ -380,7 +380,7 @@ CMD(rename, "mv", CMD_REF(workspace), options::opts::bookkeep_only) { if (args.size() < 2) - throw usage(ident()); + throw usage(execid); app.require_workspace(); @@ -407,7 +407,7 @@ CMD(pivot_root, "", CMD_REF(workspace), options::opts::bookkeep_only) { if (args.size() != 2) - throw usage(ident()); + throw usage(execid); app.require_workspace(); file_path new_root = file_path_external(idx(args, 0)); @@ -502,7 +502,7 @@ CMD(checkout, "co", CMD_REF(tree), N_("[ transaction_guard guard(app.db, false); if (args.size() > 1 || app.opts.revision_selectors.size() > 1) - throw usage(ident()); + throw usage(execid); if (app.opts.revision_selectors.size() == 0) { @@ -603,7 +603,7 @@ CMD(attr, "", CMD_REF(workspace), options::opts::none) { if (args.size() < 2 || args.size() > 4) - throw usage(ident()); + throw usage(execid); roster_t new_roster; temp_node_id_source nis; @@ -624,7 +624,7 @@ CMD(attr, "", CMD_REF(workspace), if (subcmd == "set") { if (args.size() != 4) - throw usage(ident()); + throw usage(execid); attr_key a_key = attr_key(idx(args, 2)()); attr_value a_value = attr_value(idx(args, 3)()); @@ -649,7 +649,7 @@ CMD(attr, "", CMD_REF(workspace), node->attrs[a_key] = make_pair(false, ""); } else - throw usage(ident()); + throw usage(execid); } parent_map parents; @@ -690,10 +690,10 @@ CMD(attr, "", CMD_REF(workspace), % a_key % path) << '\n'; } else - throw usage(ident()); + throw usage(execid); } else - throw usage(ident()); + throw usage(execid); } @@ -732,7 +732,7 @@ CMD(commit, "ci", CMD_REF(workspace), N_ app.work.update_current_roster_from_filesystem(new_roster, mask); make_restricted_revision(old_rosters, new_roster, mask, restricted_rev, - excluded, name); + excluded, execid); restricted_rev.check_sane(); N(restricted_rev.is_nontrivial(), F("no changes to commit")); @@ -951,7 +951,7 @@ CMD_NO_WORKSPACE(setup, "", CMD_REF(tree options::opts::branch) { if (args.size() > 1) - throw usage(ident()); + throw usage(execid); N(!app.opts.branchname().empty(), F("need --branch argument for setup")); app.db.ensure_open(); @@ -1076,7 +1076,7 @@ CMD_NO_WORKSPACE(migrate_workspace, "", options::opts::none) { if (args.size() > 1) - throw usage(ident()); + throw usage(execid); if (args.size() == 1) go_to_workspace(system_path(idx(args, 0))); ============================================================ --- commands.cc ab682a798b0f98934c6638e98b70245e5f573a6e +++ commands.cc b113c466e6fd2853f85e2b22ff60d983bf951e0b @@ -667,7 +667,7 @@ namespace commands if (cmd->use_workspace_options()) app.process_options(); - cmd->exec(app, join_words(ident)(), args); // XXX + cmd->exec(app, ident, args); return 0; } else @@ -731,7 +731,7 @@ CMD_HIDDEN(crash, "", CMD_REF(__root__), options::opts::none) { if (args.size() != 1) - throw usage(ident()); + throw usage(execid); bool spoon_exists(false); if (idx(args,0)() == "N") N(spoon_exists, i18n_format("There is no spoon.")); @@ -774,7 +774,7 @@ CMD_HIDDEN(crash, "", CMD_REF(__root__), { // fall through and throw usage } #endif - throw usage(ident()); + throw usage(execid); } #undef maybe_throw #undef maybe_throw_bare ============================================================ --- revision.cc c4c178a6e314921aa37997f7f6fc9b56d5fa51de +++ revision.cc b11b83b54d4b07e23ff3c30749008f300dd0f815 @@ -719,7 +719,7 @@ make_restricted_revision(parent_map cons node_restriction const & mask, revision_t & rev, cset & excluded, - string const & cmd_name) + commands::command_id const & cmd_name) { edge_map edges; bool no_excludes = true; @@ -738,7 +738,7 @@ make_restricted_revision(parent_map cons N(old_rosters.size() == 1 || no_excludes, F("the command '%s %s' cannot be restricted in a two-parent workspace") - % ui.prog_name % cmd_name); + % ui.prog_name % join_words(cmd_name)()); recalculate_manifest_id_for_restricted_rev(old_rosters, edges, rev); } @@ -1779,7 +1779,7 @@ CMD_HIDDEN(rev_height, "", CMD_REF(infor options::opts::none) { if (args.size() != 1) - throw usage(ident()); + throw usage(execid); revision_id rid(idx(args, 0)()); N(app.db.revision_exists(rid), F("No such revision %s") % rid); rev_height height; ============================================================ --- revision.hh 5f873cb70641d7a40d9e17a897f318ab8f34026c +++ revision.hh c8ba22a180653cff9231e65e3fbe936abc46e8b7 @@ -18,6 +18,7 @@ #include "cset.hh" #include "vocab.hh" #include "database.hh" +#include "commands.hh" class app_state; @@ -216,7 +217,7 @@ make_restricted_revision(parent_map cons node_restriction const & mask, revision_t & rev, cset & excluded, - std::string const & cmd_name); + commands::command_id const & cmd_name); void build_changesets_from_manifest_ancestry(app_state & app);