Rev 3617: Find a couple more places with incorrect logic, and fix the tests effected. in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/fetch_regression_256757

John Arbash Meinel john at arbash-meinel.com
Mon Aug 18 20:04:34 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/fetch_regression_256757

------------------------------------------------------------
revno: 3617
revision-id: john at arbash-meinel.com-20080818190432-gkn0umj08xln8owu
parent: john at arbash-meinel.com-20080818185537-w3abkc3a29c7828t
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: fetch_regression_256757
timestamp: Mon 2008-08-18 14:04:32 -0500
message:
  Find a couple more places with incorrect logic, and fix the tests effected.
modified:
  bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
-------------- next part --------------
=== modified file 'bzrlib/fetch.py'
--- a/bzrlib/fetch.py	2008-08-18 18:55:37 +0000
+++ b/bzrlib/fetch.py	2008-08-18 19:04:32 +0000
@@ -243,7 +243,7 @@
             to_weave.insert_record_stream(from_weave.get_record_stream(
                 [(rev_id,) for rev_id in revs],
                 self.to_repository._fetch_order,
-                self.to_repository._fetch_uses_deltas))
+                not self.to_repository._fetch_uses_deltas))
         finally:
             child_pb.finished()
 
@@ -264,7 +264,7 @@
         to_rf.insert_record_stream(from_rf.get_record_stream(
             [(rev_id,) for rev_id in version_ids],
             self.to_repository._fetch_order,
-            self.to_repository._fetch_uses_deltas))
+            not self.to_repository._fetch_uses_deltas))
 
     def _generate_root_texts(self, revs):
         """This will be called by __fetch between fetching weave texts and

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2008-07-31 06:26:44 +0000
+++ b/bzrlib/repository.py	2008-08-18 19:04:32 +0000
@@ -691,9 +691,10 @@
         # Additional places to query for data.
         self._fallback_repositories = []
         # What order should fetch operations request streams in?
-        # The default is unsorted as that is the cheapest for an origin to
-        # provide.
-        self._fetch_order = 'unsorted'
+        # The default is topological, because it is the style that is 'most
+        # correct' for targets, even if it is the most expensive for source
+        # formats to generate.
+        self._fetch_order = 'topological'
         # Does this repository use deltas that can be fetched as-deltas ?
         # (E.g. knits, where the knit deltas can be transplanted intact.
         # We default to False, which will ensure that enough data to get

=== modified file 'bzrlib/tests/test_pack_repository.py'
--- a/bzrlib/tests/test_pack_repository.py	2008-08-04 02:54:44 +0000
+++ b/bzrlib/tests/test_pack_repository.py	2008-08-18 19:04:32 +0000
@@ -62,10 +62,14 @@
         return bzrdir.format_registry.make_bzrdir(self.format_name)
 
     def test_attribute__fetch_order(self):
-        """Packs do not need ordered data retrieval."""
+        """Packs do not need ordered data retrieval.
+
+        Except experience shows they need ordered data insertion, so for now,
+        they request topological.
+        """
         format = self.get_format()
         repo = self.make_repository('.', format=format)
-        self.assertEqual('unsorted', repo._fetch_order)
+        self.assertEqual('topological', repo._fetch_order)
 
     def test_attribute__fetch_uses_deltas(self):
         """Packs reuse deltas."""



More information about the bazaar-commits mailing list