# # # patch "NEWS" # from [dfa58a86f73d6a5b74c51f8719014e7622130e7b] # to [0c4416bd53cbe3f1e547d1aacacf038029f8af8e] # # patch "automate.cc" # from [d0f925b2ed7ae16b90486a5ea16498de64c0b302] # to [d9452830c60f213434bd1c280f29de6ebf74e2ac] # # patch "charset.cc" # from [1cf0ba66a8c3b8a5e660d6b350e148512cebe889] # to [bb433fcc004c011696478d5c9d5626b2c72c78e7] # # patch "charset.hh" # from [d3cb086ac17fdd87735c10d5f1c4d81cadaf36a6] # to [481d2732c5601eee20d0ef37658747dfb453d786] # # patch "cmd_db.cc" # from [67a93c17c35f12616e8a033a8d1a8421adf0e313] # to [503c0837df8062cb74dc38a7d6885903a42ae602] # # patch "cmd_key_cert.cc" # from [741935834b05197af476486e19902cf961ea9851] # to [2c7e684267b1e4fc095f800170c8d71e464ad51d] # # patch "cmd_list.cc" # from [729a8937114986b7ab17763d665db8eeee72e293] # to [001d3407a8d30b05a29f7e6bf63138696022fac9] # # patch "project.cc" # from [cd2cbb2d83efd56311357fd03ee22d4e79acd2b2] # to [8f652daf294704da0bc1a4617fc003e6911a99e2] # # patch "tests/generating_and_extracting_keys_and_certs/__driver__.lua" # from [2eb174c51d9abc474580cdfb28ee5afcf3464977] # to [c934e09f1e9ce17ab4fa737ac6f21bfbc84ac863] # ============================================================ --- NEWS dfa58a86f73d6a5b74c51f8719014e7622130e7b +++ NEWS 0c4416bd53cbe3f1e547d1aacacf038029f8af8e @@ -59,6 +59,11 @@ - Monotone now sanely skips paths with invalid characters it encounters during 'add' or 'automate inventory'. + - Key names, cert names, and var domains with non-ASCII characters + should work properly now. Previously, they would be (usually) + converted to punycode on input, and not decoded on output. They + will now not be converted to punycode at all. + Internal Tue May 12 20:44:00 UTC 2009 ============================================================ --- automate.cc d0f925b2ed7ae16b90486a5ea16498de64c0b302 +++ automate.cc d9452830c60f213434bd1c280f29de6ebf74e2ac @@ -1792,8 +1792,7 @@ CMD_AUTOMATE(genkey, N_("KEY_NAME PASSPH database db(app); key_store keys(app); - key_name name; - internalize_key_name(idx(args, 0), name); + key_name name = typecast_vocab(idx(args, 0)); if (!app.opts.force_duplicate_key) { ============================================================ --- charset.cc 1cf0ba66a8c3b8a5e660d6b350e148512cebe889 +++ charset.cc bb433fcc004c011696478d5c9d5626b2c72c78e7 @@ -355,57 +355,6 @@ utf8_to_ace(utf8 const & utf, string & a free(out); } -void -internalize_cert_name(utf8 const & utf, cert_name & c) -{ - string a; - utf8_to_ace(utf, a); - c = cert_name(a, utf.made_from); -} - -void -internalize_key_name(utf8 const & utf, key_name & key) -{ - string tmp; - typedef boost::tokenizer > - tokenizer; - char_separator sep("", ".@", boost::keep_empty_tokens); - tokenizer tokens(utf(), sep); - bool in_domain = false; - for(tokenizer::iterator i = tokens.begin(); i != tokens.end(); ++i) - { - if (!in_domain || *i == "." || *i == "@") - tmp += *i; - else - { - string a; - utf8_to_ace(utf8(*i, utf.made_from), a); - tmp += a; - } - if (*i == "@") - in_domain = true; - } - key = key_name(tmp, utf.made_from); -} - -void -internalize_var_domain(utf8 const & utf, var_domain & d) -{ - string a; - utf8_to_ace(utf, a); - d = var_domain(a, utf.made_from); -} - -void -externalize_var_domain(var_domain const & d, external & ext) -{ - utf8 utf; - ace_to_utf8(d(), utf, d.made_from); - utf8_to_system_strict(utf, ext); -} - - - // Local Variables: // mode: C++ // fill-column: 76 ============================================================ --- charset.hh d3cb086ac17fdd87735c10d5f1c4d81cadaf36a6 +++ charset.hh 481d2732c5601eee20d0ef37658747dfb453d786 @@ -36,12 +36,6 @@ size_t display_width(utf8 const & utf); // Is not aware of combining and invisible characters. size_t display_width(utf8 const & utf); -// Specific internal / external conversions for various vocab terms. -void internalize_cert_name(utf8 const & utf, cert_name & c); -void internalize_key_name(utf8 const & utf, key_name & key); -void internalize_var_domain(utf8 const & utf, var_domain & d); -void externalize_var_domain(var_domain const & d, external & ext); - #endif // Local Variables: ============================================================ --- cmd_db.cc 67a93c17c35f12616e8a033a8d1a8421adf0e313 +++ cmd_db.cc 503c0837df8062cb74dc38a7d6885903a42ae602 @@ -353,10 +353,9 @@ CMD(set, "set", "", CMD_REF(variables), if (args.size() != 3) throw usage(execid); - var_domain d; + var_domain d = typecast_vocab(idx(args, 0)); var_name n; var_value v; - internalize_var_domain(idx(args, 0), d); n = typecast_vocab(idx(args, 1)); v = typecast_vocab(idx(args, 2)); @@ -373,9 +372,8 @@ CMD(unset, "unset", "", CMD_REF(variable if (args.size() != 2) throw usage(execid); - var_domain d; + var_domain d = typecast_vocab(idx(args, 0)); var_name n; - internalize_var_domain(idx(args, 0), d); n = typecast_vocab(idx(args, 1)); var_key k(d, n); ============================================================ --- cmd_key_cert.cc 741935834b05197af476486e19902cf961ea9851 +++ cmd_key_cert.cc 2c7e684267b1e4fc095f800170c8d71e464ad51d @@ -40,8 +40,7 @@ CMD(genkey, "genkey", "", CMD_REF(key_an if (args.size() != 1) throw usage(execid); - key_name name; - internalize_key_name(idx(args, 0), name); + key_name name = typecast_vocab(idx(args, 0)); if (!app.opts.force_duplicate_key) { @@ -187,8 +186,7 @@ CMD(cert, "cert", "", CMD_REF(key_and_ce revision_id rid; complete(app.opts, app.lua, project, idx(args, 0)(), rid); - cert_name cname; - internalize_cert_name(idx(args, 1), cname); + cert_name cname = typecast_vocab(idx(args, 1)); cache_user_key(app.opts, app.lua, db, keys, project); @@ -227,9 +225,7 @@ CMD(trusted, "trusted", "", CMD_REF(key_ if (!rids.empty()) ident = *rids.begin(); - cert_name cname; - internalize_cert_name(idx(args, 1), cname); - + cert_name cname = typecast_vocab(idx(args, 1)); cert_value value = typecast_vocab(idx(args, 2)); set signers; ============================================================ --- cmd_list.cc 729a8937114986b7ab17763d665db8eeee72e293 +++ cmd_list.cc 001d3407a8d30b05a29f7e6bf63138696022fac9 @@ -566,7 +566,7 @@ CMD(vars, "vars", "", CMD_REF(list), "[D else if (args.size() == 1) { filterp = true; - internalize_var_domain(idx(args, 0), filter); + filter = typecast_vocab(idx(args, 0)); } else throw usage(execid); @@ -579,9 +579,7 @@ CMD(vars, "vars", "", CMD_REF(list), "[D { if (filterp && !(i->first.first == filter)) continue; - external ext_domain, ext_name; - externalize_var_domain(i->first.first, ext_domain); - cout << ext_domain << ": " + cout << i->first.first << ": " << i->first.second << ' ' << i->second << '\n'; } ============================================================ --- project.cc cd2cbb2d83efd56311357fd03ee22d4e79acd2b2 +++ project.cc 8f652daf294704da0bc1a4617fc003e6911a99e2 @@ -11,7 +11,6 @@ #include "vector.hh" #include "cert.hh" -#include "charset.hh" // internalize_key_name #include "database.hh" #include "project.hh" #include "revision.hh" @@ -622,8 +621,7 @@ project_t::get_key_identity(key_store * } catch (recoverable_failure &) { - internalize_key_name(typecast_vocab(input), - output.official_name); + output.official_name = typecast_vocab(input); } complete_key_identity(keys, lua, output); } ============================================================ --- tests/generating_and_extracting_keys_and_certs/__driver__.lua 2eb174c51d9abc474580cdfb28ee5afcf3464977 +++ tests/generating_and_extracting_keys_and_certs/__driver__.lua c934e09f1e9ce17ab4fa737ac6f21bfbc84ac863 @@ -44,7 +44,7 @@ check(qgrep("yellow", "stdout")) check(qgrep("yellow", "stdout")) -- third section, keys with a + in the user portion work, keys with a --- + in the domain portion don't work. +-- + in the domain portion also work. goodkey = "address@hidden" check(mtn("genkey", goodkey), 0, false, false, string.rep(goodkey .. "\n", 2)) @@ -55,9 +55,9 @@ badkey1 = "address@hidden" -- bad keys fail badkey1 = "address@hidden" -check(mtn("genkey", badkey1), 1, false, false, string.rep(badkey1 .. "\n", 2)) +check(mtn("genkey", badkey1), 0, false, false, string.rep(badkey1 .. "\n", 2)) badkey2 = "address@hidden" -check(mtn("genkey", badkey2), 1, false, false, string.rep(badkey2 .. "\n", 2)) +check(mtn("genkey", badkey2), 0, false, false, string.rep(badkey2 .. "\n", 2)) -- fourth section, keys with all supported characters (for the user portion) -- in the user portion work, keys with the same in the domain portion don't @@ -71,6 +71,6 @@ badkey1 = "address@hidden -- bad keys fail badkey1 = "address@hidden" -check(mtn("genkey", badkey1), 1, false, false, string.rep(badkey1 .. "\n", 2)) +check(mtn("genkey", badkey1), 0, false, false, string.rep(badkey1 .. "\n", 2)) badkey2 = "address@hidden" -check(mtn("genkey", badkey2), 1, false, false, string.rep(badkey2 .. "\n", 2)) +check(mtn("genkey", badkey2), 0, false, false, string.rep(badkey2 .. "\n", 2))