# # # patch "commands.cc" # from [14bc096227f37257f9c577a27009089b125db0e4] # to [8c56069bd84d00ceeb78734337c2accf713baf07] # # patch "monotone.cc" # from [21e9134b821467b0771d5092a6220d8785d1d1f8] # to [1fbe846cf7073f9679be1c4c8bd00e67402053a0] # ============================================================ --- commands.cc 14bc096227f37257f9c577a27009089b125db0e4 +++ commands.cc 8c56069bd84d00ceeb78734337c2accf713baf07 @@ -198,9 +198,12 @@ namespace commands { { command_id i; - if (parent() != NULL) - i = parent()->ident(); - i.push_back(primary_name()); + // XXX public must go away + if (this != CMD_REF(the_root) && this != CMD_REF(public)) + { + i = parent()->ident(); + i.push_back(primary_name()); + } return i; } ============================================================ --- monotone.cc 21e9134b821467b0771d5092a6220d8785d1d1f8 +++ monotone.cc 1fbe846cf7073f9679be1c4c8bd00e67402053a0 @@ -127,12 +127,13 @@ commands::command_id read_options(option // read command-line options and return the command name commands::command_id read_options(options & opts, args_vector args) { + commands::command_id cmd; + option::concrete_option_set optset = options::opts::all_options().instantiate(&opts); optset.from_command_line(args); // consume the command, and perform completion if necessary - commands::command_id cmd; if (!opts.args.empty()) { args_vector rest; @@ -151,7 +152,11 @@ commands::command_id read_options(option optset.from_command_line(args, false); if (!opts.args.empty()) - opts.args.erase(opts.args.begin()); + { + I(opts.args.size() >= cmd.size()); + for (args_vector::size_type i = 0; i < cmd.size(); i++) + opts.args.erase(opts.args.begin()); + } return cmd; }