Rev 3620: Fix bug #261339, Always request full texts for Revision texts. in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/bug_261339

John Arbash Meinel john at arbash-meinel.com
Fri Aug 29 03:05:23 BST 2008


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

------------------------------------------------------------
revno: 3620
revision-id: john at arbash-meinel.com-20080829020522-kpkk0zvxf52oj3kh
parent: pqm at pqm.ubuntu.com-20080825143827-fl7cocq59pqdig2p
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: bug_261339
timestamp: Thu 2008-08-28 21:05:22 -0500
message:
  Fix bug #261339, Always request full texts for Revision texts.
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2008-08-25 14:06:14 +0000
+++ b/NEWS	2008-08-29 02:05:22 +0000
@@ -4,6 +4,18 @@
 
 .. contents::
 
+bzr 1.6.1 IN DEVELOPMENT
+------------------------
+
+  BUG FIXES:
+
+    * Revision texts were always meant to be stored as fulltexts. There
+      was a bug in a bzr.dev version that would accidentally create deltas
+      when copying from a Pack repo to a Knit repo. This has been fixed,
+      but to support those repositories, we know always request full texts
+      for Revision texts. (John Arbash Meinel, #261339)
+
+
 bzr 1.6 2008-08-25
 ------------------
 

=== modified file 'bzrlib/fetch.py'
--- a/bzrlib/fetch.py	2008-08-18 22:34:21 +0000
+++ b/bzrlib/fetch.py	2008-08-29 02:05:22 +0000
@@ -255,7 +255,10 @@
         to_sf.insert_record_stream(filter_absent(from_sf.get_record_stream(
             [(rev_id,) for rev_id in revs],
             self.to_repository._fetch_order,
-            not self.to_repository._fetch_uses_deltas)))
+            True)))
+        # Bug #261339, some knit repositories accidentally had deltas in their
+        # revision stream, when you weren't ever supposed to have deltas.
+        # So we now *force* fulltext copying for signatures and revisions
         self._fetch_just_revision_texts(revs)
 
     def _fetch_just_revision_texts(self, version_ids):
@@ -264,7 +267,10 @@
         to_rf.insert_record_stream(from_rf.get_record_stream(
             [(rev_id,) for rev_id in version_ids],
             self.to_repository._fetch_order,
-            not self.to_repository._fetch_uses_deltas))
+            True))
+        # Bug #261339, some knit repositories accidentally had deltas in their
+        # revision stream, when you weren't ever supposed to have deltas.
+        # So we now *force* fulltext copying for signatures and revisions
 
     def _generate_root_texts(self, revs):
         """This will be called by __fetch between fetching weave texts and
@@ -380,6 +386,8 @@
                                       parents)
 
     def fetch_revisions(self, revision_ids):
+        # TODO: should this batch them up rather than requesting 10,000
+        #       revisions at once?
         for revision in self.source.get_revisions(revision_ids):
             self.target.add_revision(revision.revision_id, revision)
 

=== modified file 'bzrlib/tests/test_fetch.py'
--- a/bzrlib/tests/test_fetch.py	2008-08-18 22:34:21 +0000
+++ b/bzrlib/tests/test_fetch.py	2008-08-29 02:05:22 +0000
@@ -374,8 +374,12 @@
         self.assertEqual(('get_record_stream', [('rev-one',)],
                           target._fetch_order, False),
                          self.find_get_record_stream(source.inventories.calls))
+        # Because of bugs in the old fetch code, revisions could accidentally
+        # have deltas present in knits. However, it was never intended, so we
+        # always for include_delta_closure=True, to make sure we get fulltexts.
+        # bug #261339
         self.assertEqual(('get_record_stream', [('rev-one',)],
-                          target._fetch_order, False),
+                          target._fetch_order, True),
                          self.find_get_record_stream(source.revisions.calls))
         # XXX: Signatures is special, and slightly broken. The
         # standard item_keys_introduced_by actually does a lookup for every
@@ -386,7 +390,7 @@
         # we care about.
         signature_calls = source.signatures.calls[-1:]
         self.assertEqual(('get_record_stream', [('rev-one',)],
-                          target._fetch_order, False),
+                          target._fetch_order, True),
                          self.find_get_record_stream(signature_calls))
 
     def test_fetch_no_deltas_with_delta_closure(self):



More information about the bazaar-commits mailing list