# # patch "ChangeLog" # from [8705073f5cf12539e84d181ca4891fead220198a] # to [da109a8ecfc036f5aa5ddb6a3090765f8becbd53] # # patch "change_set.cc" # from [ef1ddf0e7f4c65886959cbb2eaad68e25aba4427] # to [cf191c5853014ae777ac96699fff4c7af62ff6ed] # # patch "commands.cc" # from [04a32e75febf07c7240897b2f7a01f4408b768eb] # to [e87259761fc59458df0deaab4c322cb9e6f5b549] # # patch "database.cc" # from [b86839912394ce3592000b59428e6cf84ef5627b] # to [7109cafc0dfce162176738368f269e18cb5cb4e6] # # patch "transforms.cc" # from [dad4a47fc6ec586f75803cc81ba3f430e5695ff1] # to [05437d611e11ac3f6a0cbef9eb352a112c60d401] # ======================================================================== --- ChangeLog 8705073f5cf12539e84d181ca4891fead220198a +++ ChangeLog da109a8ecfc036f5aa5ddb6a3090765f8becbd53 @@ -1,5 +1,13 @@ 2005-08-26 Nathaniel Smith + * transforms.cc (length): + * database.cc (sql, load, open): + * commands.cc (rename, attr): + * change_set.cc (move_files_to_tmp_bottom_up) + (move_files_from_tmp_top_down): Merge fixups. + +2005-08-26 Nathaniel Smith + * database_check.cc: Track and report on manifest and revision parseability. * tests/t_database_check_normalized.at: Update to expect "not ======================================================================== --- change_set.cc ef1ddf0e7f4c65886959cbb2eaad68e25aba4427 +++ change_set.cc cf191c5853014ae777ac96699fff4c7af62ff6ed @@ -2422,7 +2422,7 @@ entry != node->end(); ++entry) { tid child = directory_entry_tid(entry); - file_path path; + file_path src; path_item item; find_item(child, state, item); @@ -2434,7 +2434,7 @@ if (path_item_type(item) == ptype_directory) move_files_to_tmp_bottom_up(child, temporary_root, state, dmap); - get_full_path(state, child, path); + get_full_path(state, child, src); bookkeeping_path dst = temporary_root / boost::lexical_cast(child); @@ -2474,7 +2474,7 @@ entry != node->end(); ++entry) { tid child = directory_entry_tid(entry); - file_path path; + file_path dst; path_item item; find_item(child, state, item); @@ -2482,7 +2482,7 @@ if (null_name(path_item_name(item))) continue; - get_full_path(state, child, path); + get_full_path(state, child, dst); bookkeeping_path src = temporary_root / boost::lexical_cast(child); @@ -2492,17 +2492,17 @@ case ptype_file: if (file_exists(src)) { - P(F("moving file %s -> %s\n") % src % path); - make_dir_for(path); - move_file(src, path); + P(F("moving file %s -> %s\n") % src % dst); + make_dir_for(dst); + move_file(src, dist); } break; case ptype_directory: if (directory_exists(src)) { - P(F("moving dir %s -> %s\n") % src % path); - make_dir_for(path); - move_dir(src, path); + P(F("moving dir %s -> %s\n") % src % dist); + make_dir_for(dist); + move_dir(src, dst); } break; } ======================================================================== --- commands.cc 04a32e75febf07c7240897b2f7a01f4408b768eb +++ commands.cc e87259761fc59458df0deaab4c322cb9e6f5b549 @@ -1154,8 +1154,9 @@ change_set::path_rearrangement work; get_path_rearrangement(work); - build_rename(app.prefix(idx(args, 0)()), app.prefix(idx(args, 1)()), m_old, - app, work); + build_rename(file_path_external(idx(args, 0)), + file_path_external(idx(args, 1)), + m_old, app, work); put_path_rearrangement(work); @@ -2162,7 +2163,7 @@ read_attr_map(attr_data, attrs); } - file_path path = app.prefix(idx(args,1)()); + file_path path = file_path_external(idx(args,1)); N(file_exists(path), F("no such file %s") % path); bool attrs_modified = false; ======================================================================== --- database.cc b86839912394ce3592000b59428e6cf84ef5627b +++ database.cc 7109cafc0dfce162176738368f269e18cb5cb4e6 @@ -194,13 +194,13 @@ if (! init) { N(fs::exists(filename), - F("database %s does not exist") % filename.string()); N(!fs::is_directory(filename), - F("database %s is a directory") % filename.string()); + require_path_is_file(filename, + F("database %s does not exist") % filename, + F("database %s is a directory") % filename); + check_sqlite_format_version(filename); } - check_sqlite_format_version(filename); - open(); if (init) @@ -346,8 +346,8 @@ check_filename(); - N(!fs::exists(filename), - F("cannot create %s; it already exists\n") % filename.string()); + require_path_is_nonexistent(filename, + F("cannot create %s; it already exists") % filename); open(); @@ -2458,11 +2458,10 @@ { int error; - error = sqlite3_open(filename.string().c_str(), &__sql); + error = sqlite3_open(filename.as_external().c_str(), &__sql); N(!error, (F("could not open database '%s': %s") - % filename.string() - % string(sqlite3_errmsg(__sql)))); + % filename() % string(sqlite3_errmsg(__sql)))); } ======================================================================== --- transforms.cc dad4a47fc6ec586f75803cc81ba3f430e5695ff1 +++ transforms.cc 05437d611e11ac3f6a0cbef9eb352a112c60d401 @@ -538,6 +538,15 @@ utf = out; } +// hack: this is an unexposed function in libidna +extern "C" long g_utf8_strlen(const char * p, size_t max); + +size_t +length(utf8 const & utf) +{ + return g_utf8_strlen(utf().c_str(), utf().size()); +} + // Lots of gunk to avoid charset conversion as much as possible. Running // iconv over every element of every path in a 30,000 file manifest takes // multiple seconds, which then is a minimum bound on pretty much any