# # # patch "app_state.cc" # from [85d71171b53f38bca6f070200f2edaf7aaf99018] # to [5b160fe0c1305d250a273568a802de08d8403cba] # # patch "app_state.hh" # from [e635a3561b1ac5c00aa5f443ff98d95b17134f3d] # to [f23965ca4e518a3f6985ec715fc18a6955cff0b1] # # patch "commands.cc" # from [bb69d5346904d4e34109e3e78b4458b632a07161] # to [3c2fe4e9c693a4f0802d076ae826fe69bed7e5f8] # # patch "monotone.cc" # from [19b5a87f886cb86d8632319973ba25e4dd86f48d] # to [77ecee6651f81327e3ca26a64ba4aaa01fbfb11e] # # patch "netsync.cc" # from [0b5a714ce8a81eccad5570ead2b8fd434b741d04] # to [183aa5ce79c7499def51f3c8aa8c07070602cd4c] # # patch "options.hh" # from [7d90588b90ca771e06d433e2649d766690b2ed31] # to [7702814028a86f8ac8b5eac9343ead9a9cc00ff0] # ============================================================ --- app_state.cc 85d71171b53f38bca6f070200f2edaf7aaf99018 +++ app_state.cc 5b160fe0c1305d250a273568a802de08d8403cba @@ -33,7 +33,7 @@ rcfiles(true), diffs(false), no_merges(false), set_default(false), verbose(false), search_root("/"), depth(-1), last(-1), diff_format(unified_diff), diff_args_provided(false), - use_lca(false), execute(false), bind_address(""), bind_port(""), + use_lca(false), execute(false), bind_address(""), bind_port(""), bind_stdio(false), missing(false), unknown(false), confdir(get_default_confdir()), have_set_key_dir(false) { ============================================================ --- app_state.hh e635a3561b1ac5c00aa5f443ff98d95b17134f3d +++ app_state.hh f23965ca4e518a3f6985ec715fc18a6955cff0b1 @@ -64,6 +64,7 @@ bool execute; utf8 bind_address; utf8 bind_port; + bool bind_stdio; bool missing; bool unknown; std::vector keys_to_push; ============================================================ --- commands.cc bb69d5346904d4e34109e3e78b4458b632a07161 +++ commands.cc 3c2fe4e9c693a4f0802d076ae826fe69bed7e5f8 @@ -2103,7 +2103,7 @@ CMD(serve, N_("network"), N_("PATTERN ..."), N_("serve the branches specified by PATTERNs to connecting clients"), - OPT_BIND % OPT_PIDFILE % OPT_EXCLUDE) + OPT_BIND % OPT_STDIO % OPT_PIDFILE % OPT_EXCLUDE) { if (args.size() < 1) throw usage(name); ============================================================ --- monotone.cc 19b5a87f886cb86d8632319973ba25e4dd86f48d +++ monotone.cc 77ecee6651f81327e3ca26a64ba4aaa01fbfb11e @@ -72,6 +72,7 @@ {"missing", 0, POPT_ARG_NONE, NULL, OPT_MISSING, gettext_noop("perform the operations for files missing from working directory"), NULL}, {"unknown", 0, POPT_ARG_NONE, NULL, OPT_UNKNOWN, gettext_noop("perform the operations for unknown files from working directory"), NULL}, {"key-to-push", 0, POPT_ARG_STRING, &argstr, OPT_KEY_TO_PUSH, gettext_noop("push the specified key even if it hasn't signed anything"), NULL}, + {"stdio", 0, POPT_ARG_NONE, NULL, OPT_STDIO, gettext_noop("serve netsync on stdio"), NULL}, { NULL, 0, 0, NULL, 0, NULL, NULL } }; @@ -458,6 +459,10 @@ app.execute = true; break; + case OPT_STDIO: + app.bind_stdio = true; + break; + case OPT_BIND: { std::string arg(argstr); @@ -489,6 +494,7 @@ port_part = ""; } } + app.bind_stdio = false; app.bind_address = utf8(addr_part); app.bind_port = utf8(port_part); } ============================================================ --- netsync.cc 0b5a714ce8a81eccad5570ead2b8fd434b741d04 +++ netsync.cc 183aa5ce79c7499def51f3c8aa8c07070602cd4c @@ -3110,6 +3110,8 @@ std::string db_path = address().substr(5); if (global_sanity.debug) args.push_back("--debug"); + else + args.push_back("--quiet"); args.push_back("--db"); args.push_back(db_path); @@ -3120,9 +3122,8 @@ args.push_back(exclude_pattern()); } - args.push_back("--"); args.push_back("serve"); - args.push_back("-"); + args.push_back("--stdio"); args.push_back(include_pattern()); // if (global_sanity.debug) @@ -3160,6 +3161,12 @@ args.push_back(host); args.push_back("monotone"); + + if (global_sanity.debug) + args.push_back("--debug"); + else + args.push_back("--quiet"); + args.push_back("--db"); args.push_back(db_path); @@ -3169,9 +3176,8 @@ args.push_back(exclude_pattern()); } - args.push_back("--"); + args.push_back("--stdio"); args.push_back("serve"); - args.push_back("-"); args.push_back(include_pattern()); // if (global_sanity.debug) @@ -3513,8 +3519,7 @@ addr.add_address(app.bind_address().c_str(), default_port); else addr.add_all_addresses (default_port); - - + Netxx::StreamServer server(addr, timeout); const char *name = addr.get_name(); P(F("beginning service on %s : %s\n") @@ -3871,18 +3876,19 @@ { if (voice == server_voice) { - if (addr==utf8("-")) - { shared_ptr str(new Netxx::PipeStream(0,1)); - shared_ptr sess(new session(role, server_voice, - include_pattern, exclude_pattern, - app, "stdio", str)); - serve_single_connection(sess,constants::netsync_timeout_seconds); - } + if (app.bind_stdio) + { + shared_ptr str(new Netxx::PipeStream(0,1)); + shared_ptr sess(new session(role, server_voice, + include_pattern, exclude_pattern, + app, "stdio", str)); + serve_single_connection(sess,constants::netsync_timeout_seconds); + } else serve_connections(role, include_pattern, exclude_pattern, app, - addr, static_cast(constants::netsync_default_port), - static_cast(constants::netsync_timeout_seconds), - static_cast(constants::netsync_connection_limit)); + addr, static_cast(constants::netsync_default_port), + static_cast(constants::netsync_timeout_seconds), + static_cast(constants::netsync_connection_limit)); } else { ============================================================ --- options.hh 7d90588b90ca771e06d433e2649d766690b2ed31 +++ options.hh 7702814028a86f8ac8b5eac9343ead9a9cc00ff0 @@ -49,3 +49,4 @@ #define OPT_UNKNOWN 40 #define OPT_KEY_TO_PUSH 41 #define OPT_CONF_DIR 42 +#define OPT_STDIO 43