# # # patch "database.cc" # from [b11145acb7526d8879fa4789df0c08a9cc81e55e] # to [be08533085302ee988bac5508aec2f28d90992ae] # ============================================================ --- database.cc b11145acb7526d8879fa4789df0c08a9cc81e55e +++ database.cc be08533085302ee988bac5508aec2f28d90992ae @@ -180,7 +180,7 @@ namespace pair, shared_ptr > > verifier_cache; - + } // anonymous namespace class database_impl @@ -278,7 +278,7 @@ private: // "do we have any entry for 'ident' that is a base version" bool roster_base_stored(revision_id const & ident); bool roster_base_available(revision_id const & ident); - + // "do we have any entry for 'ident' that is a delta" bool delta_exists(file_id const & ident, file_id const & base, @@ -358,10 +358,10 @@ private: void put_cert(cert const & t, string const & table); void results_to_certs(results const & res, vector & certs); - + void get_certs(vector & certs, string const & table); - + void get_certs(id const & ident, vector & certs, string const & table); @@ -471,8 +471,8 @@ database_impl::check_format() bool have_rosters = !res.empty(); fetch(res, one_col, any_rows, query("SELECT 1 FROM heights LIMIT 1")); bool have_heights = !res.empty(); - + if (!have_manifests) { // Must have been changesetified and rosterified already. @@ -1342,7 +1342,7 @@ database_impl::count(string const & tabl { return format_sqlite_error_for_info(e); } - + } string @@ -1694,12 +1694,12 @@ public: public: markings_extractor(node_id const & _nid, marking_t & _markings) : nid(_nid), markings(_markings) {} ; - + bool look_at_delta(roster_delta const & del) { return try_get_markings_from_roster_delta(del, nid, markings); } - + void look_at_roster(roster_t const & roster, marking_map const & mm) { marking_map::const_iterator mmi = @@ -1747,7 +1747,7 @@ database_impl::extract_from_deltas(revis // cases we are looking at the parent of a (content-)marked node, thus // the information we are for is right there in the delta leading to // this node. - // + // // recording the deltas visited here in a set as to avoid inspecting // them later seems to be of little value, as it imposes a cost here, // but can seldom be exploited. @@ -1990,7 +1990,7 @@ database::put_file_version(file_id const W(F("dropping delta '%s' -> '%s'") % old_id % new_id); return; } - + get_file_version(old_id, old_data); { data tmp; @@ -2009,8 +2009,8 @@ database::put_file_version(file_id const // the reconstruction and comparing hashes. I(old_tmp == old_data.inner()); } - - transaction_guard guard(*this); + + transaction_guard guard(*this); if (file_or_manifest_base_exists(old_id, "files")) { // descendent of a head version replaces the head, therefore old head @@ -2022,7 +2022,7 @@ database::put_file_version(file_id const imp->schedule_delayed_file(new_id, new_data); imp->drop(new_id.inner(), "file_deltas"); } - + if (!imp->delta_exists(old_id, new_id, "file_deltas")) { put_file_delta(old_id, new_id, reverse_delta); @@ -2085,7 +2085,7 @@ database::get_revision_ancestry(rev_ance { // share some storage id::symtab id_syms; - + results res; graph.clear(); imp->fetch(res, 2, any_rows, @@ -2227,9 +2227,9 @@ database::put_rev_height(revision_id con I(!null_id(id)); I(revision_exists(id)); I(height.valid()); - + imp->height_cache.erase(id); - + imp->execute(query("INSERT INTO heights VALUES(?, ?)") % blob(id.inner()()) % blob(height())); @@ -2412,7 +2412,7 @@ database::put_height_for_revision(revisi revision_t const & rev) { I(!null_id(new_id)); - + rev_height highest_parent; // we always branch off the highest parent ... for (edge_map::const_iterator e = rev.edges.begin(); @@ -2425,7 +2425,7 @@ database::put_height_for_revision(revisi highest_parent = parent; } } - + // ... then find the first unused child u32 childnr(0); rev_height candidate; MM(candidate); @@ -2962,7 +2962,7 @@ database::get_revision_cert_nobranch_ind { // share some storage id::symtab id_syms; - + results res; imp->fetch(res, 3, any_rows, query("SELECT hash, id, keypair " @@ -3576,7 +3576,7 @@ struct rev_height_graph : rev_graph { db.get_rev_height(rev, h); } - + database & db; }; @@ -3586,7 +3586,7 @@ database::get_uncommon_ancestors(revisio set & a_uncommon_ancs, set & b_uncommon_ancs) { - + rev_height_graph graph(*this); ::get_uncommon_ancestors(a, b, graph, a_uncommon_ancs, b_uncommon_ancs); } @@ -3746,7 +3746,7 @@ conditional_transaction_guard::maybe_che void conditional_transaction_guard::maybe_checkpoint(size_t nbytes) { - I(acquired); + I(acquired); checkpointed_calls += 1; checkpointed_bytes += nbytes; if (checkpointed_calls >= checkpoint_batch_size