Rev 5848: Bug #780677, use a RevisionTree for pull in http://bazaar.launchpad.net/~jameinel/bzr/2.4-pull-iter-changes-780677

John Arbash Meinel john at arbash-meinel.com
Tue May 10 18:50:02 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/2.4-pull-iter-changes-780677

------------------------------------------------------------
revno: 5848
revision-id: john at arbash-meinel.com-20110510184954-d9av3zsklvnc7ofk
parent: pqm at pqm.ubuntu.com-20110510102823-vf4qlngmjhgg6538
fixes bug(s): https://launchpad.net/bugs/780677
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.4-pull-iter-changes-780677
timestamp: Tue 2011-05-10 20:49:54 +0200
message:
  Bug #780677, use a RevisionTree for pull
  if Repository._format.fast_deltas is true.
  This allows the Merge code to use the fast-CHK<=>CHK iter_changes instead
  of the generic whole-tree iter_changes. We retain the old capability
  when fast_deltas is not true, since otherwise extracting the old inventory
  from the repository would be slow.
-------------- next part --------------
=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2011-05-10 09:30:33 +0000
+++ b/bzrlib/workingtree.py	2011-05-10 18:49:54 +0000
@@ -1032,6 +1032,9 @@
             new_revision_info = self.branch.last_revision_info()
             if new_revision_info != old_revision_info:
                 repository = self.branch.repository
+                if repository._format.fast_deltas:
+                    basis_id = self.get_parent_ids()[0]
+                    basis_tree = repository.revision_tree(basis_id)
                 basis_tree.lock_read()
                 try:
                     new_basis_tree = self.branch.basis_tree()

=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt	2011-05-10 09:34:35 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt	2011-05-10 18:49:54 +0000
@@ -30,6 +30,14 @@
   more efficiently.  For a simple branch it reduces the number of
   round-trips by about 20%.  (Andrew Bennetts)
 
+* ``bzr pull`` now properly triggers the fast
+  ``CHKInventory.iter_changes`` rather than the slow generic
+  inter-Inventory changes. It used to use a ``DirStateRevisionTree`` as
+  one of the source trees, which is faster when we have to read the whole
+  inventory anyway, but much slower when we can get just the delta out of
+  the repository. On a 70k record tree, this changes ``bzr pull`` from 28s
+  down to 17s. (John Arbash Meinel, #780677)
+
 * Slightly reduced memory consumption when fetching into a 2a repository
   by reusing existing caching a little better.  (Andrew Bennetts)
 

=== modified file 'doc/en/whats-new/whats-new-in-2.4.txt'
--- a/doc/en/whats-new/whats-new-in-2.4.txt	2011-05-10 09:34:35 +0000
+++ b/doc/en/whats-new/whats-new-in-2.4.txt	2011-05-10 18:49:54 +0000
@@ -63,11 +63,12 @@
 trees. A possibly incomplete list is as follows for running commands on a
 70k file tree::
 
-    bzr-2.3 bzr-2.4 action
-    3m39s   1m03s   bzr co --lightweight
-      38s      6s   bzr revert
-    4m47s     27s   bzr merge
-    4m58s     32s   bzr up
+    bzr-2.3.1 bzr-2.3.2 bzr-2.4 action
+    3m39s                 1m03s   bzr co --lightweight
+      38s                    6s   bzr revert
+    4m47s                   27s   bzr merge
+    4m45s           29s     17s   bzr pull
+    4m58s                   32s   bzr up
     
 
 Faster stacked branches



More information about the bazaar-commits mailing list