#
#
# patch "ChangeLog"
# from [5d9e0acf1f11effa5a3ac2f85b5c78c13f8bd0c8]
# to [a49da6c846f0588ab2f9a672118f2b2d30825544]
#
# patch "contrib/color-logs.sh"
# from [4e04daeee4ee8ce8bf6ce45f074ba16faf50ccf9]
# to [20148e22f20bf0249432a69990add9b054016b78]
#
# patch "enumerator.cc"
# from [9cd3afa7ef779cb7b0c53a053a9567b57b59f660]
# to [43edc729be97fabc35880f79fbea7640d109bea0]
#
# patch "enumerator.hh"
# from [6e6ecbf59d43a8e4bf4de07008a8795bd18cd960]
# to [4f3ce29808f2bf2c0f65701e64ae379e369ab9fb]
#
# patch "netsync.cc"
# from [838ea8e645fbc5694a6ac0e81ee0e5c8dde36ede]
# to [9e577332850f154ed42b8a3104b57d0c1406f788]
#
# patch "refiner.hh"
# from [9f724877248fc986aed3c2de8fa39d5a27f934d1]
# to [785a738e8476f63f8f8b0c5ecfee085dbd764ade]
#
============================================================
--- ChangeLog 5d9e0acf1f11effa5a3ac2f85b5c78c13f8bd0c8
+++ ChangeLog a49da6c846f0588ab2f9a672118f2b2d30825544
@@ -1,3 +1,10 @@
+2006-04-28 Graydon Hoare
+
+ * contrib/color-logs.sh: Update to 'mtn'.
+ * enumerator.{cc,hh}: Expose parent map, cache certs.
+ * netsync.cc: Use caches in enumerator and refiners.
+ * refiner.hh (local_item_exists): New helper.
+
2006-04-28 Matthew Gregan
* database.cc (query::query): Allow query to be constructed
============================================================
--- contrib/color-logs.sh 4e04daeee4ee8ce8bf6ce45f074ba16faf50ccf9
+++ contrib/color-logs.sh 20148e22f20bf0249432a69990add9b054016b78
@@ -1,5 +1,5 @@
#!/bin/sh
-./monotone log --diffs --no-merges $@ \
+./mtn log --diffs --no-merges $@ \
| ./contrib/colorize -c contrib/color-logs.conf \
| less -r -p -----------------------------------------------------------------
============================================================
--- enumerator.cc 9cd3afa7ef779cb7b0c53a053a9567b57b59f660
+++ enumerator.cc 43edc729be97fabc35880f79fbea7640d109bea0
@@ -53,6 +53,23 @@
}
}
+void
+revision_enumerator::get_revision_parents(revision_id const & child,
+ vector & parents)
+{
+ parents.clear();
+ typedef multimap::const_iterator ci;
+ pair range = inverse_graph.equal_range(child);
+ for (ci i = range.first; i != range.second; ++i)
+ {
+ if (i->first == child)
+ {
+ parents.push_back(i->second);
+ }
+ }
+}
+
+
bool
revision_enumerator::all_parents_enumerated(revision_id const & child)
{
@@ -158,7 +175,35 @@
}
}
+void
+revision_enumerator::note_cert(revision_id const & rid,
+ hexenc const & cert_hash)
+{
+ revision_certs.insert(std::make_pair(rid, cert_hash));
+}
+
+
void
+revision_enumerator::get_revision_certs(revision_id const & rid,
+ std::vector > & hashes)
+{
+ hashes.clear();
+ bool found_one = false;
+ typedef multimap >::const_iterator ci;
+ pair range = revision_certs.equal_range(rid);
+ for (ci i = range.first; i != range.second; ++i)
+ {
+ found_one = true;
+ if (i->first == rid)
+ hashes.push_back(i->second);
+ }
+ if (!found_one)
+ {
+ app.db.get_revision_certs(rid, hashes);
+ }
+}
+
+void
revision_enumerator::step()
{
while (!done())
@@ -185,9 +230,12 @@
pair range = graph.equal_range(r);
for (ci i = range.first; i != range.second; ++i)
{
+ // We push_front here rather than push_back in order
+ // to improve database cache performance. It avoids
+ // skipping back and forth beween parallel lineages.
if (i->first == r)
if (enumerated_nodes.find(i->first) == enumerated_nodes.end())
- revs.push_back(i->second);
+ revs.push_front(i->second);
}
}
@@ -244,7 +292,7 @@
// Queue up some or all of the rev's certs
vector > hashes;
- app.db.get_revision_certs(r, hashes);
+ get_revision_certs(r, hashes);
for (vector >::const_iterator i = hashes.begin();
i != hashes.end(); ++i)
{
============================================================
--- enumerator.hh 6e6ecbf59d43a8e4bf4de07008a8795bd18cd960
+++ enumerator.hh 4f3ce29808f2bf2c0f65701e64ae379e369ab9fb
@@ -9,6 +9,7 @@
#include
#include