# # # patch "cmd_ws_commit.cc" # from [10d33763a838c34d36cdacf987678905f77762be] # to [150afd3daf9e58ab0f74be073d19de41459ce7a3] # # patch "restrictions.cc" # from [56fc39ab78a21dfadc8c48582e3b6bac297401da] # to [cbb24505c2ec989684ef3760b1766faa0455b92c] # # patch "restrictions.hh" # from [d349fca527a084d74bf2660ba809c22a8604adc3] # to [68b20076ec219d0e6f796cb0ea05a83fefc539ce] # ============================================================ --- cmd_ws_commit.cc 10d33763a838c34d36cdacf987678905f77762be +++ cmd_ws_commit.cc 150afd3daf9e58ab0f74be073d19de41459ce7a3 @@ -223,7 +223,8 @@ CMD(revert, "revert", "", CMD_REF(worksp node_restriction mask(args_to_paths(args), args_to_paths(app.opts.exclude_patterns), app.opts.depth, - old_roster, new_roster, ignored_file(work)); + old_roster, new_roster, ignored_file(work), + restriction::explicit_includes); if (app.opts.missing) { ============================================================ --- restrictions.cc 56fc39ab78a21dfadc8c48582e3b6bac297401da +++ restrictions.cc cbb24505c2ec989684ef3760b1766faa0455b92c @@ -264,13 +264,19 @@ node_restriction::node_restriction(vecto long depth, roster_t const & roster1, roster_t const & roster2, - path_predicate const & ignore) + path_predicate const & ignore, + include_rules const & rules) : restriction(includes, excludes, depth) { map_nodes(node_map, roster1, included_paths, excluded_paths, known_paths); map_nodes(node_map, roster2, included_paths, excluded_paths, known_paths); - add_parents(node_map, roster1); - add_parents(node_map, roster2); + + if (rules == implicit_includes) + { + add_parents(node_map, roster1); + add_parents(node_map, roster2); + } + validate_paths(included_paths, excluded_paths, unknown_unignored_node(known_paths, ignore)); } ============================================================ --- restrictions.hh d349fca527a084d74bf2660ba809c22a8604adc3 +++ restrictions.hh 68b20076ec219d0e6f796cb0ea05a83fefc539ce @@ -72,6 +72,12 @@ class restriction bool empty() const { return included_paths.empty() && excluded_paths.empty(); } + enum include_rules + { + explicit_includes, + implicit_includes + }; + protected: restriction() : depth(-1) {} @@ -101,7 +107,8 @@ class node_restriction : public restrict roster_t const & roster1, roster_t const & roster2, 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,