# # # patch "ChangeLog" # from [dfc56304c8a166ca5eaff09cfc4c72338eb409e4] # to [263c3b117d13b1f686352d1e1c32f0d3e0a4e211] # # patch "database.cc" # from [8902f37329f34641312e08a9a466e6b3facc24d0] # to [4e1b8cd93f1705eb61577322de3b0cf540bc6940] # # patch "tests/t_db_kill_rev_locally_2.at" # from [365ee768a810279946fbfa11289512bdd774cb51] # to [296391166304e8c739fcc7968ae5f58a36b91265] # ============================================================ --- ChangeLog dfc56304c8a166ca5eaff09cfc4c72338eb409e4 +++ ChangeLog 263c3b117d13b1f686352d1e1c32f0d3e0a4e211 @@ -1,3 +1,9 @@ +2006-02-20 Matt Johnston + + * database.cc (remove_version): get rid of dangling deltas, + don't try to put data or deltas if they already exist. + * tests/t_db_kill_rev_locally_2.at: un-XFAIL + 2006-02-20 Matthew Gregan * testsuite.at: Add an ADD_FILE variant that allows use of ============================================================ --- database.cc 8902f37329f34641312e08a9a466e6b3facc24d0 +++ database.cc 4e1b8cd93f1705eb61577322de3b0cf540bc6940 @@ -1234,6 +1234,10 @@ } } + // no deltas are allowed to point to the target. + execute(query("DELETE from " + delta_table + " WHERE base = ?") + % text(target_id())); + if (delta_exists(target_id, delta_table)) { if (!older.empty()) @@ -1253,6 +1257,8 @@ for (map, data>::const_iterator i = older.begin(); i != older.end(); ++i) { + if (delta_exists(i->first, delta_table)) + continue; delta bypass_delta; diff(newer_data, i->second, bypass_delta); put_delta(i->first, newer_id, bypass_delta, delta_table); @@ -1267,7 +1273,10 @@ I(exists(target_id, data_table)); for (map, data>::const_iterator i = older.begin(); i != older.end(); ++i) - put(i->first, i->second, data_table); + { + if (!exists(i->first, data_table)) + put(i->first, i->second, data_table); + } execute(query("DELETE from " + data_table + " WHERE id = ?") % text(target_id())); } ============================================================ --- tests/t_db_kill_rev_locally_2.at 365ee768a810279946fbfa11289512bdd774cb51 +++ tests/t_db_kill_rev_locally_2.at 296391166304e8c739fcc7968ae5f58a36b91265 @@ -1,8 +1,6 @@ AT_SETUP([db kill_rev_locally command 2]) MONOTONE_SETUP -AT_XFAIL_IF(true) - # start off with three revisions ADD_FILE(testfile, [blah blah ])