# # patch "ChangeLog" # from [c0046c3eb62b427c8ded706cebe6870fcd80fe05] # to [4634de721f789d3bbe2ab37b6c974cfd0eaf4dd3] # # patch "database.cc" # from [133454d457b3ef266588e5596049fb80aebed4e0] # to [90130ac538f5b50fda7a2838fbd5eafbcb51c736] # # patch "lua.cc" # from [40cea21efcbbbcb98eb2c502cf971b10ab76e521] # to [9646f85f13e4dbe9ff66d458d21be334e6c42a1e] # # patch "netcmd.cc" # from [24df93e3c3d6ae51a8ee69d972f10392609af1d9] # to [75a0d51313f112ec54f83d29eca1d1077d2547bb] # # patch "rcs_import.cc" # from [678b970e6558c90e785b69ab44beeb67423c756f] # to [777f09b8de03f0bce18d31363c960810dd907819] # ======================================================================== --- ChangeLog c0046c3eb62b427c8ded706cebe6870fcd80fe05 +++ ChangeLog 4634de721f789d3bbe2ab37b6c974cfd0eaf4dd3 @@ -1,5 +1,14 @@ 2005-08-23 Benoît Dejean + * netcmd.cc (test_netcmd_functions): Don't translate unittest + strings. + * rcs_import.cc (cvs_commit::cvs_commit): + * database.cc (version_cache::put): + * lua.cc (dump_stack): boost::format vs. F for strings that are + not messages. + +2005-08-23 Benoît Dejean + * xdelta.cc: Don't translate unittest strings. 2005-08-22 Nathaniel Smith ======================================================================== --- database.cc 133454d457b3ef266588e5596049fb80aebed4e0 +++ database.cc 90130ac538f5b50fda7a2838fbd5eafbcb51c736 @@ -850,7 +850,7 @@ while (!cache.empty() && use + dat().size() > capacity) { - std::string key = (F("%08.8x%08.8x%08.8x%08.8x%08.8x") + std::string key = (boost::format("%08.8x%08.8x%08.8x%08.8x%08.8x") % rand() % rand() % rand() % rand() % rand()).str(); std::map, data>::const_iterator i; i = cache.lower_bound(hexenc(key)); ======================================================================== --- lua.cc 40cea21efcbbbcb98eb2c502cf971b10ab76e521 +++ lua.cc 9646f85f13e4dbe9ff66d458d21be334e6c42a1e @@ -58,7 +58,7 @@ int t = lua_type(st, i); switch (t) { case LUA_TSTRING: /* strings */ - out += (F("`%s'") % std::string(lua_tostring(st, i), lua_strlen(st, i))).str(); + out += (boost::format("`%s'") % std::string(lua_tostring(st, i), lua_strlen(st, i))).str(); break; case LUA_TBOOLEAN: /* booleans */ @@ -70,7 +70,7 @@ break; default: /* other values */ - out += (F("%s") % lua_typename(st, t)).str(); + out += (boost::format("%s") % lua_typename(st, t)).str(); break; } ======================================================================== --- netcmd.cc 24df93e3c3d6ae51a8ee69d972f10392609af1d9 +++ netcmd.cc 75a0d51313f112ec54f83d29eca1d1077d2547bb @@ -619,7 +619,7 @@ // error_cmd { - L(F("checking i/o round trip on error_cmd\n")); + L(boost::format("checking i/o round trip on error_cmd\n")); netcmd out_cmd, in_cmd; string out_errmsg("your shoelaces are untied"), in_errmsg; string buf; @@ -627,21 +627,21 @@ do_netcmd_roundtrip(out_cmd, in_cmd, buf); in_cmd.read_error_cmd(in_errmsg); BOOST_CHECK(in_errmsg == out_errmsg); - L(F("errmsg_cmd test done, buffer was %d bytes\n") % buf.size()); + L(boost::format("errmsg_cmd test done, buffer was %d bytes\n") % buf.size()); } // bye_cmd { - L(F("checking i/o round trip on bye_cmd\n")); + L(boost::format("checking i/o round trip on bye_cmd\n")); netcmd out_cmd, in_cmd; string buf; do_netcmd_roundtrip(out_cmd, in_cmd, buf); - L(F("bye_cmd test done, buffer was %d bytes\n") % buf.size()); + L(boost::format("bye_cmd test done, buffer was %d bytes\n") % buf.size()); } // hello_cmd { - L(F("checking i/o round trip on hello_cmd\n")); + L(boost::format("checking i/o round trip on hello_cmd\n")); netcmd out_cmd, in_cmd; string buf; rsa_keypair_id out_server_keyname("address@hidden"), in_server_keyname; @@ -653,12 +653,12 @@ BOOST_CHECK(in_server_keyname == out_server_keyname); BOOST_CHECK(in_server_key == out_server_key); BOOST_CHECK(in_nonce == out_nonce); - L(F("hello_cmd test done, buffer was %d bytes\n") % buf.size()); + L(boost::format("hello_cmd test done, buffer was %d bytes\n") % buf.size()); } // anonymous_cmd { - L(F("checking i/o round trip on anonymous_cmd\n")); + L(boost::format("checking i/o round trip on anonymous_cmd\n")); netcmd out_cmd, in_cmd; protocol_role out_role = source_and_sink_role, in_role; string buf; @@ -675,12 +675,12 @@ BOOST_CHECK(in_include_pattern == out_include_pattern); BOOST_CHECK(in_exclude_pattern == out_exclude_pattern); BOOST_CHECK(in_role == out_role); - L(F("anonymous_cmd test done, buffer was %d bytes\n") % buf.size()); + L(boost::format("anonymous_cmd test done, buffer was %d bytes\n") % buf.size()); } // auth_cmd { - L(F("checking i/o round trip on auth_cmd\n")); + L(boost::format("checking i/o round trip on auth_cmd\n")); netcmd out_cmd, in_cmd; protocol_role out_role = source_and_sink_role, in_role; string buf; @@ -705,23 +705,23 @@ BOOST_CHECK(in_role == out_role); BOOST_CHECK(in_include_pattern == out_include_pattern); BOOST_CHECK(in_exclude_pattern == out_exclude_pattern); - L(F("auth_cmd test done, buffer was %d bytes\n") % buf.size()); + L(boost::format("auth_cmd test done, buffer was %d bytes\n") % buf.size()); } // confirm_cmd { - L(F("checking i/o round trip on confirm_cmd\n")); + L(boost::format("checking i/o round trip on confirm_cmd\n")); netcmd out_cmd, in_cmd; string buf; out_cmd.write_confirm_cmd(); do_netcmd_roundtrip(out_cmd, in_cmd, buf); in_cmd.read_confirm_cmd(); - L(F("confirm_cmd test done, buffer was %d bytes\n") % buf.size()); + L(boost::format("confirm_cmd test done, buffer was %d bytes\n") % buf.size()); } // refine_cmd { - L(F("checking i/o round trip on refine_cmd\n")); + L(boost::format("checking i/o round trip on refine_cmd\n")); netcmd out_cmd, in_cmd; string buf; merkle_node out_node, in_node; @@ -739,12 +739,12 @@ do_netcmd_roundtrip(out_cmd, in_cmd, buf); in_cmd.read_refine_cmd(in_node); BOOST_CHECK(in_node == out_node); - L(F("refine_cmd test done, buffer was %d bytes\n") % buf.size()); + L(boost::format("refine_cmd test done, buffer was %d bytes\n") % buf.size()); } // done_cmd { - L(F("checking i/o round trip on done_cmd\n")); + L(boost::format("checking i/o round trip on done_cmd\n")); netcmd out_cmd, in_cmd; size_t out_level(12), in_level; netcmd_item_type out_type(key_item), in_type(manifest_item); @@ -755,12 +755,12 @@ in_cmd.read_done_cmd(in_level, in_type); BOOST_CHECK(in_level == out_level); BOOST_CHECK(in_type == out_type); - L(F("done_cmd test done, buffer was %d bytes\n") % buf.size()); + L(boost::format("done_cmd test done, buffer was %d bytes\n") % buf.size()); } // send_data_cmd { - L(F("checking i/o round trip on send_data_cmd\n")); + L(boost::format("checking i/o round trip on send_data_cmd\n")); netcmd out_cmd, in_cmd; netcmd_item_type out_type(file_item), in_type(key_item); id out_id(raw_sha1("avocado is the yummiest")), in_id; @@ -771,12 +771,12 @@ in_cmd.read_send_data_cmd(in_type, in_id); BOOST_CHECK(in_type == out_type); BOOST_CHECK(in_id == out_id); - L(F("send_data_cmd test done, buffer was %d bytes\n") % buf.size()); + L(boost::format("send_data_cmd test done, buffer was %d bytes\n") % buf.size()); } // send_delta_cmd { - L(F("checking i/o round trip on send_delta_cmd\n")); + L(boost::format("checking i/o round trip on send_delta_cmd\n")); netcmd out_cmd, in_cmd; netcmd_item_type out_type(file_item), in_type(key_item); id out_head(raw_sha1("when you board an airplane")), in_head; @@ -789,12 +789,12 @@ BOOST_CHECK(in_type == out_type); BOOST_CHECK(in_head == out_head); BOOST_CHECK(in_base == out_base); - L(F("send_delta_cmd test done, buffer was %d bytes\n") % buf.size()); + L(boost::format("send_delta_cmd test done, buffer was %d bytes\n") % buf.size()); } // data_cmd { - L(F("checking i/o round trip on data_cmd\n")); + L(boost::format("checking i/o round trip on data_cmd\n")); netcmd out_cmd, in_cmd; netcmd_item_type out_type(file_item), in_type(key_item); id out_id(raw_sha1("tuna is not yummy")), in_id; @@ -805,12 +805,12 @@ in_cmd.read_data_cmd(in_type, in_id, in_dat); BOOST_CHECK(in_id == out_id); BOOST_CHECK(in_dat == out_dat); - L(F("data_cmd test done, buffer was %d bytes\n") % buf.size()); + L(boost::format("data_cmd test done, buffer was %d bytes\n") % buf.size()); } // delta_cmd { - L(F("checking i/o round trip on delta_cmd\n")); + L(boost::format("checking i/o round trip on delta_cmd\n")); netcmd out_cmd, in_cmd; netcmd_item_type out_type(file_item), in_type(key_item); id out_head(raw_sha1("your seat cusion can be reused")), in_head; @@ -825,12 +825,12 @@ BOOST_CHECK(in_head == out_head); BOOST_CHECK(in_base == out_base); BOOST_CHECK(in_delta == out_delta); - L(F("delta_cmd test done, buffer was %d bytes\n") % buf.size()); + L(boost::format("delta_cmd test done, buffer was %d bytes\n") % buf.size()); } // nonexistant_cmd { - L(F("checking i/o round trip on nonexistant_cmd\n")); + L(boost::format("checking i/o round trip on nonexistant_cmd\n")); netcmd out_cmd, in_cmd; netcmd_item_type out_type(file_item), in_type(key_item); id out_id(raw_sha1("avocado is the yummiest")), in_id; @@ -841,13 +841,13 @@ in_cmd.read_nonexistant_cmd(in_type, in_id); BOOST_CHECK(in_type == out_type); BOOST_CHECK(in_id == out_id); - L(F("nonexistant_cmd test done, buffer was %d bytes\n") % buf.size()); + L(boost::format("nonexistant_cmd test done, buffer was %d bytes\n") % buf.size()); } } catch (bad_decode & d) { - L(F("bad decode exception: '%s'\n") % d.what); + L(boost::format("bad decode exception: '%s'\n") % d.what); throw; } } ======================================================================== --- rcs_import.cc 678b970e6558c90e785b69ab44beeb67423c756f +++ rcs_import.cc 777f09b8de03f0bce18d31363c960810dd907819 @@ -260,7 +260,7 @@ I(strptime(dp, "%Y.%m.%d.%H.%M.%S", &t) != NULL); #endif time = mktime(&t); - L(F("= %i\n") % time); + L(boost::format("= %i\n") % time); is_synthetic_branch_root = is_sbr(delta->second, deltatext->second);