# # # add_file "README.encapsulation" # content [c67fabf6f33cb4b8790f4a08d6eed3fc975336c7] # # patch "annotate.cc" # from [a152991b3936bd8b49e9392fd908e882a7c13c4b] # to [7457a87da213a3d65992626f4aa149ec7eff228d] # ============================================================ --- README.encapsulation c67fabf6f33cb4b8790f4a08d6eed3fc975336c7 +++ README.encapsulation c67fabf6f33cb4b8790f4a08d6eed3fc975336c7 @@ -0,0 +1,9 @@ +annotate.cc: + + annotate_context::build_revisions_to_annotations(): + + # Why does this go via the project? It only calls + # db.get_revision_certs()... + app.get_project().get_revision_certs(*i, certs); + + needs: erase_bogus_certs() ============================================================ --- annotate.cc a152991b3936bd8b49e9392fd908e882a7c13c4b +++ annotate.cc 7457a87da213a3d65992626f4aa149ec7eff228d @@ -57,7 +57,7 @@ public: class annotate_context { public: - annotate_context(file_id fid, app_state & app); + annotate_context(file_id fid, database & db); shared_ptr initial_lineage() const; @@ -204,12 +204,12 @@ typedef multi_index_container< > work_units; -annotate_context::annotate_context(file_id fid, app_state & app) +annotate_context::annotate_context(file_id fid, database & db) : annotated_lines_completed(0) { // initialize file_lines file_data fpacked; - app.db.get_file_version(fid, fpacked); + db.get_file_version(fid, fpacked); string encoding = constants::default_encoding; // FIXME split_into_lines(fpacked.inner()(), encoding, file_lines); L(FL("annotate_context::annotate_context initialized " @@ -678,13 +678,13 @@ annotate_lineage_mapping::set_copied_all // fetches the list of file_content markings for the given revision_id and // node_id -static void get_file_content_marks(app_state & app, +static void get_file_content_marks(database & db, revision_id const & rev, node_id const & fid, set & content_marks) { marking_t markings; - app.db.get_markings(rev, fid, markings); + db.get_markings(rev, fid, markings); I(!markings.file_content.empty()); @@ -695,7 +695,7 @@ do_annotate_node(annotate_node_work cons static void do_annotate_node(annotate_node_work const & work_unit, - app_state & app, + database & db, work_units & work_units) { L(FL("do_annotate_node for node %s") % work_unit.revision); @@ -726,7 +726,7 @@ do_annotate_node(annotate_node_work cons else { if (work_unit.marked) - app.db.get_file_content(parent_revision, work_unit.fid, file_in_parent); + db.get_file_content(parent_revision, work_unit.fid, file_in_parent); else // we are not marked, so parent is marked. file_in_parent = work_unit.content; @@ -753,7 +753,7 @@ do_annotate_node(annotate_node_work cons else { file_data data; - app.db.get_file_version(file_in_parent, data); + db.get_file_version(file_in_parent, data); L(FL("building parent lineage for parent file %s") % file_in_parent); parent_lineage @@ -773,7 +773,7 @@ do_annotate_node(annotate_node_work cons { // we are marked, thus we don't know a priori whether parent // is marked or not. - get_file_content_marks(app, parent_revision, work_unit.fid, parents_interesting_ancestors); + get_file_content_marks(db, parent_revision, work_unit.fid, parents_interesting_ancestors); parent_marked = (parents_interesting_ancestors.size() == 1 && *(parents_interesting_ancestors.begin()) == parent_revision); } @@ -782,10 +782,10 @@ do_annotate_node(annotate_node_work cons // if it's marked, we need to look at its parents instead. if (parent_marked) - app.db.get_revision_parents(parent_revision, parents_interesting_ancestors); + db.get_revision_parents(parent_revision, parents_interesting_ancestors); rev_height parent_height; - app.db.get_rev_height(parent_revision, parent_height); + db.get_rev_height(parent_revision, parent_height); annotate_node_work newunit(work_unit.annotations, parent_lineage, parent_revision, @@ -821,7 +821,7 @@ do_annotate (app_state &app, file_t file % file_node->self % file_node->content % rid); shared_ptr - acp(new annotate_context(file_node->content, app)); + acp(new annotate_context(file_node->content, app.db)); shared_ptr lineage = acp->initial_lineage(); @@ -832,7 +832,7 @@ do_annotate (app_state &app, file_t file rev_height height; app.db.get_rev_height(rid, height); set rids_interesting_ancestors; - get_file_content_marks(app, rid, file_node->self, rids_interesting_ancestors); + get_file_content_marks(app.db, rid, file_node->self, rids_interesting_ancestors); bool rid_marked = (rids_interesting_ancestors.size() == 1 && *(rids_interesting_ancestors.begin()) == rid); if (rid_marked) @@ -854,7 +854,7 @@ do_annotate (app_state &app, file_t file annotate_node_work work = *w; work_units.erase(w); - do_annotate_node(work, app, work_units); + do_annotate_node(work, app.db, work_units); } acp->annotate_equivalent_lines();