# # # patch "cmd_merging.cc" # from [17d5279053751ed6a8d879219295e8c8cab72d87] # to [9cc466edc80188777182d9d6c0102f8474abc961] # # patch "roster_merge.cc" # from [24992d3a57fecfe2bd6f871e396ea68fcf152adf] # to [9e78641df3839d48c1eb481e46ec3dde525d3308] # # patch "tests/automate_show_conflicts_defaults/__driver__.lua" # from [7df4a89ca990f60c35d01b30a6e1845b787e97e1] # to [9ebc1b4df17bd570c9a4c1e61b2c95fc7d61511f] # # patch "tests/non_workspace_keydir/__driver__.lua" # from [d32720e0e63d4429dc590c0849a1eb8794848b06] # to [7c2ff80fd51ef2ff5a4402a71dd576ac39a1f0d4] # # patch "tests/resolve_duplicate_name_conflict/__driver__.lua" # from [d876aec0f26b52b9f8016aa8580d5fcfd4fae293] # to [716390290b2ca16849455a5f65e1d61a183ea9ef] # ============================================================ --- cmd_merging.cc 17d5279053751ed6a8d879219295e8c8cab72d87 +++ cmd_merging.cc 9cc466edc80188777182d9d6c0102f8474abc961 @@ -861,8 +861,8 @@ show_conflicts_core (database & db, revi if (basic_io) { - st.push_hex_pair(syms::left, l_id.inner()); - st.push_hex_pair(syms::right, r_id.inner()); + st.push_binary_pair(syms::left, l_id.inner()); + st.push_binary_pair(syms::right, r_id.inner()); } else { @@ -888,7 +888,7 @@ show_conflicts_core (database & db, revi { basic_io::printer pr; - st.push_hex_pair(syms::ancestor, adaptor.lca.inner()); + st.push_binary_pair(syms::ancestor, adaptor.lca.inner()); pr.print_stanza(st); output.write(pr.buf.data(), pr.buf.size()); } ============================================================ --- roster_merge.cc 24992d3a57fecfe2bd6f871e396ea68fcf152adf +++ roster_merge.cc 9e78641df3839d48c1eb481e46ec3dde525d3308 @@ -225,7 +225,7 @@ put_added_conflict_left (basic_io::stanz db_adaptor.db.get_file_content (db_adaptor.left_rid, nid, fid); st.push_str_pair(syms::left_type, "added file"); st.push_str_pair(syms::left_name, name.as_external()); - st.push_hex_pair(syms::left_file_id, fid.inner()); + st.push_binary_pair(syms::left_file_id, fid.inner()); } else { @@ -254,7 +254,7 @@ put_added_conflict_right (basic_io::stan st.push_str_pair(syms::right_type, "added file"); st.push_str_pair(syms::right_name, name.as_external()); - st.push_hex_pair(syms::right_file_id, fid.inner()); + st.push_binary_pair(syms::right_file_id, fid.inner()); } else { @@ -285,11 +285,11 @@ put_rename_conflict_left (basic_io::stan file_id ancestor_fid; db_adaptor.db.get_file_content (db_adaptor.lca, nid, ancestor_fid); st.push_str_pair(syms::ancestor_name, ancestor_name.as_external()); - st.push_hex_pair(syms::ancestor_file_id, ancestor_fid.inner()); + st.push_binary_pair(syms::ancestor_file_id, ancestor_fid.inner()); file_id left_fid; db_adaptor.db.get_file_content (db_adaptor.left_rid, nid, left_fid); st.push_str_pair(syms::left_name, left_name.as_external()); - st.push_hex_pair(syms::left_file_id, left_fid.inner()); + st.push_binary_pair(syms::left_file_id, left_fid.inner()); } else { @@ -322,11 +322,11 @@ put_rename_conflict_right (basic_io::sta file_id ancestor_fid; db_adaptor.db.get_file_content (db_adaptor.lca, nid, ancestor_fid); st.push_str_pair(syms::ancestor_name, ancestor_name.as_external()); - st.push_hex_pair(syms::ancestor_file_id, ancestor_fid.inner()); + st.push_binary_pair(syms::ancestor_file_id, ancestor_fid.inner()); file_id right_fid; db_adaptor.db.get_file_content (db_adaptor.right_rid, nid, right_fid); st.push_str_pair(syms::right_name, right_name.as_external()); - st.push_hex_pair(syms::right_file_id, right_fid.inner()); + st.push_binary_pair(syms::right_file_id, right_fid.inner()); } else { @@ -388,17 +388,17 @@ put_attr_conflict (basic_io::stanza & st file_id ancestor_fid; db_adaptor.db.get_file_content (db_adaptor.lca, conflict.nid, ancestor_fid); st.push_str_pair(syms::ancestor_name, ancestor_name.as_external()); - st.push_hex_pair(syms::ancestor_file_id, ancestor_fid.inner()); + st.push_binary_pair(syms::ancestor_file_id, ancestor_fid.inner()); // FIXME: don't have this. st.push_str_pair(syms::ancestor_attr_value, ???); file_id left_fid; db_adaptor.db.get_file_content (db_adaptor.left_rid, conflict.nid, left_fid); st.push_str_pair(syms::left_name, left_name.as_external()); - st.push_hex_pair(syms::left_file_id, left_fid.inner()); + st.push_binary_pair(syms::left_file_id, left_fid.inner()); put_attr_state_left (st, conflict); file_id right_fid; db_adaptor.db.get_file_content (db_adaptor.right_rid, conflict.nid, right_fid); st.push_str_pair(syms::right_name, right_name.as_external()); - st.push_hex_pair(syms::right_file_id, right_fid.inner()); + st.push_binary_pair(syms::right_file_id, right_fid.inner()); put_attr_state_right (st, conflict); } else @@ -447,15 +447,15 @@ put_content_conflict (basic_io::stanza & file_id ancestor_fid; db_adaptor.db.get_file_content (db_adaptor.lca, conflict.nid, ancestor_fid); st.push_str_pair(syms::ancestor_name, ancestor_name.as_external()); - st.push_hex_pair(syms::ancestor_file_id, ancestor_fid.inner()); + st.push_binary_pair(syms::ancestor_file_id, ancestor_fid.inner()); file_id left_fid; db_adaptor.db.get_file_content (db_adaptor.left_rid, conflict.nid, left_fid); st.push_str_pair(syms::left_name, left_name.as_external()); - st.push_hex_pair(syms::left_file_id, left_fid.inner()); + st.push_binary_pair(syms::left_file_id, left_fid.inner()); file_id right_fid; db_adaptor.db.get_file_content (db_adaptor.right_rid, conflict.nid, right_fid); st.push_str_pair(syms::right_name, right_name.as_external()); - st.push_hex_pair(syms::right_file_id, right_fid.inner()); + st.push_binary_pair(syms::right_file_id, right_fid.inner()); } else { ============================================================ --- tests/automate_show_conflicts_defaults/__driver__.lua 7df4a89ca990f60c35d01b30a6e1845b787e97e1 +++ tests/automate_show_conflicts_defaults/__driver__.lua 9ebc1b4df17bd570c9a4c1e61b2c95fc7d61511f @@ -5,9 +5,6 @@ include ("common/test_utils_inventory.lu mtn_setup() include ("common/test_utils_inventory.lua") -check(get("expected-1.stdout")) -check(get("expected-2.stdout")) - -- Get a non-empty base revision, then create three heads addfile("randomfile", "blah blah blah") commit("testbranch", "base_1") ============================================================ --- tests/non_workspace_keydir/__driver__.lua d32720e0e63d4429dc590c0849a1eb8794848b06 +++ tests/non_workspace_keydir/__driver__.lua 7c2ff80fd51ef2ff5a4402a71dd576ac39a1f0d4 @@ -50,7 +50,11 @@ mkdir(test.root.."/empty") mkdir(test.root.."/empty") -- FIXME: this should probably be set globally in lua-testsuite.lua for -- all tests. +if ostype == "Windows" then +set_env("APPDATA", test.root.."/empty") +else set_env("HOME", test.root.."/empty") +end srv = bg(pure_mtn("serve"), 1, false, true) sleep(2) srv:finish() ============================================================ --- tests/resolve_duplicate_name_conflict/__driver__.lua d876aec0f26b52b9f8016aa8580d5fcfd4fae293 +++ tests/resolve_duplicate_name_conflict/__driver__.lua 716390290b2ca16849455a5f65e1d61a183ea9ef @@ -8,6 +8,7 @@ mtn_setup() -- thermostat-westinghouse.c and thermostat-honeywell.c mtn_setup() +include ("common/test_utils_inventory.lua") -- Get a non-empty base revision addfile("randomfile", "blah blah blah") @@ -17,7 +18,7 @@ addfile("thermostat.c", "thermostat west -- Abe adds conflict files addfile("checkout.sh", "checkout.sh abe 1") addfile("thermostat.c", "thermostat westinghouse") -commit() +commit("testbranch", "abe_1") abe_1 = base_revision() revert_to(base) @@ -25,7 +26,7 @@ addfile("thermostat.c", "thermostat hone -- Beth adds files, and attempts to merge addfile("checkout.sh", "checkout.sh beth 1") addfile("thermostat.c", "thermostat honeywell") -commit() +commit("testbranch", "beth_1") beth_1 = base_revision() -- This fails due to duplicate name conflicts @@ -39,8 +40,18 @@ check(mtn("merge"), 1, false, false) -- -- For thermostat.c, she renames her version, letting Abe rename his. -check (mtn("automate show_conflicts"), 0, false, false) +check (mtn("automate", "show_conflicts"), 0, true, false) +parsed = parse_basic_io(readfile("stdout")) +check_basic_io_line (1, parsed[1], "left", abe_1) -- 1337.. +check_basic_io_line (2, parsed[2], "right", beth_1) -- d5f1.. +check_basic_io_line (3, parsed[3], "ancestor", base) + +check_basic_io_line (7, parsed[7], "left_file_id", "61b8d4fb0e5d78be111f691b955d523c782fa92e") + +-- mtn is not up to actually doing the merge of checkout.sh yet, so we +-- just drop beth's version + check (mtn ("drop", "checkout.sh"), 0, false, false) check (mtn ("rename", "thermostat.c", "thermostat-honeywell.c"), 0, false, false) commit() @@ -48,5 +59,9 @@ check(mtn("merge"), 0, false, false) -- This succeeds check(mtn("merge"), 0, false, false) +check(mtn("update"), 0, false, false) + +check("checkout.sh abe 1" == readfile("checkout.sh")) + -- end of file