# # patch "work.cc" # from [941f2073a7cccf5548e7e0bdbfffabf649089684] # to [0dcca2bd49850d419b5904775a74313235fcba2a] # # patch "work.hh" # from [8a4681dd53c7a2f7b69d946818fd95be1628b225] # to [3fe7ca77fa62c1c922143e00f3a708b62627d891] # ======================================================================== --- work.cc 941f2073a7cccf5548e7e0bdbfffabf649089684 +++ work.cc 0dcca2bd49850d419b5904775a74313235fcba2a @@ -152,7 +152,7 @@ temp_node_id_source nis; roster_t base_roster, new_roster; - get_base_and_current_roster(base_roster, new_roster, nis, app); + get_base_and_current_roster_shape(base_roster, new_roster, nis, app); editable_roster_base er(new_roster, nis); @@ -184,7 +184,7 @@ temp_node_id_source nis; roster_t base_roster, new_roster; - get_base_and_current_roster(base_roster, new_roster, nis, app); + get_base_and_current_roster_shape(base_roster, new_roster, nis, app); // we traverse the the paths backwards, so that we always hit deep paths // before shallow paths (because path_set is lexicographically sorted). @@ -428,7 +428,7 @@ } void -get_current_roster(roster_t & ros, node_id_source & nis, app_state & app) +get_current_roster_shape(roster_t & ros, node_id_source & nis, app_state & app) { get_base_roster(app, ros); cset cs; @@ -438,11 +438,18 @@ } void -get_base_and_current_roster(roster_t & base_roster, - roster_t & current_roster, - node_id_source & nis, - app_state & app) +get_current_restricted_roster(roster_t & ros, node_id_source & nis, app_state & app) { + get_current_roster_shape(ros, nis, app); + update_restricted_roster_from_filesystem(ros, app); +} + +void +get_base_and_current_roster_shape(roster_t & base_roster, + roster_t & current_roster, + node_id_source & nis, + app_state & app) +{ get_base_roster(app, base_roster); current_roster = base_roster; cset cs; @@ -451,6 +458,16 @@ cs.apply_to(er); } +void +get_base_and_current_restricted_roster(roster_t & base_roster, + roster_t & current_roster, + node_id_source & nis, + app_state & app) +{ + get_base_and_current_roster_shape(base_roster, current_roster, nis, app); + update_restricted_roster_from_filesystem(current_roster, app); +} + // user log file string const user_log_file_name("log"); ======================================================================== --- work.hh 8a4681dd53c7a2f7b69d946818fd95be1628b225 +++ work.hh 3fe7ca77fa62c1c922143e00f3a708b62627d891 @@ -99,12 +99,25 @@ roster_t & ros); void get_base_roster(app_state & app, roster_t & ros); -void get_current_roster(roster_t & ros, node_id_source & nis, app_state & app); +// This returns the current roster, except it does not bother updating the +// hashes in that roster -- the "shape" is correct, all files and dirs exist +// and under the correct names -- but do not trust file content hashes. +void get_current_roster_shape(roster_t & ros, node_id_source & nis, app_state & app); +// This does update hashes, but only those that match the current restriction +void get_current_restricted_roster(roster_t & ros, node_id_source & nis, app_state & app); -void get_base_and_current_roster(roster_t & base_roster, - roster_t & current_roster, - node_id_source & nis, - app_state & app); +// This returns the current roster, except it does not bother updating the +// hashes in that roster -- the "shape" is correct, all files and dirs exist +// and under the correct names -- but do not trust file content hashes. +void get_base_and_current_roster_shape(roster_t & base_roster, + roster_t & current_roster, + node_id_source & nis, + app_state & app); +// This does update hashes, but only those that match the current restriction +void get_base_and_current_restricted_roster(roster_t & base_roster, + roster_t & current_roster, + node_id_source & nis, + app_state & app); // the "user log" is a file the user can edit as they program to record // changes they make to their source code. Upon commit the file is read