# # patch "ChangeLog" # from [08e72ca210a1b334aaa755a73e4d255e47565595] # to [2878a9a4b1ecf724569bb7131d94e625ae7a9c5b] # # patch "revision.cc" # from [13996ebe916bb2aeb7ef397ba07f72f96c055a2f] # to [d4fc7c1039848a75f8ff08a7e1fdabf5425abf6e] # ======================================================================== --- ChangeLog 08e72ca210a1b334aaa755a73e4d255e47565595 +++ ChangeLog 2878a9a4b1ecf724569bb7131d94e625ae7a9c5b @@ -1,3 +1,8 @@ +2005-10-10 Nathaniel Smith + + * revision.cc (fixup_non_normalized_manifest): Fixes to this kluge, + from Nuno Lucas. Seems to actually work now. + 2005-10-08 Nathaniel Smith * revision.cc (fixup_non_normalized_manifest): Add some klugey ======================================================================== --- revision.cc 13996ebe916bb2aeb7ef397ba07f72f96c055a2f +++ revision.cc d4fc7c1039848a75f8ff08a7e1fdabf5425abf6e @@ -20,6 +20,7 @@ #include #include #include +#include #include "botan/botan.h" @@ -1393,12 +1394,12 @@ { read_manifest_map(mdat, mm); } - catch (invariant_failure) + catch (std::logic_error) { - // this manifest is bad, we need to fix it up. - // our normal parser will refuse to work, so parse it by hand, and use - // boost normalization code to fix up paths - // this code is basically copied from read_manifest_map in manifest.cc. + // this manifest is bad, we need to fix it up. + // our normal parser will refuse to work, so parse it by hand, and use + // boost normalization code to fix up paths + // this code is basically copied from read_manifest_map in manifest.cc. std::string::size_type pos = 0; while (pos != mdat.inner()().size()) { @@ -1408,7 +1409,7 @@ // everything until next \n is filename. std::string ident = mdat.inner()().substr(pos, constants::idlen); std::string::size_type file_name_begin = pos + constants::idlen + 2; - pos = dat().find('\n', file_name_begin); + pos = mdat.inner()().find('\n', file_name_begin); std::string file_name; if (pos == std::string::npos) file_name = mdat.inner()().substr(file_name_begin); @@ -1425,9 +1426,10 @@ write_manifest_map(mm, mdat); // store the new manifest (not bothering with clever delta storage // stuff) - app.db.put_manifest_version(mdat); // overwrite the caller's manifest id with the new, corrected one calculate_ident(mdat, mid); + if (!app.db.manifest_version_exists(mid)) + app.db.put_manifest(mid, mdat); } } @@ -1443,7 +1445,7 @@ manifest_id man; app.db.get_revision_manifest(rev, man); - fixup_non_normalized_manifest(man); + fixup_non_normalized_manifest(man, app); L(F("node %d = revision %s = manifest %s\n") % node % rev % man); old_rev_to_node.insert(std::make_pair(rev, node));