# # patch "ChangeLog" # from [418536824c01d013b8d0412af3fe2fb0dd3426e6] # to [f4a86726b1991f9b0b2db5a113ddd5f8242a0c15] # # patch "work.cc" # from [e074b3b877e2c4e9fa03ce243d8a51ca8605a4ad] # to [f7655d638fff45530c1b309ade1feb2d0a057ee3] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,7 @@ +2005-05-05 Matthew Gregan + + * work.cc: Use attr_file_name rather than hardcoded strings. + 2005-05-03 Nathaniel Smith * file_io.cc (read_data_for_command_line): Check that file exists, --- work.cc +++ work.cc @@ -19,6 +19,10 @@ using namespace boost; using namespace std; +// attribute map file + +string const attr_file_name(".mt-attrs"); + void file_itemizer::visit_file(file_path const & path) { @@ -131,7 +135,7 @@ for (map::const_iterator j = m.begin(); j != m.end(); ++j) { - P(F("adding attribute '%s' to file %s to .mt_attrs\n") % j->first % i->first); + P(F("adding attribute '%s' to file %s to %s\n") % j->first % i->first % attr_file_name); attrs[i->first][j->first] = j->second; } } @@ -222,7 +226,7 @@ if (1 == attrs.erase(*i)) { updated_attr_map = true; - P(F("dropped attributes for file %s from .mt_attrs\n") % (*i) ); + P(F("dropped attributes for file %s from %s\n") % (*i) % attr_file_name); } } } @@ -282,7 +286,7 @@ // make sure there aren't pre-existing attributes that we'd accidentally // pick up N(attrs.find(dst) == attrs.end(), - F("%s has existing attributes in .mt-attrs; clean them up first") % dst); + F("%s has existing attributes in %s; clean them up first") % dst % attr_file_name); // only write out a new attribute map if we find attrs to move attr_map::iterator a = attrs.find(src); @@ -572,10 +576,6 @@ write_data(ip_path, dat); } -// attribute map file - -string const attr_file_name(".mt-attrs"); - void get_attr_path(file_path & a_path) { @@ -595,7 +595,7 @@ read_attr_map(data const & dat, attr_map & attr) { std::istringstream iss(dat()); - basic_io::input_source src(iss, ".mt-attrs"); + basic_io::input_source src(iss, attr_file_name); basic_io::tokenizer tok(src); basic_io::parser parser(tok);