Rev 5569: (spiv) Remove redundant parent inventories calculation during fetch. (Andrew in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Dec 14 23:00:54 GMT 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5569 [merge]
revision-id: pqm at pqm.ubuntu.com-20101214230051-srsbr9s5e3karbr5
parent: pqm at pqm.ubuntu.com-20101214172357-zkr4giq14bvd27v2
parent: andrew.bennetts at canonical.com-20101214093353-b51uc9mjts43741c
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2010-12-14 23:00:51 +0000
message:
  (spiv) Remove redundant parent inventories calculation during fetch. (Andrew
   Bennetts)
modified:
  bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
  bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
  doc/en/release-notes/bzr-2.3.txt NEWS-20050323055033-4e00b5db738777ff
  doc/en/whats-new/whats-new-in-2.3.txt whatsnewin2.3.txt-20100818072501-x2h25r7jbnknvy30-1
=== modified file 'bzrlib/fetch.py'
--- a/bzrlib/fetch.py	2010-09-17 04:35:23 +0000
+++ b/bzrlib/fetch.py	2010-12-14 09:21:14 +0000
@@ -125,9 +125,6 @@
             pb.update("Inserting stream")
             resume_tokens, missing_keys = self.sink.insert_stream(
                 stream, from_format, [])
-            if self.to_repository._fallback_repositories:
-                missing_keys.update(
-                    self._parent_inventories(search.get_keys()))
             if missing_keys:
                 pb.update("Missing keys")
                 stream = source.get_stream_for_missing_keys(missing_keys)
@@ -163,18 +160,6 @@
             self.from_repository, self._last_revision,
             find_ghosts=self.find_ghosts)
 
-    def _parent_inventories(self, revision_ids):
-        # Find all the parent revisions referenced by the stream, but
-        # not present in the stream, and make sure we send their
-        # inventories.
-        parent_maps = self.to_repository.get_parent_map(revision_ids)
-        parents = set()
-        map(parents.update, parent_maps.itervalues())
-        parents.discard(NULL_REVISION)
-        parents.difference_update(revision_ids)
-        missing_keys = set(('inventories', rev_id) for rev_id in parents)
-        return missing_keys
-
 
 class Inter1and2Helper(object):
     """Helper for operations that convert data from model 1 and 2

=== modified file 'bzrlib/tests/blackbox/test_push.py'
--- a/bzrlib/tests/blackbox/test_push.py	2010-12-09 04:26:53 +0000
+++ b/bzrlib/tests/blackbox/test_push.py	2010-12-14 09:21:14 +0000
@@ -231,7 +231,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(14, self.hpss_calls)
+        self.assertLength(13, self.hpss_calls)
         remote = branch.Branch.open('public')
         self.assertEndsWith(remote.get_stacked_on_url(), '/parent')
 

=== modified file 'doc/en/release-notes/bzr-2.3.txt'
--- a/doc/en/release-notes/bzr-2.3.txt	2010-12-09 15:04:24 +0000
+++ b/doc/en/release-notes/bzr-2.3.txt	2010-12-14 23:00:51 +0000
@@ -26,6 +26,11 @@
 .. Improvements to existing commands, especially improved performance 
    or memory usage, or better results.
 
+* A redundant parent inventories calculation was removed from
+  ``fetch.py``, as ``Repository.insert_stream`` already reports any
+  missing inventories.  This removes at least one network roundtrip when
+  pushing to a stacked branch.  (Andrew Bennetts)
+
 * ``bzr resolve`` now accepts ``--take-this`` and ``--take-other`` actions
   for text conflicts. This *replace* the whole file with the content
   designated by the action. This will *ignore* all differences that would

=== modified file 'doc/en/whats-new/whats-new-in-2.3.txt'
--- a/doc/en/whats-new/whats-new-in-2.3.txt	2010-12-03 07:51:28 +0000
+++ b/doc/en/whats-new/whats-new-in-2.3.txt	2010-12-14 09:33:53 +0000
@@ -69,6 +69,9 @@
 * ``bzr send`` uses less memory.
   (John Arbash Meinel, #614576)
 
+* Fetches involving stacked branches and branches with tags are now faster.
+  Some redundant network reads were removed.  (Andrew Bennetts)
+
 * Inventory entries now consume less memory (on 32-bit Ubuntu file entries
   have dropped from 68 bytes to 40, and directory entries from 120 bytes
   to 48).  This affects most operations, and depending on the size of the




More information about the bazaar-commits mailing list