# # # patch "ChangeLog" # from [d4900e665ff3c01ced7ecea29ea33bb3745e15c6] # to [82c6f9e4c25f6e757736fefc927a690a6288ecdd] # # patch "automate.cc" # from [c153f56335bc52df8d931f112119ce8b95ba9f47] # to [3929e91b407cc9896673a9eed9ca77375646922f] # # patch "commands.cc" # from [cf46c01c8cea1ef93114093d4c2bd9aebf96f9bb] # to [382a8cbc66504ad926163303f64099eb58acd582] # # patch "restrictions.cc" # from [77252f64fc5d5cbd4380de33ee362336379b45ec] # to [393a97c027623507475fb0087dcda4f16b03ce86] # # patch "revision.cc" # from [ef0c1ffe978defd311c6c97263362e55727b925a] # to [3226d5252d71007bc8a9fc0c8cc68e1d9d3d7632] # # patch "roster.cc" # from [803c285fa606de02e061d27d25fc9288a3041589] # to [e5c5a7e458a6f7e8680f7f11052f3ffa9ae8714d] # ============================================================ --- ChangeLog d4900e665ff3c01ced7ecea29ea33bb3745e15c6 +++ ChangeLog 82c6f9e4c25f6e757736fefc927a690a6288ecdd @@ -1,3 +1,12 @@ +2006-02-22 Derek Scherger + + * automate.cc (automate_get_revision, automate_get_manifest_of): + merge fixups + * commands.cc (ls_changed): convert to new restrictions + (commit, update, revert): + * restrictions.cc: + * roster.cc: merge fixups + 2006-02-20 Derek Scherger * restrictions.{cc,hh}: attempt to simplify and remove duplication ============================================================ --- automate.cc c153f56335bc52df8d931f112119ce8b95ba9f47 +++ automate.cc 3929e91b407cc9896673a9eed9ca77375646922f @@ -942,7 +942,7 @@ revision_id old_revision_id; revision_set rev; - app.require_working_copy(); + app.require_workspace(); get_base_and_current_roster_shape(old_roster, new_roster, app); update_current_roster_from_filesystem(new_roster, app); @@ -991,7 +991,7 @@ { revision_id old_revision_id; - app.require_working_copy(); + app.require_workspace(); get_base_and_current_roster_shape(old_roster, new_roster, app); update_current_roster_from_filesystem(new_roster, app); } ============================================================ --- commands.cc cf46c01c8cea1ef93114093d4c2bd9aebf96f9bb +++ commands.cc 382a8cbc66504ad926163303f64099eb58acd582 @@ -1767,51 +1767,58 @@ return fp1 < fp2; } }; + static void -ls_changed (app_state & app, vector const & args) +ls_changed(app_state & app, vector const & args) { - revision_set rs; - revision_id rid; roster_t old_roster, new_roster; - data tmp; + cset included, excluded; std::set files; app.require_workspace(); - get_working_revision_and_rosters(app, args, rs, old_roster, new_roster); - I(rs.edges.size() == 1); - cset const & cs = edge_changes(rs.edges.begin()); + get_base_and_current_roster_shape(old_roster, new_roster, app); - for (path_set::const_iterator i = cs.nodes_deleted.begin(); - i != cs.nodes_deleted.end(); ++i) + restriction mask(args, app.exclude_patterns, old_roster, new_roster); + + update_current_roster_from_filesystem(new_roster, mask, app); + make_restricted_csets(old_roster, new_roster, included, excluded, mask); + + // FIXME: this would probably be better as a function of roster.cc + for (path_set::const_iterator i = included.nodes_deleted.begin(); + i != included.nodes_deleted.end(); ++i) { - if (app.restriction_includes(*i)) + if (mask.includes(*i)) files.insert(file_path(*i)); } - for (std::map::const_iterator i = cs.nodes_renamed.begin(); - i != cs.nodes_renamed.end(); ++i) + for (std::map::const_iterator + i = included.nodes_renamed.begin(); + i != included.nodes_renamed.end(); ++i) { - if (app.restriction_includes(i->first)) + // FIXME: is reporting the old name the "right" thing to do? + if (mask.includes(i->first)) files.insert(file_path(i->first)); } - for (path_set::const_iterator i = cs.dirs_added.begin(); - i != cs.dirs_added.end(); ++i) + for (path_set::const_iterator i = included.dirs_added.begin(); + i != included.dirs_added.end(); ++i) { - if (app.restriction_includes(*i)) + if (mask.includes(*i)) files.insert(file_path(*i)); } - for (std::map::const_iterator i = cs.files_added.begin(); - i != cs.files_added.end(); ++i) + for (std::map::const_iterator i = included.files_added.begin(); + i != included.files_added.end(); ++i) { - if (app.restriction_includes(i->first)) + if (mask.includes(i->first)) files.insert(file_path(i->first)); } for (std::map >::const_iterator - i = cs.deltas_applied.begin(); i != cs.deltas_applied.end(); ++i) + i = included.deltas_applied.begin(); i != included.deltas_applied.end(); + ++i) { - if (app.restriction_includes(i->first)) + if (mask.includes(i->first)) files.insert(file_path(i->first)); } + // FIXME: should attr changes count? copy(files.begin(), files.end(), ostream_iterator(cout, "\n")); @@ -2442,7 +2449,7 @@ bool message_validated; string reason, new_manifest_text; - dump(rs, new_manifest_text); + dump(restricted_rev, new_manifest_text); app.lua.hook_validate_commit_message(log_message, new_manifest_text, message_validated, reason); @@ -2459,7 +2466,7 @@ else { // new revision - L(FL("inserting new revision %s\n") % rid); + L(FL("inserting new revision %s\n") % restricted_rev_id); I(restricted_rev.edges.size() == 1); edge_map::const_iterator edge = restricted_rev.edges.begin(); @@ -3075,8 +3082,8 @@ // and write the cset from chosen to merged changeset in MT/work cset update, remaining; - make_cset (working_roster, merged_roster, update); - make_cset (target_roster, merged_roster, remaining); + make_cset(working_roster, merged_roster, update); + make_cset(target_roster, merged_roster, remaining); // { // data t1, t2, t3; @@ -3359,7 +3366,7 @@ if (args.size() < 1) throw usage(name); - app.require_working_copy(); + app.require_workspace(); vector includes; vector excludes; @@ -3380,7 +3387,7 @@ for (path_set::const_iterator i = missing.begin(); i != missing.end(); i++) { file_path fp(*i); - L(F("missing files are '%s'") % fp); + L(FL("missing files are '%s'") % fp); includes.push_back(fp.as_external()); } } ============================================================ --- restrictions.cc 77252f64fc5d5cbd4380de33ee362336379b45ec +++ restrictions.cc 393a97c027623507475fb0087dcda4f16b03ce86 @@ -117,7 +117,7 @@ } else { - L(F("path '%s' %d %d") % sp % old_state % new_state); + L(FL("path '%s' %d %d") % sp % old_state % new_state); N(false, F("conflicting include/exclude on path '%s'") % sp); } } @@ -277,7 +277,7 @@ // empty restriction includes everything if (node_map.empty()) { - L(F("empty include of nid %d path '%s'") % nid % file_path(sp)); + L(FL("empty include of nid %d path '%s'") % nid % file_path(sp)); return true; } @@ -292,18 +292,18 @@ switch (r->second) { case explicit_include: - L(F("explicit include of nid %d path '%s'") % current % file_path(sp)); + L(FL("explicit include of nid %d path '%s'") % current % file_path(sp)); return true; case explicit_exclude: - L(F("explicit exclude of nid %d path '%s'") % current % file_path(sp)); + L(FL("explicit exclude of nid %d path '%s'") % current % file_path(sp)); return false; case implicit_include: // this is non-recursive and requires an exact match if (current == nid) { - L(F("implicit include of nid %d path '%s'") % current % file_path(sp)); + L(FL("implicit include of nid %d path '%s'") % current % file_path(sp)); return true; } } @@ -315,12 +315,12 @@ if (default_result) { - L(F("default include of nid %d path '%s'\n") % nid % file_path(sp)); + L(FL("default include of nid %d path '%s'\n") % nid % file_path(sp)); return true; } else { - L(F("default exclude of nid %d path '%s'\n") % nid % file_path(sp)); + L(FL("default exclude of nid %d path '%s'\n") % nid % file_path(sp)); return false; } } @@ -330,7 +330,7 @@ { if (path_map.empty()) { - L(F("empty include of path '%s'") % file_path(sp)); + L(FL("empty include of path '%s'") % file_path(sp)); return true; } @@ -345,18 +345,18 @@ switch (r->second) { case explicit_include: - L(F("explicit include of path '%s'") % file_path(sp)); + L(FL("explicit include of path '%s'") % file_path(sp)); return true; case explicit_exclude: - L(F("explicit exclude of path '%s'") % file_path(sp)); + L(FL("explicit exclude of path '%s'") % file_path(sp)); return false; case implicit_include: // this is non-recursive and requires an exact match if (current == sp) { - L(F("implicit include of path '%s'") % file_path(sp)); + L(FL("implicit include of path '%s'") % file_path(sp)); return true; } } @@ -367,12 +367,12 @@ if (default_result) { - L(F("default include of path '%s'\n") % file_path(sp)); + L(FL("default include of path '%s'\n") % file_path(sp)); return true; } else { - L(F("default exclude of path '%s'\n") % file_path(sp)); + L(FL("default exclude of path '%s'\n") % file_path(sp)); return false; } } ============================================================ --- revision.cc ef0c1ffe978defd311c6c97263362e55727b925a +++ revision.cc 3226d5252d71007bc8a9fc0c8cc68e1d9d3d7632 @@ -542,7 +542,7 @@ make_cset(old_roster, new_roster, *cs); calculate_ident(new_roster, rev.new_manifest); - L(F("new manifest_id is %s\n") % rev.new_manifest); + L(FL("new manifest_id is %s\n") % rev.new_manifest); safe_insert(rev.edges, std::make_pair(old_rev_id, cs)); } ============================================================ --- roster.cc 803c285fa606de02e061d27d25fc9288a3041589 +++ roster.cc e5c5a7e458a6f7e8680f7f11052f3ffa9ae8714d @@ -1914,7 +1914,7 @@ { included.clear(); excluded.clear(); - L(F("building restricted csets\n")); + L(FL("building restricted csets\n")); parallel::iter i(from.all_nodes(), to.all_nodes()); while (i.next()) { @@ -1928,12 +1928,12 @@ if (mask.includes(from, i.left_key())) { delta_only_in_from(from, i.left_key(), i.left_data(), included); - L(F("included left %d\n") % i.left_key()); + L(FL("included left %d\n") % i.left_key()); } else { delta_only_in_from(from, i.left_key(), i.left_data(), excluded); - L(F("excluded left %d\n") % i.left_key()); + L(FL("excluded left %d\n") % i.left_key()); } break; @@ -1941,12 +1941,12 @@ if (mask.includes(to, i.right_key())) { delta_only_in_to(to, i.right_key(), i.right_data(), included); - L(F("included right %d\n") % i.right_key()); + L(FL("included right %d\n") % i.right_key()); } else { delta_only_in_to(to, i.right_key(), i.right_data(), excluded); - L(F("excluded right %d\n") % i.right_key()); + L(FL("excluded right %d\n") % i.right_key()); } break; @@ -1954,12 +1954,12 @@ if (mask.includes(from, i.left_key()) || mask.includes(to, i.right_key())) { delta_in_both(i.left_key(), from, i.left_data(), to, i.right_data(), included); - L(F("in both %d %d\n") % i.left_key() % i.right_key()); + L(FL("in both %d %d\n") % i.left_key() % i.right_key()); } else { delta_in_both(i.left_key(), from, i.left_data(), to, i.right_data(), excluded); - L(F("in both %d %d\n") % i.left_key() % i.right_key()); + L(FL("in both %d %d\n") % i.left_key() % i.right_key()); } break; }