# # # patch "NEWS" # from [b0195c16dd7d40f8f0fa237f2ae39dcc386dd1f3] # to [073fce5a18909977325ac839f297708eefbd175b] # # patch "cmd_diff_log.cc" # from [112a3d73e8ada5d8ef433b749c4f3ec3fade5c30] # to [bd1b283c47bb14e7f561d1fae2d479cedc365ee2] # # patch "diff_output.cc" # from [746af1eeaa7fee943bf1264dc88ddd6e218c7866] # to [60b2a95586d371c1c67036f1e4e18cde917d3535] # # patch "netcmd.cc" # from [831cae9fe85c704421c370a432ce6957661467a6] # to [7adb348671629350233209183dab3332410f91d0] # # patch "restrictions.cc" # from [6db7f7243f247cd8c5f3b1eef3881abaf97819ed] # to [211bf4562ebbe67950b900a45a28bf0c91395439] # # patch "restrictions.hh" # from [68b20076ec219d0e6f796cb0ea05a83fefc539ce] # to [6cc851724aa78f04c22327a1a82dfe4facbca43a] # # patch "tests/log_dir/__driver__.lua" # from [b9b1ce5d34a1ab22e4b681c059c9f97595a221bd] # to [533928ec6a0f7aadb5b2f9dca4a0bc8fb35d2277] # # patch "tests/log_with_restriction/__driver__.lua" # from [e3954443c89014806e43c95cf27eae40774479da] # to [21a1887296a0fb3a33b8320b746e911d9cb4b9b1] # # patch "tests/serve-automate/__driver__.lua" # from [c067cdc3785bb18ee8cd2628753a0faeb86c72b3] # to [471fb37e8ea44cecb4289711f70bdfd0bdda5ba8] # # patch "tests/serve-automate-single-run/__driver__.lua" # from [a7658c20e9a093cf4f4e75255e4adf517384efbc] # to [1f71db3bb9826760579ee0666105d1fa66e55916] # # patch "tests/test_hooks.lua" # from [d2e867d633d38b67e6055b6c672cf3ac97278382] # to [b8564ca93f58c6e6d076910e306a9b8e9116800e] # ============================================================ --- NEWS b0195c16dd7d40f8f0fa237f2ae39dcc386dd1f3 +++ NEWS 073fce5a18909977325ac839f297708eefbd175b @@ -92,13 +92,13 @@ Xxx Xxx 99 99:99:99 UTC 2010 Bugs Fixed + - the 'mv' command now warns when a source is being renamed onto + itself or one of its children (fixes monotone bug #29484). + - monotone no longer asks to pick a branch from a set of branches of a revision in which all but one branch have been suspended (fixes monotone bug #29843) - - the 'mv' command now warns when a source is being renamed onto - itself or one of its children (fixes monotone bug #29484). - - The annotate command no longer fails if it should print out empty or untrusted date cert values (fixes monotone bug #30150) @@ -111,6 +111,19 @@ Xxx Xxx 99 99:99:99 UTC 2010 to write out _MTN/options on --dry-run (fixes monotone bug #30225) + - `automate remote' and `automate remote_stdio' can now be used + without transport authentication (e.g. on file:// or ssh:// + transports) as well as anonymously over netsync + (fixes monotone bug #30237) + + - monotone does no longer warn about missing implicit includes + when dealing with restricted file sets + (fixes monotone bug #30291) + + - A regression in 0.48 made a path-restricted `mtn log' show + revisions, in which not the picked path(s), but one of its parents + were changed. This has been fixed. + - `mtn trusted` will no longer accept single bogus revision ids, but instead validates if the given revision really exists in the current database. ============================================================ --- cmd_diff_log.cc 112a3d73e8ada5d8ef433b749c4f3ec3fade5c30 +++ cmd_diff_log.cc bd1b283c47bb14e7f561d1fae2d479cedc365ee2 @@ -754,7 +754,13 @@ log_common (app_state & app, L(FL("%d selected revisions") % selected_revs.size()); + // the first restriction mask only includes the actual selected nodes + // of the user, so he doesn't get revisions reported in which not the + // selected node, but only one of its parents changed + // the second restriction mask includes the parent nodes implicitely, + // so we can use it to make a restricted roster with it later on node_restriction mask; + node_restriction mask_diff; if (!args.empty() || !app.opts.exclude_patterns.empty()) { @@ -772,7 +778,17 @@ log_common (app_state & app, mask = node_restriction(args_to_paths(args), args_to_paths(app.opts.exclude_patterns), app.opts.depth, parents, new_roster, - ignored_file(work)); + ignored_file(work), + restriction::explicit_includes); + + if (app.opts.diffs) + { + mask_diff = node_restriction(args_to_paths(args), + args_to_paths(app.opts.exclude_patterns), + app.opts.depth, parents, new_roster, + ignored_file(work), + restriction::implicit_includes); + } } else { @@ -784,7 +800,18 @@ log_common (app_state & app, mask = node_restriction(args_to_paths(args), args_to_paths(app.opts.exclude_patterns), - app.opts.depth, roster); + app.opts.depth, roster, + path_always_false(), + restriction::explicit_includes); + + if (app.opts.diffs) + { + mask_diff = node_restriction(args_to_paths(args), + args_to_paths(app.opts.exclude_patterns), + app.opts.depth, roster, + path_always_false(), + restriction::explicit_includes); + } } } @@ -918,7 +945,7 @@ log_common (app_state & app, else { ostringstream out; - log_print_rev (app, db, project, rid, rev, date_fmt, mask, out); + log_print_rev (app, db, project, rid, rev, date_fmt, mask_diff, out); string out_system; utf8_to_system_best_effort(utf8(out.str(), origin::internal), out_system); ============================================================ --- diff_output.cc 746af1eeaa7fee943bf1264dc88ddd6e218c7866 +++ diff_output.cc 60b2a95586d371c1c67036f1e4e18cde917d3535 @@ -560,8 +560,7 @@ make_diff(string const & filename1, // renames are basically hopeless (you can do them by hand _after_ // running patch), adds work so long as the first line says either // the new file's name or "/dev/null", nothing else, and deletes work - // if the new file name is "/dev/null", nothing else. (ATM we don't - // write out patches for deletes anyway.) + // if the new file name is "/dev/null", nothing else. switch (type) { case unified_diff: ============================================================ --- netcmd.cc 831cae9fe85c704421c370a432ce6957661467a6 +++ netcmd.cc 7adb348671629350233209183dab3332410f91d0 @@ -604,10 +604,18 @@ netcmd::write_automate_cmd(key_id const { cmd_code = automate_cmd; - I(client.inner()().size() == constants::merkle_hash_length_in_bytes); + I(client.inner()().empty() || + client.inner()().size() == constants::merkle_hash_length_in_bytes); I(nonce1().size() == constants::merkle_hash_length_in_bytes); - payload += client.inner()(); + if (client.inner()().empty()) + { + payload += string(constants::merkle_hash_length_in_bytes, 0); + } + else + { + payload += client.inner()(); + } payload += nonce1(); insert_variable_length_string(hmac_key_encrypted(), payload); ============================================================ --- restrictions.cc 6db7f7243f247cd8c5f3b1eef3881abaf97819ed +++ restrictions.cc 211bf4562ebbe67950b900a45a28bf0c91395439 @@ -65,7 +65,7 @@ add_parents(mapsecond == restricted_path::included) @@ -147,7 +147,7 @@ add_parents(mapsecond == restricted_path::included) @@ -250,11 +250,15 @@ node_restriction::node_restriction(vecto vector const & excludes, long depth, roster_t const & roster, - path_predicate const & ignore) + path_predicate const & ignore, + include_rules const & rules) : restriction(includes, excludes, depth) { map_nodes(node_map, roster, included_paths, excluded_paths, known_paths); - add_parents(node_map, roster); + + if (rules == implicit_includes) + add_parents(node_map, roster); + validate_paths(included_paths, excluded_paths, unknown_unignored_node(known_paths, ignore)); } @@ -286,7 +290,8 @@ node_restriction::node_restriction(vecto long depth, parent_map const & rosters1, roster_t const & roster2, - path_predicate const & ignore) + path_predicate const & ignore, + include_rules const & rules) : restriction(includes, excludes, depth) { for (parent_map::const_iterator i = rosters1.begin(); @@ -295,10 +300,13 @@ node_restriction::node_restriction(vecto included_paths, excluded_paths, known_paths); map_nodes(node_map, roster2, included_paths, excluded_paths, known_paths); - for (parent_map::const_iterator i = rosters1.begin(); - i != rosters1.end(); i++) - add_parents(node_map, parent_roster(i)); - add_parents(node_map, roster2); + if (rules == implicit_includes) + { + for (parent_map::const_iterator i = rosters1.begin(); + i != rosters1.end(); i++) + add_parents(node_map, parent_roster(i)); + add_parents(node_map, roster2); + } validate_paths(included_paths, excluded_paths, unknown_unignored_node(known_paths, ignore)); ============================================================ --- restrictions.hh 68b20076ec219d0e6f796cb0ea05a83fefc539ce +++ restrictions.hh 6cc851724aa78f04c22327a1a82dfe4facbca43a @@ -60,7 +60,7 @@ namespace restricted_path { included, excluded, - required, + required, included_required, excluded_required }; @@ -74,7 +74,7 @@ class restriction enum include_rules { - explicit_includes, + explicit_includes, implicit_includes }; @@ -99,7 +99,8 @@ class node_restriction : public restrict long depth, roster_t const & roster, path_predicate const & ignore_file - = path_always_false()); + = path_always_false(), + include_rules const & rules = implicit_includes); node_restriction(std::vector const & includes, std::vector const & excludes, @@ -116,7 +117,8 @@ class node_restriction : public restrict parent_map const & rosters1, roster_t const & roster2, path_predicate const & ignore_file - = path_always_false()); + = path_always_false(), + include_rules const & rules = implicit_includes); bool includes(roster_t const & roster, node_id nid) const; ============================================================ --- tests/log_dir/__driver__.lua b9b1ce5d34a1ab22e4b681c059c9f97595a221bd +++ tests/log_dir/__driver__.lua 533928ec6a0f7aadb5b2f9dca4a0bc8fb35d2277 @@ -44,8 +44,8 @@ for n,x in pairs{[""] = {0,0,0,0,0,0,0} for n,x in pairs{[""] = {0,0,0,0,0,0,0}, ["."] = {0,0,0,0,0,0,0}, - dir1 = {0,0,1,0,0,1,1}, - dir2 = {0,1,0,0,1,0,0}} do + dir1 = {1,0,1,0,0,1,1}, + dir2 = {1,1,0,0,1,0,0}} do if n == "" then check(mtn("log", "--no-graph"), 0, true) else ============================================================ --- tests/log_with_restriction/__driver__.lua e3954443c89014806e43c95cf27eae40774479da +++ tests/log_with_restriction/__driver__.lua 21a1887296a0fb3a33b8320b746e911d9cb4b9b1 @@ -104,9 +104,8 @@ rename("stdout", "revs") check(grep("^Revision:", "log"), 0, true, false) rename("stdout", "revs") -check(numlines("revs") == 4) +check(numlines("revs") == 3) -check(grep("^Revision: " .. rev_root, "log"), 0, true) check(grep("^Revision: " .. rev_foo1, "log"), 0, true) check(grep("^Revision: " .. rev_foo2, "log"), 0, true) check(grep("^Revision: " .. rev_foo3, "log"), 0, true) ============================================================ --- tests/serve-automate/__driver__.lua c067cdc3785bb18ee8cd2628753a0faeb86c72b3 +++ tests/serve-automate/__driver__.lua 471fb37e8ea44cecb4289711f70bdfd0bdda5ba8 @@ -50,3 +50,9 @@ server:stop() ) server:stop() + +copy("allow-automate.lua", "custom_test_hooks.lua") + +check(mtn2("automate", "remote_stdio", "file://" .. test.root .. "/test.db"), + 0, true, false, "l17:interface_versione") +check(parse_stdio(readfile("stdout"), 0, 0, "m") ~= nil) \ No newline at end of file ============================================================ --- tests/serve-automate-single-run/__driver__.lua a7658c20e9a093cf4f4e75255e4adf517384efbc +++ tests/serve-automate-single-run/__driver__.lua 1f71db3bb9826760579ee0666105d1fa66e55916 @@ -55,3 +55,9 @@ server:stop() check(qgrep("bar", "stdout")) server:stop() + +copy("allow-automate.lua", "custom_test_hooks.lua") +check(mtn2("automate", "remote", "--remote-stdio-host", + "file://"..test.root.."/test.db", + "get_file_of", "--", "-r".. R1, "foo"), 0, true, false) +check(qgrep("bar", "stdout")) ============================================================ --- tests/test_hooks.lua d2e867d633d38b67e6055b6c672cf3ac97278382 +++ tests/test_hooks.lua b8564ca93f58c6e6d076910e306a9b8e9116800e @@ -79,6 +79,11 @@ do if argv and argv[1] then table.insert(argv, "--confdir="..get_confdir()) table.insert(argv, "--rcfile="..get_confdir().."/test_hooks.lua") + local x = io.open("custom_test_hooks.lua", "rb") + if (x ~= nil) then + table.insert(argv, "--rcfile="..get_confdir().."/custom_test_hooks.lua") + x:close() + end end return argv;