# # # patch "NEWS" # from [47e2effcf2d558cd202ee2c79e2b7437f35aed6b] # to [196b719fe676cc70cc766ffa0b5c8ea170786017] # # patch "cmd_diff_log.cc" # from [112a3d73e8ada5d8ef433b749c4f3ec3fade5c30] # to [bd1b283c47bb14e7f561d1fae2d479cedc365ee2] # # 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] # ============================================================ --- NEWS 47e2effcf2d558cd202ee2c79e2b7437f35aed6b +++ NEWS 196b719fe676cc70cc766ffa0b5c8ea170786017 @@ -79,13 +79,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) @@ -98,6 +98,14 @@ Xxx Xxx 99 99:99:99 UTC 2010 to write out _MTN/options on --dry-run (fixes monotone bug #30225) + - 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); ============================================================ --- 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)