# # # patch "automate.cc" # from [f5a439cfc076a7889789bec7d7084ad6131bddad] # to [67f9c8a05bfa66bf3761cbb0798a9648f3088baa] # # patch "cmd_diff_log.cc" # from [73fb2c9170fbe7316424beb8d56577a0dac22fb5] # to [34d46a907df8c7a5de33bb923cbb2b659546aabb] # # patch "cmd_files.cc" # from [0e0f670c8b91d458f67261ddd56c7623bde50d71] # to [e51fa86b305fd51c79fac69f57e31e54810efc1e] # # patch "cmd_list.cc" # from [3fbbf9201a494696bc1163a9548bd9697a43ab4b] # to [2dc068226bb37171d2e47b67f9ecde3d224445f5] # # patch "cmd_merging.cc" # from [3bc3b7bd025f88bd49e24cf291782501302ff313] # to [0df36dca98fc618597c7bfb162059365c74a490c] # # patch "cmd_netsync.cc" # from [fda8fe41f0214a723e0fa4aeb94b18ed6de3a473] # to [a2432bc640b31527fcc379e5841fb429051b8cf5] # # patch "cmd_ws_commit.cc" # from [c468c40a27b0d03b9396fcd15840ec334042ef0e] # to [385c5ac87b180976f0d5c983469e924b58cd11c3] # # patch "keys.cc" # from [0453371d883627c72f93b9817266b1a9e5981137] # to [b6aca441cf2637759c6d7e2b10ccc4f679e07448] # # patch "options_list.hh" # from [0c02a93e3aca4a12aa92a5f0b2ef528c18fdbbdb] # to [9ec13f0e7fbcd9abacb2b04ef04be2437ce5068c] # # patch "work.cc" # from [f52c17498c819506b354b30f272a0c7cd4741213] # to [e569491aafe1ca83734e005352277fdcc07d7d43] # ============================================================ --- automate.cc f5a439cfc076a7889789bec7d7084ad6131bddad +++ automate.cc 67f9c8a05bfa66bf3761cbb0798a9648f3088baa @@ -1042,7 +1042,7 @@ CMD_AUTOMATE(inventory, N_("[PATH]...") inventory_map inventory; vector includes = args_to_paths(args); - vector excludes = args_to_paths(app.opts.exclude_patterns); + vector excludes = args_to_paths(app.opts.exclude); if (!app.opts.no_corresponding_renames) { @@ -1285,7 +1285,7 @@ CMD_AUTOMATE(get_current_revision, N_("[ work.get_current_roster_shape(db, nis, new_roster); node_restriction mask(args_to_paths(args), - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, old_rosters, new_roster); ============================================================ --- cmd_diff_log.cc 73fb2c9170fbe7316424beb8d56577a0dac22fb5 +++ cmd_diff_log.cc 34d46a907df8c7a5de33bb923cbb2b659546aabb @@ -251,13 +251,13 @@ prepare_diff(app_state & app, // initialize before transaction so we have a database to work with. project_t project(db); - E(app.opts.revision_selectors.size() <= 2, origin::user, + E(app.opts.revision.size() <= 2, origin::user, F("more than two revisions given")); - E(!app.opts.reverse || app.opts.revision_selectors.size() == 1, origin::user, + E(!app.opts.reverse || app.opts.revision.size() == 1, origin::user, F("--reverse only allowed with exactly one revision")); - if (app.opts.revision_selectors.empty()) + if (app.opts.revision.empty()) { roster_t left_roster, restricted_roster, right_roster; revision_id old_rid; @@ -276,7 +276,7 @@ prepare_diff(app_state & app, work.get_current_roster_shape(db, nis, right_roster); node_restriction mask(args_to_paths(args), - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, left_roster, right_roster, ignored_file(work)); @@ -293,19 +293,19 @@ prepare_diff(app_state & app, header << "# old_revision [" << old_rid << "]\n"; } - else if (app.opts.revision_selectors.size() == 1) + else if (app.opts.revision.size() == 1) { roster_t left_roster, restricted_roster, right_roster; revision_id r_old_id; workspace work(app); - complete(app.opts, app.lua, project, idx(app.opts.revision_selectors, 0)(), r_old_id); + complete(app.opts, app.lua, project, idx(app.opts.revision, 0)(), r_old_id); db.get_roster(r_old_id, left_roster); work.get_current_roster_shape(db, nis, right_roster); node_restriction mask(args_to_paths(args), - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, left_roster, right_roster, ignored_file(work)); @@ -331,13 +331,13 @@ prepare_diff(app_state & app, header << "# old_revision [" << r_old_id << "]\n"; } - else if (app.opts.revision_selectors.size() == 2) + else if (app.opts.revision.size() == 2) { roster_t left_roster, restricted_roster, right_roster; revision_id r_old_id, r_new_id; - complete(app.opts, app.lua, project, idx(app.opts.revision_selectors, 0)(), r_old_id); - complete(app.opts, app.lua, project, idx(app.opts.revision_selectors, 1)(), r_new_id); + complete(app.opts, app.lua, project, idx(app.opts.revision, 0)(), r_old_id); + complete(app.opts, app.lua, project, idx(app.opts.revision, 1)(), r_new_id); db.get_roster(r_old_id, left_roster); db.get_roster(r_new_id, right_roster); @@ -365,7 +365,7 @@ prepare_diff(app_state & app, // since versioned paths are required to be relative. node_restriction mask(args_to_paths(args), - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, left_roster, right_roster); @@ -663,7 +663,7 @@ log_common (app_state & app, // start at revisions specified and implied by --from selectors set starting_revs; - if (app.opts.from.empty() && app.opts.revision_selectors.empty()) + if (app.opts.from.empty() && app.opts.revision.empty()) { // only set default --from revs if no --revision selectors were specified workspace work(app, F("try passing a --from revision to start at")); @@ -731,10 +731,10 @@ log_common (app_state & app, // select revisions specified by --revision selectors set selected_revs; - if (!app.opts.revision_selectors.empty()) + if (!app.opts.revision.empty()) { - for (args_vector::const_iterator i = app.opts.revision_selectors.begin(); - i != app.opts.revision_selectors.end(); i++) + for (args_vector::const_iterator i = app.opts.revision.begin(); + i != app.opts.revision.end(); i++) { set rids; MM(rids); @@ -745,7 +745,7 @@ log_common (app_state & app, set_difference(rids.begin(), rids.end(), ending_revs.begin(), ending_revs.end(), inserter(selected_revs, selected_revs.end())); - if (null_id(first_rid) && i == app.opts.revision_selectors.begin()) + if (null_id(first_rid) && i == app.opts.revision.begin()) first_rid = *rids.begin(); } } @@ -754,7 +754,7 @@ log_common (app_state & app, node_restriction mask; - if (!args.empty() || !app.opts.exclude_patterns.empty()) + if (!args.empty() || !app.opts.exclude.empty()) { // User wants to trace only specific files if (app.opts.from.empty()) @@ -768,7 +768,7 @@ log_common (app_state & app, work.get_current_roster_shape(db, nis, new_roster); mask = node_restriction(args_to_paths(args), - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, parents, new_roster, ignored_file(work)); } @@ -781,13 +781,13 @@ log_common (app_state & app, db.get_roster(first_rid, roster); mask = node_restriction(args_to_paths(args), - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, roster); } } // if --revision was specified without --from log only the selected revs - bool log_selected(!app.opts.revision_selectors.empty() && + bool log_selected(!app.opts.revision.empty() && app.opts.from.empty()); if (log_selected) @@ -887,7 +887,7 @@ log_common (app_state & app, if (app.opts.no_merges && rev.is_merge_node()) print_this = false; - else if (!app.opts.revision_selectors.empty() && + else if (!app.opts.revision.empty() && selected_revs.find(rid) == selected_revs.end()) print_this = false; ============================================================ --- cmd_files.cc 0e0f670c8b91d458f67261ddd56c7623bde50d71 +++ cmd_files.cc e51fa86b305fd51c79fac69f57e31e54810efc1e @@ -142,7 +142,7 @@ CMD(annotate, "annotate", "", CMD_REF(in database db(app); project_t project(db); - if ((args.size() != 1) || (app.opts.revision_selectors.size() > 1)) + if ((args.size() != 1) || (app.opts.revision.size() > 1)) throw usage(execid); file_path file = file_path_external(idx(args, 0)); @@ -150,7 +150,7 @@ CMD(annotate, "annotate", "", CMD_REF(in L(FL("annotate file '%s'") % file); roster_t roster; - if (app.opts.revision_selectors.empty()) + if (app.opts.revision.empty()) { // What this _should_ do is calculate the current workspace roster // and/or revision and hand that to do_annotate. This should just @@ -178,7 +178,7 @@ CMD(annotate, "annotate", "", CMD_REF(in } else { - complete(app.opts, app.lua, project, idx(app.opts.revision_selectors, 0)(), rid); + complete(app.opts, app.lua, project, idx(app.opts.revision, 0)(), rid); db.get_roster(rid, roster); } @@ -296,7 +296,7 @@ CMD(cat, "cat", "", CMD_REF(informative) database db(app); revision_id rid; - if (app.opts.revision_selectors.empty()) + if (app.opts.revision.empty()) { workspace work(app); parent_map parents; @@ -308,7 +308,7 @@ CMD(cat, "cat", "", CMD_REF(informative) else { project_t project(db); - complete(app.opts, app.lua, project, idx(app.opts.revision_selectors, 0)(), rid); + complete(app.opts, app.lua, project, idx(app.opts.revision, 0)(), rid); } dump_file(db, cout, rid, idx(args, 0)); @@ -363,7 +363,7 @@ CMD_AUTOMATE(get_file_of, N_("FILENAME") database db(app); revision_id rid; - if (app.opts.revision_selectors.empty()) + if (app.opts.revision.empty()) { workspace work(app); @@ -376,7 +376,7 @@ CMD_AUTOMATE(get_file_of, N_("FILENAME") else { project_t project(db); - complete(app.opts, app.lua, project, idx(app.opts.revision_selectors, 0)(), rid); + complete(app.opts, app.lua, project, idx(app.opts.revision, 0)(), rid); } dump_file(db, output, rid, idx(args, 0)); ============================================================ --- cmd_list.cc 3fbbf9201a494696bc1163a9548bd9697a43ab4b +++ cmd_list.cc 2dc068226bb37171d2e47b67f9ecde3d224445f5 @@ -217,10 +217,10 @@ CMD(duplicates, "duplicates", "", CMD_RE database db(app); project_t project(db); - E(app.opts.revision_selectors.size() <= 1, origin::user, + E(app.opts.revision.size() <= 1, origin::user, F("more than one revision given")); - if (app.opts.revision_selectors.empty()) + if (app.opts.revision.empty()) { workspace work(app); temp_node_id_source nis; @@ -230,7 +230,7 @@ CMD(duplicates, "duplicates", "", CMD_RE else { complete(app.opts, app.lua, project, - idx(app.opts.revision_selectors, 0)(), rev_id); + idx(app.opts.revision, 0)(), rev_id); E(db.revision_exists(rev_id), origin::user, F("no revision %s found in database") % rev_id); db.get_roster(rev_id, roster); @@ -485,7 +485,7 @@ CMD(branches, "branches", "", CMD_REF(li database db(app); project_t project(db); - globish exc(app.opts.exclude_patterns); + globish exc(app.opts.exclude); set names; project.get_branch_list(inc, names, !app.opts.ignore_suspend_certs); @@ -558,7 +558,7 @@ CMD(tags, "tags", "", CMD_REF(list), "[P vector certs; project.get_revision_certs(i->ident, certs); - globish exc(app.opts.exclude_patterns); + globish exc(app.opts.exclude); if (inc.matches(i->name()) && !exc.matches(i->name())) { @@ -727,7 +727,7 @@ CMD(known, "known", "", CMD_REF(list), " work.get_current_roster_shape(db, nis, new_roster); node_restriction mask(args_to_paths(args), - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, new_roster, ignored_file(work)); @@ -763,7 +763,7 @@ CMD(unknown, "unknown", "ignored", CMD_R workspace work(app); vector roots = args_to_paths(args); - path_restriction mask(roots, args_to_paths(app.opts.exclude_patterns), + path_restriction mask(roots, args_to_paths(app.opts.exclude), app.opts.depth, ignored_file(work)); set unknown, ignored; @@ -796,7 +796,7 @@ CMD(missing, "missing", "", CMD_REF(list roster_t current_roster_shape; work.get_current_roster_shape(db, nis, current_roster_shape); node_restriction mask(args_to_paths(args), - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, current_roster_shape, ignored_file(work)); @@ -825,7 +825,7 @@ CMD(changed, "changed", "", CMD_REF(list work.get_parent_rosters(db, parents); node_restriction mask(args_to_paths(args), - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, parents, new_roster, ignored_file(work)); ============================================================ --- cmd_merging.cc 3bc3b7bd025f88bd49e24cf291782501302ff313 +++ cmd_merging.cc 0df36dca98fc618597c7bfb162059365c74a490c @@ -217,7 +217,7 @@ update(app_state & app, F("cannot determine branch for update")); revision_id chosen_rid; - if (app.opts.revision_selectors.empty()) + if (app.opts.revision.empty()) { P(F("updating along branch '%s'") % app.opts.branch); set candidates; @@ -244,7 +244,7 @@ update(app_state & app, } else { - complete(app.opts, app.lua, project, app.opts.revision_selectors[0](), chosen_rid); + complete(app.opts, app.lua, project, app.opts.revision[0](), chosen_rid); } I(!null_id(chosen_rid)); @@ -368,7 +368,7 @@ CMD(update, "update", "", CMD_REF(worksp if (!args.empty()) throw usage(execid); - if (app.opts.revision_selectors.size() > 1) + if (app.opts.revision.size() > 1) throw usage(execid); update(app, args); @@ -383,7 +383,7 @@ CMD_AUTOMATE(update, "", E(args.empty(), origin::user, F("wrong argument count")); - E(app.opts.revision_selectors.size() <= 1, origin::user, + E(app.opts.revision.size() <= 1, origin::user, F("at most one revision selector may be specified")); update(app, args); @@ -1261,9 +1261,9 @@ CMD(pluck, "pluck", "", CMD_REF(workspac // Work out our arguments revision_id from_rid, to_rid; - if (app.opts.revision_selectors.size() == 1) + if (app.opts.revision.size() == 1) { - complete(app.opts, app.lua, project, idx(app.opts.revision_selectors, 0)(), to_rid); + complete(app.opts, app.lua, project, idx(app.opts.revision, 0)(), to_rid); std::set parents; db.get_revision_parents(to_rid, parents); E(parents.size() == 1, origin::user, @@ -1275,10 +1275,10 @@ CMD(pluck, "pluck", "", CMD_REF(workspac % to_rid); from_rid = *parents.begin(); } - else if (app.opts.revision_selectors.size() == 2) + else if (app.opts.revision.size() == 2) { - complete(app.opts, app.lua, project, idx(app.opts.revision_selectors, 0)(), from_rid); - complete(app.opts, app.lua, project, idx(app.opts.revision_selectors, 1)(), to_rid); + complete(app.opts, app.lua, project, idx(app.opts.revision, 0)(), from_rid); + complete(app.opts, app.lua, project, idx(app.opts.revision, 1)(), to_rid); } else throw usage(execid); @@ -1333,7 +1333,7 @@ CMD(pluck, "pluck", "", CMD_REF(workspac roster_t to_true_roster; db.get_roster(to_rid, to_true_roster); node_restriction mask(args_to_paths(args), - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, *from_roster, to_true_roster, ignored_file(work)); ============================================================ --- cmd_netsync.cc fda8fe41f0214a723e0fa4aeb94b18ed6de3a473 +++ cmd_netsync.cc a2432bc640b31527fcc379e5841fb429051b8cf5 @@ -71,16 +71,16 @@ extract_client_connection_info(options & else if (args.size() >= 2) { arg_type server = idx(args, 0); - vector include_patterns; - include_patterns.insert(include_patterns.begin(), + vector include; + include.insert(include.begin(), args.begin() + 1, args.end()); - vector exclude_patterns = opts.exclude_patterns; + vector exclude = opts.exclude; netsync_connection_info::setup_from_server_and_pattern(opts, project.db, lua, type, server, - include_patterns, - exclude_patterns, + include, + exclude, info); } else @@ -273,7 +273,7 @@ CMD(push, "push", "", CMD_REF(network), "to the netsync server at the address ADDRESS."), options::opts::max_netsync_version | options::opts::min_netsync_version | options::opts::set_default | options::opts::exclude | - options::opts::key_to_push) + options::opts::keys_to_push) { database db(app); key_store keys(app); @@ -293,7 +293,7 @@ CMD_AUTOMATE(push, N_("[URL]\n[ADDRESS[: options::opts::max_netsync_version | options::opts::min_netsync_version | options::opts::set_default | options::opts::exclude | - options::opts::key_to_push) + options::opts::keys_to_push) { database db(app); key_store keys(app); @@ -361,7 +361,7 @@ CMD(sync, "sync", "", CMD_REF(network), "with the netsync server at the address ADDRESS."), options::opts::max_netsync_version | options::opts::min_netsync_version | options::opts::set_default | options::opts::exclude | - options::opts::key_to_push | options::opts::auto_update) + options::opts::keys_to_push | options::opts::auto_update) { database db(app); key_store keys(app); @@ -391,7 +391,7 @@ CMD_AUTOMATE(sync, N_("[URL]\n[ADDRESS[: "", options::opts::max_netsync_version | options::opts::min_netsync_version | options::opts::set_default | options::opts::exclude | - options::opts::key_to_push) + options::opts::keys_to_push) { database db(app); key_store keys(app); @@ -428,7 +428,7 @@ CMD_NO_WORKSPACE(clone, "clone", "", CMD bool host_branch_arg = (args.size() == 2 || args.size() == 3) && idx(args, 0)().find("://") == string::npos; - bool no_ambigious_revision = app.opts.revision_selectors.size() < 2; + bool no_ambigious_revision = app.opts.revision.size() < 2; if (!(no_ambigious_revision && (url_arg || host_branch_arg))) throw usage(execid); @@ -467,13 +467,13 @@ CMD_NO_WORKSPACE(clone, "clone", "", CMD } else { - vector include_patterns; - include_patterns.push_back(idx(args, 1)); + vector include; + include.push_back(idx(args, 1)); netsync_connection_info::setup_from_server_and_pattern(app.opts, project.db, app.lua, netsync_connection, - server, include_patterns, - app.opts.exclude_patterns, + server, include, + app.opts.exclude, info); if (args.size() == 3) workspace_arg = idx(args, 2); @@ -549,7 +549,7 @@ CMD_NO_WORKSPACE(clone, "clone", "", CMD transaction_guard guard(db, false); revision_id ident; - if (app.opts.revision_selectors.empty()) + if (app.opts.revision.empty()) { set heads; project.get_branch_heads(app.opts.branch, heads, @@ -567,10 +567,10 @@ CMD_NO_WORKSPACE(clone, "clone", "", CMD } ident = *(heads.begin()); } - else if (app.opts.revision_selectors.size() == 1) + else if (app.opts.revision.size() == 1) { // use specified revision - complete(app.opts, app.lua, project, idx(app.opts.revision_selectors, 0)(), ident); + complete(app.opts, app.lua, project, idx(app.opts.revision, 0)(), ident); E(project.revision_is_in_branch(ident, app.opts.branch), origin::user, ============================================================ --- cmd_ws_commit.cc c468c40a27b0d03b9396fcd15840ec334042ef0e +++ cmd_ws_commit.cc 385c5ac87b180976f0d5c983469e924b58cd11c3 @@ -382,7 +382,7 @@ revert(app_state & app, roster_t old_roster, new_roster; cset preserved; - E(app.opts.missing || !args.empty() || !app.opts.exclude_patterns.empty(), + E(app.opts.missing || !args.empty() || !app.opts.exclude.empty(), origin::user, F("you must pass at least one path to 'revert' (perhaps '.')")); @@ -401,7 +401,7 @@ revert(app_state & app, } node_restriction mask(args_to_paths(args), - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, old_roster, new_roster, ignored_file(work), restriction::explicit_includes); @@ -779,7 +779,7 @@ void perform_add(app_state & app, bool add_recursive = app.opts.recursive; if (app.opts.unknown) { - path_restriction mask(roots, args_to_paths(app.opts.exclude_patterns), + path_restriction mask(roots, args_to_paths(app.opts.exclude), app.opts.depth, ignored_file(work)); set ignored; @@ -827,7 +827,7 @@ void perform_drop(app_state & app, roster_t current_roster_shape; work.get_current_roster_shape(db, nis, current_roster_shape); node_restriction mask(roots, - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, current_roster_shape, ignored_file(work)); work.find_missing(current_roster_shape, mask, paths); @@ -935,7 +935,7 @@ CMD(status, "status", "", CMD_REF(inform work.get_current_roster_shape(db, nis, new_roster); node_restriction mask(args_to_paths(args), - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, old_rosters, new_roster, ignored_file(work)); @@ -1049,10 +1049,10 @@ CMD(checkout, "checkout", "co", CMD_REF( project_t project(db); transaction_guard guard(db, false); - if (args.size() > 1 || app.opts.revision_selectors.size() > 1) + if (args.size() > 1 || app.opts.revision.size() > 1) throw usage(execid); - if (app.opts.revision_selectors.empty()) + if (app.opts.revision.empty()) { // use branch head revision E(!app.opts.branch().empty(), origin::user, @@ -1075,10 +1075,10 @@ CMD(checkout, "checkout", "co", CMD_REF( } revid = *(heads.begin()); } - else if (app.opts.revision_selectors.size() == 1) + else if (app.opts.revision.size() == 1) { // use specified revision - complete(app.opts, app.lua, project, idx(app.opts.revision_selectors, 0)(), revid); + complete(app.opts, app.lua, project, idx(app.opts.revision, 0)(), revid); guess_branch(app.opts, project, revid); @@ -1506,7 +1506,7 @@ void perform_commit(app_state & app, work.get_current_roster_shape(db, nis, new_roster); node_restriction mask(paths, - args_to_paths(app.opts.exclude_patterns), + args_to_paths(app.opts.exclude), app.opts.depth, old_rosters, new_roster, ignored_file(work)); @@ -1864,10 +1864,10 @@ CMD_NO_WORKSPACE(import, "import", "", C E(args.size() == 1, origin::user, F("you must specify a directory to import")); - if (app.opts.revision_selectors.size() == 1) + if (app.opts.revision.size() == 1) { // use specified revision - complete(app.opts, app.lua, project, idx(app.opts.revision_selectors, 0)(), ident); + complete(app.opts, app.lua, project, idx(app.opts.revision, 0)(), ident); guess_branch(app.opts, project, ident); @@ -1924,14 +1924,14 @@ CMD_NO_WORKSPACE(import, "import", "", C // prepare stuff for 'add' and so on. options save_opts; // add --unknown - save_opts.exclude_patterns = app.opts.exclude_patterns; - app.opts.exclude_patterns = args_vector(); + save_opts.exclude = app.opts.exclude; + app.opts.exclude = args_vector(); app.opts.unknown = true; app.opts.recursive = true; perform_add(app, db, work, vector()); app.opts.recursive = false; app.opts.unknown = false; - app.opts.exclude_patterns = save_opts.exclude_patterns; + app.opts.exclude = save_opts.exclude; // drop --missing save_opts.no_ignore = app.opts.no_ignore; @@ -2264,11 +2264,11 @@ bisect_update(app_state & app, bisect::t set marked_ids; // mark the current or specified revisions as good, bad or skipped - if (app.opts.revision_selectors.empty()) + if (app.opts.revision.empty()) marked_ids.insert(current_id); else - for (args_vector::const_iterator i = app.opts.revision_selectors.begin(); - i != app.opts.revision_selectors.end(); i++) + for (args_vector::const_iterator i = app.opts.revision.begin(); + i != app.opts.revision.end(); i++) { set rids; MM(rids); ============================================================ --- keys.cc 0453371d883627c72f93b9817266b1a9e5981137 +++ keys.cc b6aca441cf2637759c6d7e2b10ccc4f679e07448 @@ -131,12 +131,12 @@ get_user_key(options const & opts, lua_h } // key_given is not set if the key option was extracted from the workspace - if (opts.key_given || !opts.signing_key().empty()) + if (opts.key_given || !opts.key().empty()) { - if (!opts.signing_key().empty()) + if (!opts.key().empty()) { key_identity_info identity; - project.get_key_identity(keys, lua, opts.signing_key, identity); + project.get_key_identity(keys, lua, opts.key, identity); key = identity.id; } else @@ -174,13 +174,13 @@ cache_netsync_key(options const & opts, key_id key; // key_given is not set if the key option was extracted from the workspace - if (opts.key_given || !opts.signing_key().empty()) + if (opts.key_given || !opts.key().empty()) { key_identity_info identity; // maybe they specifically requested no key ("--key ''") - if (!opts.signing_key().empty()) + if (!opts.key().empty()) { - project.get_key_identity(keys, lua, opts.signing_key, identity); + project.get_key_identity(keys, lua, opts.key, identity); key = identity.id; found_key = true; } ============================================================ --- options_list.hh 0c02a93e3aca4a12aa92a5f0b2ef528c18fdbbdb +++ options_list.hh 9ec13f0e7fbcd9abacb2b04ef04be2437ce5068c @@ -269,6 +269,8 @@ GLOBAL_SIMPLE_OPTION(no_default_confdir, GLOBAL_SIMPLE_OPTION(no_default_confdir, "no-default-confdir/allow-default-confdir", bool, gettext_noop("forbid use of the default confdir")) +// If we get more date arguments, add a specialization for set_simple_option +// and make this a SIMPLE_OPTION OPT(date, "date", date_t, , gettext_noop("override date/time for commit")) #ifdef option_bodies @@ -284,6 +286,7 @@ OPT(date, "date", date_t, , } #endif +// FIXME: --date-format and --no-format-dates should override eachother OPTSET(date_formats) OPTSET_REL(globals, date_formats) GROUPED_SIMPLE_OPTION(date_formats, date_fmt, @@ -321,6 +324,7 @@ GLOBAL_SIMPLE_OPTION(roster_cache_perfor system_path, gettext_noop("log roster cache statistic to the given file")) +// FIXME this needs to be a flag, not a function call OPTION(globals, debug, false, "debug", gettext_noop("print debug log to stderr while running")) #ifdef option_bodies @@ -392,15 +396,10 @@ GLOBAL_SIMPLE_OPTION(dump, "dump", syste GLOBAL_SIMPLE_OPTION(dump, "dump", system_path, gettext_noop("file to dump debugging log to, on failure")) -OPTSET(exclude) -OPTVAR(exclude, args_vector, exclude_patterns, ) -OPTION(exclude, exclude, true, "exclude", - gettext_noop("leave out anything described by its argument")) -#ifdef option_bodies -{ - exclude_patterns.push_back(arg_type(arg, origin::user)); -} -#endif +SIMPLE_OPTION(exclude, "exclude", args_vector, + gettext_noop("leave out anything described by its argument")) +SIMPLE_OPTION(include, "include", args_vector, + gettext_noop("include anything described by its argument")) SIMPLE_OPTION(bookkeep_only, "bookkeep-only", bool, gettext_noop("only update monotone's internal bookkeeping, not the filesystem")) @@ -443,32 +442,15 @@ SIMPLE_OPTION(show_hidden_commands, "hid SIMPLE_OPTION(show_hidden_commands, "hidden/no-hidden", bool, gettext_noop("show hidden commands and options")) -OPTSET(include) -OPTVAR(include, args_vector, include_patterns, ) -OPTION(include, include, true, "include", - gettext_noop("include anything described by its argument")) -#ifdef option_bodies -{ - include_patterns.push_back(arg_type(arg, origin::user)); -} -#endif - GLOBAL_SIMPLE_OPTION(ignore_suspend_certs, "ignore-suspend-certs/no-ignore-suspend-certs", bool, gettext_noop("do not ignore revisions marked as suspended")) GLOBAL_SIMPLE_OPTION(non_interactive, "non-interactive/interactive", bool, gettext_noop("do not prompt the user for input")) -OPTSET(key) -OPTVAR(key, external_key_name, signing_key, ) -OPTION(globals, key, true, "key,k/use-default-key", +GLOBAL_SIMPLE_OPTION(key, "key,k/use-default-key", external_key_name, gettext_noop("sets the key for signatures, using either the key " "name or the key hash")) -#ifdef option_bodies -{ - signing_key = external_key_name(arg, origin::user); -} -#endif // Remember COMMA doesn't work with GOPT, use long form. //GOPT(key_dir, "keydir", system_path, get_default_keydir() COMMA origin::user, @@ -481,15 +463,8 @@ OPTION(globals, key_dir, true, "keydir", } #endif -OPTSET(key_to_push) -OPTVAR(key_to_push, std::vector, keys_to_push, ) -OPTION(key_to_push, key_to_push, true, "key-to-push", +SIMPLE_OPTION(keys_to_push, "key-to-push", std::vector, gettext_noop("push the specified key even if it hasn't signed anything")) -#ifdef option_bodies -{ - keys_to_push.push_back(external_key_name(arg, origin::user)); -} -#endif OPT(last, "last", long, -1, gettext_noop("limit log output to the last number of entries")) @@ -501,34 +476,17 @@ OPT(last, "last", long, -1, } #endif -GLOBAL_SIMPLE_OPTION(log, "log", system_path, gettext_noop("file to write the log to")) +GLOBAL_SIMPLE_OPTION(log, "log", system_path, + gettext_noop("file to write the log to")) OPTSET(messages) -OPTVAR(messages, std::vector, message, ) -OPTVAR(messages, utf8, msgfile, ) -OPTVAR(messages, bool, no_prefix, false) -OPTION(messages, message, true, "message,m", +GROUPED_SIMPLE_OPTION(messages, message, "message,m", std::vector, gettext_noop("set commit changelog message")) -#ifdef option_bodies -{ - message.push_back(arg); -} -#endif -OPTION(messages, msgfile, true, "message-file", +GROUPED_SIMPLE_OPTION(messages, msgfile, "message-file", utf8, gettext_noop("set filename containing commit changelog message")) -#ifdef option_bodies -{ - msgfile = utf8(arg, origin::user); -} -#endif HIDE(no_prefix) -OPTION(messages, no_prefix, false, "no-prefix", +GROUPED_SIMPLE_OPTION(messages, no_prefix, "no-prefix", bool, gettext_noop("no prefix to message")) -#ifdef option_bodies -{ - no_prefix = true; -} -#endif SIMPLE_OPTION(missing, "missing", bool, gettext_noop("perform the operations for files missing from workspace")) @@ -555,8 +513,13 @@ SIMPLE_OPTION(no_merges, "no-merges/merg SIMPLE_OPTION(no_merges, "no-merges/merges", bool, gettext_noop("exclude merges when printing logs")) +// FIXME: ~/.monotone/monotonerc should be +// %APPDATA%\monotone\monotonerc on Windows +// ...but, there's no way currently to make a option description +// vary like that GLOBAL_SIMPLE_OPTION(norc, "norc/yesrc", bool, - gettext_noop("do not load ~/.monotone/monotonerc or _MTN/monotonerc lua files")) + gettext_noop("do not load ~/.monotone/monotonerc or " + "_MTN/monotonerc lua files")) GLOBAL_SIMPLE_OPTION(nostd, "nostd/stdhooks", bool, gettext_noop("do not load standard lua hooks")) @@ -629,15 +592,8 @@ SIMPLE_OPTION(recursive, "recursive,R/no SIMPLE_OPTION(recursive, "recursive,R/no-recursive", bool, gettext_noop("also operate on the contents of any listed directories")) -OPTSET(revision) -OPTVAR(revision, args_vector, revision_selectors, ) -OPTION(revision, revision, true, "revision,r", +SIMPLE_OPTION(revision, "revision,r",args_vector, gettext_noop("select revision id for operation")) -#ifdef option_bodies -{ - revision_selectors.push_back(arg_type(arg, origin::user)); -} -#endif GLOBAL_SIMPLE_OPTION(root, "root", std::string, gettext_noop("limit search for workspace to specified root")) ============================================================ --- work.cc f52c17498c819506b354b30f272a0c7cd4741213 +++ work.cc e569491aafe1ca83734e005352277fdcc07d7d43 @@ -509,7 +509,7 @@ read_options_file(any_path const & optsp } else if (opt == "key") { - opts.signing_key = external_key_name(val, origin::workspace); + opts.key = external_key_name(val, origin::workspace); opts.key_given = true; } else if (opt == "keydir") @@ -544,8 +544,8 @@ write_options_file(bookkeeping_path cons if (!opts.branch().empty()) st.push_str_pair(symbol("branch"), opts.branch()); - if (!opts.signing_key().empty()) - st.push_str_pair(symbol("key"), opts.signing_key()); + if (!opts.key().empty()) + st.push_str_pair(symbol("key"), opts.key()); if (!opts.key_dir.as_internal().empty()) st.push_str_pair(symbol("keydir"), opts.key_dir.as_internal()); @@ -596,7 +596,7 @@ workspace::get_options(options & opts) L(FL("branch name is '%s'") % opts.branch); if (!opts.key_given) - opts.signing_key = cur_opts.signing_key; + opts.key = cur_opts.key; } void @@ -683,9 +683,9 @@ workspace::set_options(options const & o options_changed = true; } - if (opts.key_given && cur_opts.signing_key != opts.signing_key) + if (opts.key_given && cur_opts.key != opts.key) { - cur_opts.signing_key = opts.signing_key; + cur_opts.key = opts.key; options_changed = true; } @@ -713,7 +713,7 @@ workspace::print_option(utf8 const & opt else if (opt() == "branch") output << opts.branch << '\n'; else if (opt() == "key") - output << opts.signing_key << '\n'; + output << opts.key << '\n'; else if (opt() == "keydir") output << opts.key_dir << '\n'; else