Rev 3214: Adjust size of batch and change gzip comments to bzip2. in http://people.ubuntu.com/~robertc/baz2.0/get_parents.duplicates

Robert Collins robertc at robertcollins.net
Tue Feb 5 22:42:51 GMT 2008


At http://people.ubuntu.com/~robertc/baz2.0/get_parents.duplicates

------------------------------------------------------------
revno: 3214
revision-id:robertc at robertcollins.net-20080205224247-10d7v6tcsv3nrj2i
parent: robertc at robertcollins.net-20080205220757-p2j8klf0hwhzaim4
committer: Robert Collins <robertc at robertcollins.net>
branch nick: get_parents.duplicates
timestamp: Wed 2008-02-06 09:42:47 +1100
message:
  Adjust size of batch and change gzip comments to bzip2.
modified:
  bzrlib/smart/repository.py     repository.py-20061128022038-vr5wy5bubyb8xttk-1
  bzrlib/tests/test_smart.py     test_smart.py-20061122024551-ol0l0o0oofsu9b3t-2
=== modified file 'bzrlib/smart/repository.py'
--- a/bzrlib/smart/repository.py	2008-02-05 22:07:57 +0000
+++ b/bzrlib/smart/repository.py	2008-02-05 22:42:47 +0000
@@ -109,7 +109,8 @@
 
         :return: A smart server response where the body contains an utf8
             encoded flattened list of the parents of the revisions (the same
-            format as Repository.get_revision_graph) which has been gzipped.
+            format as Repository.get_revision_graph) which has been bz2
+            compressed.
         """
         repository = self._repository
         repository.lock_read()
@@ -154,9 +155,9 @@
                     size_so_far += 2 + len(revision_id) + sum(map(len, parents))
             # get all the directly asked for parents, and then flesh out to
             # 64K (compressed) or so. We do one level of depth at a time to
-            # stay in sync with the client. The 185000 magic number is
+            # stay in sync with the client. The 250000 magic number is
             # estimated compression ratio taken from bzr.dev itself.
-            if first_loop_done and size_so_far > 185000:
+            if first_loop_done and size_so_far > 250000:
                 next_revs = set()
                 break
             # don't query things we've already queried

=== modified file 'bzrlib/tests/test_smart.py'
--- a/bzrlib/tests/test_smart.py	2008-02-05 22:07:57 +0000
+++ b/bzrlib/tests/test_smart.py	2008-02-05 22:42:47 +0000
@@ -532,15 +532,15 @@
 
 class TestSmartServerRepositoryGetParentMap(tests.TestCaseWithTransport):
 
-    def test_trivial_gzipped(self):
-        # This tests that the wire encoding is actually gzipped
+    def test_trivial_bzipped(self):
+        # This tests that the wire encoding is actually bzipped
         backing = self.get_transport()
         request = smart.repository.SmartServerRepositoryGetParentMap(backing)
         tree = self.make_branch_and_memory_tree('.')
 
         self.assertEqual(None,
             request.execute(backing.local_abspath(''), 'missing-id'))
-        # Note that it returns a body (of '' gzipped).
+        # Note that it returns a body (of '' bzipped).
         self.assertEqual(
             SuccessfulSmartServerResponse(('ok', ), bz2.compress('')),
             request.do_body('\n\n0\n'))



More information about the bazaar-commits mailing list