Rev 4312: Remove too-early checks for revisions adding unnecessary round trips, at the cost of actually reading revision data when pulling (because we currently don't have a hint as about whats local for fetch). in http://people.ubuntu.com/~robertc/baz2.0/pending/push.roundtrips

Robert Collins robertc at robertcollins.net
Wed Apr 29 05:14:42 BST 2009


At http://people.ubuntu.com/~robertc/baz2.0/pending/push.roundtrips

------------------------------------------------------------
revno: 4312
revision-id: robertc at robertcollins.net-20090429041426-91s1jby1uq6mac1l
parent: robertc at robertcollins.net-20090428065329-vx84wza4w6l979ai
committer: Robert Collins <robertc at robertcollins.net>
branch nick: push.roundtrips
timestamp: Wed 2009-04-29 14:14:26 +1000
message:
  Remove too-early checks for revisions adding unnecessary round trips, at the cost of actually reading revision data when pulling (because we currently don't have a hint as about whats local for fetch).
=== modified file 'bzrlib/fetch.py'
--- a/bzrlib/fetch.py	2009-04-27 23:14:00 +0000
+++ b/bzrlib/fetch.py	2009-04-29 04:14:26 +0000
@@ -170,9 +170,6 @@
         if self._last_revision is NULL_REVISION:
             # explicit limit of no revisions needed
             return None
-        if (self._last_revision is not None and
-            self.to_repository.has_revision(self._last_revision)):
-            return None
         try:
             return self.to_repository.search_missing_revision_ids(
                 self.from_repository, self._last_revision,

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2009-04-27 23:14:00 +0000
+++ b/bzrlib/repository.py	2009-04-29 04:14:26 +0000
@@ -3092,13 +3092,6 @@
         """
         target_graph = self.target.get_graph()
         revision_ids = frozenset(revision_ids)
-        # Fast path for the case where all the revisions are already in the
-        # target repo.
-        # (Although this does incur an extra round trip for the
-        # fairly common case where the target doesn't already have the revision
-        # we're pushing.)
-        if set(target_graph.get_parent_map(revision_ids)) == revision_ids:
-            return graph.SearchResult(revision_ids, set(), 0, set())
         missing_revs = set()
         source_graph = self.source.get_graph()
         # ensure we don't pay silly lookup costs.

=== modified file 'bzrlib/tests/blackbox/test_push.py'
--- a/bzrlib/tests/blackbox/test_push.py	2009-04-28 06:53:29 +0000
+++ b/bzrlib/tests/blackbox/test_push.py	2009-04-29 04:14:26 +0000
@@ -217,7 +217,7 @@
         # being too low. If rpc_count increases, more network roundtrips have
         # become necessary for this use case. Please do not adjust this number
         # upwards without agreement from bzr's network support maintainers.
-        self.assertLength(15, self.hpss_calls)
+        self.assertLength(14, self.hpss_calls)
         remote = Branch.open('public')
         self.assertEndsWith(remote.get_stacked_on_url(), '/parent')
 

=== modified file 'bzrlib/tests/test_fetch.py'
--- a/bzrlib/tests/test_fetch.py	2009-04-01 15:49:55 +0000
+++ b/bzrlib/tests/test_fetch.py	2009-04-29 04:14:26 +0000
@@ -321,11 +321,13 @@
         self.assertEqual(1, self._count_log_matches('branch/format', http_logs))
         self.assertEqual(1, self._count_log_matches('repository/format',
             http_logs))
+        self.assertEqual(1, self._count_log_matches('revisions.kndx',
+            http_logs))
         self.assertTrue(1 >= self._count_log_matches('revision-history',
                                                      http_logs))
         self.assertTrue(1 >= self._count_log_matches('last-revision',
                                                      http_logs))
-        self.assertEqual(4, len(http_logs))
+        self.assertLength(5, http_logs)
 
 
 class TestKnitToPackFetch(TestCaseWithTransport):




More information about the bazaar-commits mailing list