# # # patch "mtn_cvs/mtn_cvs.cc" # from [bbf97edf525a23194fae9a59bce8f6a37f378549] # to [154cdf31a157a95dc0e83e4c697923247671cf2f] # # patch "mtn_cvs/options_list.hh" # from [fada32d2d73004c52b1dd40f8bba773c92b418f3] # to [7c1d0776e9f5b2c2cf0d208167aa435211809732] # ============================================================ --- mtn_cvs/mtn_cvs.cc bbf97edf525a23194fae9a59bce8f6a37f378549 +++ mtn_cvs/mtn_cvs.cc 154cdf31a157a95dc0e83e4c697923247671cf2f @@ -94,7 +94,7 @@ CMD(pull, N_("network"), N_("[CVS-REPOSI // missing: compression level (-z), cvs-branch (-r), since (-D) CMD(pull, N_("network"), N_("[CVS-REPOSITORY CVS-MODULE [CVS-BRANCH]]"), N_("(re-)import a module from a remote cvs repository"), - option::branch_name % option::since % option::full) + options::opts::branch | options::opts::since | options::opts::full) { if (args.size() == 1 || args.size() > 3) throw usage(name); @@ -114,7 +114,7 @@ CMD(push, N_("network"), N_("[CVS-REPOSI CMD(push, N_("network"), N_("[CVS-REPOSITORY CVS-MODULE [CVS-BRANCH]]"), N_("commit changes in local database to a remote cvs repository"), - option::branch_name % option::revision) + options::opts::branch | options::opts::revision) { if (args.size() == 1 || args.size() > 3) throw usage(name); @@ -131,7 +131,7 @@ CMD(takeover, N_("working copy"), N_("[C CMD(takeover, N_("working copy"), N_("[CVS-MODULE]"), N_("put a CVS working directory under monotone's control"), - option::branch_name) + options::opts::branch) { if (args.size() > 1) throw usage(name); std::string module; @@ -148,7 +148,7 @@ get_full_version(std::string & out) { out="mtn_cvs version 0.1 ("+std::string(package_revision_constant)+")"; } -namespace po = boost::program_options; +//namespace po = boost::program_options; using std::cout; using std::endl; using std::string; @@ -321,6 +321,7 @@ cpp_main(int argc, char ** argv) utf8 prog_name(prog_path); mtncvs_state app; +#if 0 try { @@ -412,9 +413,9 @@ cpp_main(int argc, char ** argv) if (option::since.given(vm)) app.since=string(option::since.get(vm)); - if (option::branch_name.given(vm)) - { L(FL("branch %s") % option::branch_name.get(vm)); - app.branch=option::branch_name.get(vm); + if (option::branch.given(vm)) + { L(FL("branch %s") % option::branch.get(vm)); + app.branch=option::branch.get(vm); } if (option::revision.given(vm)) @@ -522,6 +523,7 @@ cpp_main(int argc, char ** argv) return 2; } +#endif } catch (informative_failure & inf) { ============================================================ --- mtn_cvs/options_list.hh fada32d2d73004c52b1dd40f8bba773c92b418f3 +++ mtn_cvs/options_list.hh 7c1d0776e9f5b2c2cf0d208167aa435211809732 @@ -8,11 +8,39 @@ OPTSET(globals) OPTSET(globals) +OPTVAR(globals, std::vector, args, ) -COPT(branch_name, "branch,b", string, N_("select branch cert for operation")); +OPTVAR(branch, utf8, branch_name, ) +OPTION(branch, branch, true, "branch,b", N_("select branch cert for operation")) +#ifdef option_bodies +{ + branch_name = utf8(arg); +} +#endif + +OPT(since, "since", bool, false, N_("set history start for CVS pull")) +#ifdef option_bodies +{ + since = true; +} +#endif + +OPT(full, "full", bool, false, N_("ignore already pulled CVS revisions")) +#ifdef option_bodies +{ + full = true; +} +#endif + +OPT(revision, "revision,r", std::string, "", N_("select revision id for operation")) +#ifdef option_bodies +{ + // revision = true; +} +#endif + +#if 0 COPT(revision, "revision,r", string, N_("select revision id for operation")); -COPT(since, "since", string, N_("set history start for CVS pull")); -COPT(full, "full", string, N_("ignore already pulled CVS revisions")); GOPT(debug, "debug", nil, N_("print debug log to stderr while running")); GOPT(help, "help,h", nil, N_("display help message")); @@ -28,3 +56,4 @@ GOPT(confdir, "confdir", string, N_("pas GOPT(norc, "norc", nil, N_("passed: norc")); GOPT(root, "root", string, N_("passed: root")); GOPT(confdir, "confdir", string, N_("passed: confdir")); +#endif