# # # patch "automate.cc" # from [5be8a8ebdc7a162f0dd0b0cd79f65f3be66d4abf] # to [63b44f3c2366f52a040cc8d0029ffc1d896740d9] # # patch "cmd_ws_commit.cc" # from [5559c2b351ed529cfd71dc071e35841ebe8f72a2] # to [42bb3c5d7f960a344b04e043805cca2b17752f51] # # patch "merge_conflict.cc" # from [b9162a1e2c3929ca16501bdfad57522f4616195a] # to [d453ad29aaf2576188b37c0f866eb5726a65398b] # # patch "merge_roster.cc" # from [11dbe612fdb5f76eb10de88b07057c6f7e98b9dc] # to [0350ccbd3b9b7d79f93c7d8852b890ee4020e14c] # # patch "merge_roster.hh" # from [33e71d22ef810554cfc133c69c5e65ee37031e9f] # to [c721929e38b641375ea2b5ac1ae2fdd081e88882] # # patch "rev_types.hh" # from [81c80844a9083de00a1da7297528ae91737bcfbc] # to [57f8ea1d809f63101811a9c816f413b3fa912872] # # patch "roster.cc" # from [bfae685e1a37e6fe09184d44e82e307e633fdaa5] # to [66bc35b83523f6e54dfb1d33ca1a747a867779f8] # # patch "roster.hh" # from [cff9707c9498e8f3fd61ad45b80473cc4444ce06] # to [26bb4cf4733b6ffe738f39e063d9dfcfdaabe08a] # # patch "roster_delta.cc" # from [26aa90ed85b6cbdb57c1c77e97d3a0ef305e55dd] # to [b9541d767d86bf64f86bfd531a3d2c6c751f3886] # # patch "unit-tests/cset.cc" # from [28a06dc65c661141c07a93b69533c42d352a3586] # to [f582b5ef8cbc3ffa8d81da0f071c5c4deb4ff18f] # # patch "unit-tests/merge_roster.cc" # from [5c08ece22eaf194dd5145b436bf3408b870fba88] # to [1853c103dd728750136e85ab5e97f72104fc0d7f] # # patch "unit-tests/roster.cc" # from [77681ef65ff98bcaf591865acdd228d2f00dd2fa] # to [e591ab4c78e425d2ae7140eeb4103746b0bc74e9] # # patch "work.cc" # from [c599d6997fd914394ef1143ab131c0fc0002eeaf] # to [7d826f4bcafad857185c2a1d81a3c3ab1fcaff66] # ============================================================ --- automate.cc 5be8a8ebdc7a162f0dd0b0cd79f65f3be66d4abf +++ automate.cc 63b44f3c2366f52a040cc8d0029ffc1d896740d9 @@ -535,7 +535,7 @@ struct node_info node_id id; path::status type; file_id ident; - full_attr_map_t attrs; + attr_map_t attrs; node_info() : exists(false), id(the_null_node), type(path::nonexistent) {} }; ============================================================ --- cmd_ws_commit.cc 5559c2b351ed529cfd71dc071e35841ebe8f72a2 +++ cmd_ws_commit.cc 42bb3c5d7f960a344b04e043805cca2b17752f51 @@ -740,7 +740,7 @@ CMD(attr_drop, "drop", "", CMD_REF(attr) // Clear all attrs (or a specific attr). if (args.size() == 1) { - for (full_attr_map_t::iterator i = node->attrs.begin(); + for (attr_map_t::iterator i = node->attrs.begin(); i != node->attrs.end(); ++i) i->second = make_pair(false, ""); } @@ -788,7 +788,7 @@ CMD(attr_get, "get", "", CMD_REF(attr), if (args.size() == 1) { bool has_any_live_attrs = false; - for (full_attr_map_t::const_iterator i = node->attrs.begin(); + for (attr_map_t::const_iterator i = node->attrs.begin(); i != node->attrs.end(); ++i) if (i->second.first) { @@ -804,7 +804,7 @@ CMD(attr_get, "get", "", CMD_REF(attr), { I(args.size() == 2); attr_key a_key = typecast_vocab(idx(args, 1)); - full_attr_map_t::const_iterator i = node->attrs.find(a_key); + attr_map_t::const_iterator i = node->attrs.find(a_key); if (i != node->attrs.end() && i->second.first) cout << path << " : " << i->first << '=' @@ -908,7 +908,7 @@ CMD_AUTOMATE(get_attributes, N_("PATH"), // the current node holds all current attributes (unchanged and new ones) node_t n = current.get_node(path); - for (full_attr_map_t::const_iterator i = n->attrs.begin(); + for (attr_map_t::const_iterator i = n->attrs.begin(); i != n->attrs.end(); ++i) { std::string value(i->second.second()); @@ -927,7 +927,7 @@ CMD_AUTOMATE(get_attributes, N_("PATH"), node_t prev_node = base.get_node(path); // find the attribute in there - full_attr_map_t::const_iterator j = prev_node->attrs.find(i->first); + attr_map_t::const_iterator j = prev_node->attrs.find(i->first); I(j != prev_node->attrs.end()); // was this dropped before? then ignore it @@ -943,7 +943,7 @@ CMD_AUTOMATE(get_attributes, N_("PATH"), if (base.has_node(path)) { node_t prev_node = base.get_node(path); - full_attr_map_t::const_iterator j = + attr_map_t::const_iterator j = prev_node->attrs.find(i->first); // the attribute is new if it either hasn't been found @@ -1060,7 +1060,7 @@ CMD_AUTOMATE(drop_attribute, N_("PATH [K // Clear all attrs (or a specific attr). if (args.size() == 1) { - for (full_attr_map_t::iterator i = node->attrs.begin(); + for (attr_map_t::iterator i = node->attrs.begin(); i != node->attrs.end(); ++i) i->second = make_pair(false, ""); } ============================================================ --- merge_conflict.cc b9162a1e2c3929ca16501bdfad57522f4616195a +++ merge_conflict.cc d453ad29aaf2576188b37c0f866eb5726a65398b @@ -2217,7 +2217,7 @@ attach_node (lua_hooks & lua, new_roster.attach_node (nid, target_path); node_t node = new_roster.get_node (nid); - for (full_attr_map_t::const_iterator attr = node->attrs.begin(); + for (attr_map_t::const_iterator attr = node->attrs.begin(); attr != node->attrs.end(); ++attr) lua.hook_apply_attribute (attr->first(), target_path, attr->second.second()); ============================================================ --- merge_roster.cc 11dbe612fdb5f76eb10de88b07057c6f7e98b9dc +++ merge_roster.cc 0350ccbd3b9b7d79f93c7d8852b890ee4020e14c @@ -640,10 +640,10 @@ roster_merge(roster_t const & left_paren } // merge attributes { - full_attr_map_t::const_iterator left_ai = left_n->attrs.begin(); - full_attr_map_t::const_iterator right_ai = right_n->attrs.begin(); - parallel::iter attr_i(left_n->attrs, - right_n->attrs); + attr_map_t::const_iterator left_ai = left_n->attrs.begin(); + attr_map_t::const_iterator right_ai = right_n->attrs.begin(); + parallel::iter attr_i(left_n->attrs, + right_n->attrs); while(attr_i.next()) { switch (attr_i.state()) ============================================================ --- merge_roster.hh 33e71d22ef810554cfc133c69c5e65ee37031e9f +++ merge_roster.hh c721929e38b641375ea2b5ac1ae2fdd081e88882 @@ -116,7 +116,7 @@ struct duplicate_name_conflict // nodes with attribute conflicts are left attached in the resulting tree (unless // detached for some other reason), but with the given attribute left out of -// their full_attr_map_t. Note that this doesn't actually leave the resulting +// their attr_map_t. Note that this doesn't actually leave the resulting // roster insane (FIXME: we could put an invalid attr value in instead, like a // pair (false, "foo") (since the second value can only be non-null if the // first is 'true'). Should we do this?) ============================================================ --- rev_types.hh 81c80844a9083de00a1da7297528ae91737bcfbc +++ rev_types.hh 57f8ea1d809f63101811a9c816f413b3fa912872 @@ -82,7 +82,7 @@ typedef hybrid_map node // (true, "val") or (false, "") are both valid attr values (for proper // merging, we have to widen the attr_value type to include a first-class // "undefined" value). -typedef std::map > full_attr_map_t; +typedef std::map > attr_map_t; // full definitions in database.hh class database; ============================================================ --- roster.cc bfae685e1a37e6fe09184d44e82e307e633fdaa5 +++ roster.cc 66bc35b83523f6e54dfb1d33ca1a747a867779f8 @@ -68,10 +68,10 @@ template <> void } template <> void -dump(full_attr_map_t const & val, string & out) +dump(attr_map_t const & val, string & out) { ostringstream oss; - for (full_attr_map_t::const_iterator i = val.begin(); i != val.end(); ++i) + for (attr_map_t::const_iterator i = val.begin(); i != val.end(); ++i) oss << "attr key: '" << i->first << "'\n" << " status: " << (i->second.first ? "live" : "dead") << '\n' << " value: '" << i->second.second << "'\n"; @@ -965,7 +965,7 @@ roster_t::set_attr(file_path const & pth node_t n = get_node(pth); I(val.first || val.second().empty()); I(!null_node(n->self)); - full_attr_map_t::iterator i = n->attrs.find(name); + attr_map_t::iterator i = n->attrs.find(name); if (i == n->attrs.end()) i = safe_insert(n->attrs, make_pair(name, make_pair(false, attr_value()))); @@ -981,7 +981,7 @@ roster_t::set_attr_unknown_to_dead_ok(no { node_t n = get_node(nid); I(val.first || val.second().empty()); - full_attr_map_t::iterator i = n->attrs.find(name); + attr_map_t::iterator i = n->attrs.find(name); if (i != n->attrs.end()) I(i->second != val); n->attrs[name] = val; @@ -995,7 +995,7 @@ roster_t::get_attr(file_path const & pth I(has_node(pth)); node_t n = get_node(pth); - full_attr_map_t::const_iterator i = n->attrs.find(name); + attr_map_t::const_iterator i = n->attrs.find(name); if (i != n->attrs.end() && i->second.first) { val = i->second.second; @@ -1054,7 +1054,7 @@ roster_t::check_sane(bool temp_nodes_ok) I(!n->name.empty() && !null_node(n->parent)); I(!null_id(downcast_to_file_t(n)->content)); } - for (full_attr_map_t::const_iterator i = n->attrs.begin(); i != n->attrs.end(); ++i) + for (attr_map_t::const_iterator i = n->attrs.begin(); i != n->attrs.end(); ++i) I(i->second.first || i->second.second().empty()); if (n != root_dir) { @@ -1095,7 +1095,7 @@ roster_t::check_sane_against(marking_map else I(mi->second.file_content.empty()); - full_attr_map_t::const_iterator rai; + attr_map_t::const_iterator rai; map >::const_iterator mai; for (rai = ri->second->attrs.begin(), mai = mi->second.attrs.begin(); rai != ri->second->attrs.end() && mai != mi->second.attrs.end(); @@ -1292,8 +1292,8 @@ namespace while (left_i != left.all_nodes().end() || right_i != right.all_nodes().end()) { I(left_i->second->self == right_i->second->self); - parallel::iter j(left_i->second->attrs, - right_i->second->attrs); + parallel::iter j(left_i->second->attrs, + right_i->second->attrs); // we batch up the modifications until the end, so as not to be // changing things around under the parallel::iter's feet set left_missing, right_missing; @@ -1489,7 +1489,7 @@ namespace I(new_marking.attrs.empty()); set singleton; singleton.insert(new_rid); - for (full_attr_map_t::const_iterator i = n->attrs.begin(); + for (attr_map_t::const_iterator i = n->attrs.begin(); i != n->attrs.end(); ++i) new_marking.attrs.insert(make_pair(i->first, singleton)); } @@ -1522,12 +1522,12 @@ namespace downcast_to_file_t(n)->content, new_marking.file_content); - for (full_attr_map_t::const_iterator i = n->attrs.begin(); + for (attr_map_t::const_iterator i = n->attrs.begin(); i != n->attrs.end(); ++i) { set & new_marks = new_marking.attrs[i->first]; I(new_marks.empty()); - full_attr_map_t::const_iterator j = parent_n->attrs.find(i->first); + attr_map_t::const_iterator j = parent_n->attrs.find(i->first); if (j == parent_n->attrs.end()) new_marks.insert(new_rid); else @@ -1573,12 +1573,12 @@ namespace new_rid, f->content, new_marking.file_content); } // attrs - for (full_attr_map_t::const_iterator i = n->attrs.begin(); + for (attr_map_t::const_iterator i = n->attrs.begin(); i != n->attrs.end(); ++i) { attr_key const & key = i->first; - full_attr_map_t::const_iterator li = ln->attrs.find(key); - full_attr_map_t::const_iterator ri = rn->attrs.find(key); + attr_map_t::const_iterator li = ln->attrs.find(key); + attr_map_t::const_iterator ri = rn->attrs.find(key); I(new_marking.attrs.find(key) == new_marking.attrs.end()); // [], when used to refer to a non-existent element, default // constructs that element and returns a reference to it. We make use @@ -1617,10 +1617,10 @@ namespace // SPEEDUP?: this code could probably be made more efficient -- but very // rarely will any node have more than, say, one attribute, so it probably // doesn't matter. - for (full_attr_map_t::const_iterator i = ln->attrs.begin(); + for (attr_map_t::const_iterator i = ln->attrs.begin(); i != ln->attrs.end(); ++i) I(n->attrs.find(i->first) != n->attrs.end()); - for (full_attr_map_t::const_iterator i = rn->attrs.begin(); + for (attr_map_t::const_iterator i = rn->attrs.begin(); i != rn->attrs.end(); ++i) I(n->attrs.find(i->first) != n->attrs.end()); } @@ -1972,7 +1972,7 @@ namespace { safe_insert(cs.dirs_added, pth); } - for (full_attr_map_t::const_iterator i = n->attrs.begin(); + for (attr_map_t::const_iterator i = n->attrs.begin(); i != n->attrs.end(); ++i) if (i->second.first) safe_insert(cs.attrs_set, @@ -2013,7 +2013,7 @@ namespace // Compare attrs. { - parallel::iter i(from_n->attrs, to_n->attrs); + parallel::iter i(from_n->attrs, to_n->attrs); while (i.next()) { MM(i); @@ -2505,7 +2505,7 @@ roster_t::print_to(basic_io::printer & p } // Push the non-dormant part of the attr map - for (full_attr_map_t::const_iterator j = curr->attrs.begin(); + for (attr_map_t::const_iterator j = curr->attrs.begin(); j != curr->attrs.end(); ++j) { if (j->second.first) @@ -2518,7 +2518,7 @@ roster_t::print_to(basic_io::printer & p if (print_local_parts) { // Push the dormant part of the attr map - for (full_attr_map_t::const_iterator j = curr->attrs.begin(); + for (attr_map_t::const_iterator j = curr->attrs.begin(); j != curr->attrs.end(); ++j) { if (!j->second.first) ============================================================ --- roster.hh cff9707c9498e8f3fd61ad45b80473cc4444ce06 +++ roster.hh 26bb4cf4733b6ffe738f39e063d9dfcfdaabe08a @@ -33,7 +33,7 @@ template <> void dump(node_id const & va } template <> void dump(node_id const & val, std::string & out); -template <> void dump(full_attr_map_t const & val, std::string & out); +template <> void dump(attr_map_t const & val, std::string & out); struct node { @@ -42,7 +42,7 @@ struct node node_id self; node_id parent; // the_null_node iff this is a root dir path_component name; // the_null_component iff this is a root dir - full_attr_map_t attrs; + attr_map_t attrs; // need a virtual function to make dynamic_cast work virtual node_t clone() = 0; ============================================================ --- roster_delta.cc 26aa90ed85b6cbdb57c1c77e97d3a0ef305e55dd +++ roster_delta.cc b9541d767d86bf64f86bfd531a3d2c6c751f3886 @@ -135,7 +135,7 @@ namespace safe_insert(d.files_added, make_pair(new_loc, make_pair(nid, content))); } - for (full_attr_map_t::const_iterator i = new_n->attrs.begin(); + for (attr_map_t::const_iterator i = new_n->attrs.begin(); i != new_n->attrs.end(); ++i) safe_insert(d.attrs_changed, make_pair(nid, *i)); } @@ -162,7 +162,7 @@ namespace } // attrs? { - parallel::iter i(old_n->attrs, new_n->attrs); + parallel::iter i(old_n->attrs, new_n->attrs); MM(i); while (i.next()) { ============================================================ --- unit-tests/cset.cc 28a06dc65c661141c07a93b69533c42d352a3586 +++ unit-tests/cset.cc f582b5ef8cbc3ffa8d81da0f071c5c4deb4ff18f @@ -393,7 +393,7 @@ UNIT_TEST(basic_csets) attr_value("klang"))); UNIT_TEST_CHECK_NOT_THROW(cs.apply_to(tree), logic_error); - full_attr_map_t attrs = (r.get_node(foo_bar))->attrs; + attr_map_t attrs = (r.get_node(foo_bar))->attrs; UNIT_TEST_CHECK(attrs[attr_key("ping")] == make_pair(true, attr_value("klang"))); attrs = (r.get_node(foo))->attrs; ============================================================ --- unit-tests/merge_roster.cc 5c08ece22eaf194dd5145b436bf3408b870fba88 +++ unit-tests/merge_roster.cc 1853c103dd728750136e85ab5e97f72104fc0d7f @@ -383,7 +383,7 @@ struct attr_scalar : public virtual base I(c.key == attr_key("test_key")); I(c.left == make_pair(true, attr_value_for(left_val))); I(c.right == make_pair(true, attr_value_for(right_val))); - full_attr_map_t const & attrs = result.roster.get_node(thing_nid)->attrs; + attr_map_t const & attrs = result.roster.get_node(thing_nid)->attrs; I(attrs.find(attr_key("test_key")) == attrs.end()); // resolve the conflict, thus making sure that resolution works and // that this was the only conflict signaled ============================================================ --- unit-tests/roster.cc 77681ef65ff98bcaf591865acdd228d2f00dd2fa +++ unit-tests/roster.cc e591ab4c78e425d2ae7140eeb4103746b0bc74e9 @@ -284,7 +284,7 @@ path_component new_component(randomizer } -attr_key pick_attr(full_attr_map_t const & attrs, randomizer & rng) +attr_key pick_attr(attr_map_t const & attrs, randomizer & rng) { return random_element(attrs, rng)->first; } ============================================================ --- work.cc c599d6997fd914394ef1143ab131c0fc0002eeaf +++ work.cc 7d826f4bcafad857185c2a1d81a3c3ab1fcaff66 @@ -1873,11 +1873,11 @@ workspace::update_any_attrs(database & d new_roster.get_name(i->first, fp); node_t n = i->second; - for (full_attr_map_t::const_iterator j = n->attrs.begin(); + for (attr_map_t::const_iterator j = n->attrs.begin(); j != n->attrs.end(); ++j) if (j->second.first) - lua.hook_apply_attribute (j->first(), fp, - j->second.second()); + lua.hook_apply_attribute(j->first(), fp, + j->second.second()); } }