#
# patch "ChangeLog"
# from [abe906b2718db8f6656e9cc229aa8309f8a42aa5]
# to [62b8757ad08e503020166c2fc36f3919aabd23b4]
#
# patch "netsync.cc"
# from [b3c340c4ed39777283351959cc5d0068dd60abd4]
# to [eb8b25717752569affa73b4c1fcbc03e33a9f701]
#
========================================================================
--- ChangeLog abe906b2718db8f6656e9cc229aa8309f8a42aa5
+++ ChangeLog 62b8757ad08e503020166c2fc36f3919aabd23b4
@@ -1,3 +1,7 @@
+2005-09-29 Marcel van der Boom
+
+ * netsync.cc (rebuild_merkle_trees): only get matched branch certs, not all of them
+
2005-09-28 Nathaniel Smith
* tests/t_rename_diff_names.at, testsuite.at: New test.
========================================================================
--- netsync.cc b3c340c4ed39777283351959cc5d0068dd60abd4
+++ netsync.cc eb8b25717752569affa73b4c1fcbc03e33a9f701
@@ -3724,27 +3724,25 @@
set revision_ids;
set inserted_keys;
- // bad_branch_certs is a set of cert hashes.
- set< hexenc > bad_branch_certs;
{
- // get all matching branch names
- vector< revision > certs;
- app.db.get_revision_certs(branch_cert_name, certs);
- for (size_t i = 0; i < certs.size(); ++i)
+ // Get our branches
+ vector names;
+ get_branches(app, names);
+ for (size_t i = 0; i < names.size(); ++i)
{
- cert_value name;
- decode_base64(idx(certs, i).inner().value, name);
- if (branchnames.find(name()) != branchnames.end())
+ if(branchnames.find(names[i]) != branchnames.end())
{
- insert_with_parents(revision_id(idx(certs, i).inner().ident),
- revision_ids, app, revisions_ticker);
+ // branch matches, get its certs
+ vector< revision > certs;
+ base64 encoded_name;
+ encode_base64(cert_value(names[i]),encoded_name);
+ app.db.get_revision_certs(branch_cert_name, encoded_name, certs);
+ for (size_t j = 0; j < certs.size(); ++j)
+ {
+ insert_with_parents(revision_id(idx(certs,j).inner().ident),
+ revision_ids, app, revisions_ticker);
+ }
}
- else
- {
- hexenc hash;
- cert_hash_code(idx(certs, i).inner(), hash);
- bad_branch_certs.insert(hash);
- }
}
}
@@ -3781,6 +3779,7 @@
std::pair > > cert_idx;
cert_idx idx;
+ // this also gets *all* certs, needed?
app.db.get_revision_cert_index(idx);
// insert all certs and keys reachable via these revisions,
@@ -3794,8 +3793,6 @@
if (revision_ids.find(ident) == revision_ids.end())
continue;
- if (bad_branch_certs.find(hash) != bad_branch_certs.end())
- continue;
id raw_hash;
decode_hexenc(hash, raw_hash);