Rev 3785: (jam) Re-enable the fast-path for annotate, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Oct 17 23:36:09 BST 2008


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

------------------------------------------------------------
revno: 3785
revision-id: pqm at pqm.ubuntu.com-20081017223605-ais9run1hp476y1c
parent: pqm at pqm.ubuntu.com-20081017220336-a1m0npnjf9ojnfbj
parent: john at arbash-meinel.com-20081017195853-i31d3g7sur1prgvi
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2008-10-17 23:36:05 +0100
message:
  (jam) Re-enable the fast-path for annotate,
  	and allow it to work with non-lh compression parents.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
    ------------------------------------------------------------
    revno: 3777.4.2
    revision-id: john at arbash-meinel.com-20081017195853-i31d3g7sur1prgvi
    parent: john at arbash-meinel.com-20081017161420-q7au1ngfvf2rwb4j
    parent: pqm at pqm.ubuntu.com-20081017125551-l5zi213vopny82nt
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: annotate_cleanups
    timestamp: Fri 2008-10-17 14:58:53 -0500
    message:
      Merge bzr.dev 3783, resolve NEWS
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
      bzrlib/patches.py              patches.py-20050727183609-378c1cc5972ce908
      bzrlib/plugins/launchpad/account.py account.py-20071011033320-50y6vfftywf4yllw-1
      bzrlib/plugins/launchpad/test_account.py test_account.py-20071011033320-50y6vfftywf4yllw-2
      bzrlib/plugins/launchpad/test_lp_directory.py test_lp_indirect.py-20070126002743-oyle362tzv9cd8mi-1
      bzrlib/tests/test_branch.py    test_branch.py-20060116013032-97819aa07b8ab3b5
      bzrlib/tests/test_config.py    testconfig.py-20051011041908-742d0c15d8d8c8eb
      bzrlib/tests/test_patches.py   test_patches.py-20051231203844-f4974d20f6aea09c
      bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
      bzrlib/tests/test_sftp_transport.py testsftp.py-20051027032739-247570325fec7e7e
      bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
      bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
      bzrlib/transport/ftp/__init__.py ftp.py-20051116161804-58dc9506548c2a53
      bzrlib/transport/remote.py     ssh.py-20060608202016-c25gvf1ob7ypbus6-1
      bzrlib/transport/sftp.py       sftp.py-20051019050329-ab48ce71b7e32dfe
      bzrlib/transport/ssh.py        ssh.py-20060824042150-0s9787kng6zv1nwq-1
      doc/developers/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
      setup.py                       setup.py-20050314065409-02f8a0a6e3f9bc70
    ------------------------------------------------------------
    revno: 3777.4.1
    revision-id: john at arbash-meinel.com-20081017161420-q7au1ngfvf2rwb4j
    parent: pqm at pqm.ubuntu.com-20081014031836-0pn8u98igc7gvtv0
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: annotate_cleanups
    timestamp: Fri 2008-10-17 11:14:20 -0500
    message:
      Two fixes for annotate code.
      
      Restore the fast path when a branch is not stacked.
      Handle when compression_parent is not the left-hand parent.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
=== modified file 'NEWS'
--- a/NEWS	2008-10-17 14:25:11 +0000
+++ b/NEWS	2008-10-17 22:36:05 +0000
@@ -37,6 +37,13 @@
       memory before writing it to disk. This was a little bit faster, but
       consumed lots of memory. (John Arbash Meinel, #269456)
 
+    * Fixes to the ``annotate`` code. The fast-path which re-used the
+      stored deltas was accidentally disabled all the time, instead of
+      only when a branch was stacked. Second, the code would accidentally
+      re-use a delta even if it wasn't against the left-parent, this
+      could only happen if ``bzr reconcile`` decided that the parent
+      ordering was incorrect in the file graph.  (John Arbash Meinel)
+
   DOCUMENTATION:
 
   API CHANGES:

=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py	2008-10-03 16:14:39 +0000
+++ b/bzrlib/knit.py	2008-10-17 16:14:20 +0000
@@ -2668,6 +2668,7 @@
                 (rev_id, parent_ids, record) = nodes_to_annotate.pop()
                 (index_memo, compression_parent, parents,
                  record_details) = self._all_build_details[rev_id]
+                blocks = None
                 if compression_parent is not None:
                     comp_children = self._compression_children[compression_parent]
                     if rev_id not in comp_children:
@@ -2694,14 +2695,16 @@
                         copy_base_content=(not reuse_content))
                     fulltext = self._add_fulltext_content(rev_id,
                                                           fulltext_content)
-                    blocks = KnitContent.get_line_delta_blocks(delta,
-                            parent_fulltext, fulltext)
+                    if compression_parent == parent_ids[0]:
+                        # the compression_parent is the left parent, so we can
+                        # re-use the delta
+                        blocks = KnitContent.get_line_delta_blocks(delta,
+                                parent_fulltext, fulltext)
                 else:
                     fulltext_content = self._knit._factory.parse_fulltext(
                         record, rev_id)
                     fulltext = self._add_fulltext_content(rev_id,
                         fulltext_content)
-                    blocks = None
                 nodes_to_annotate.extend(
                     self._add_annotation(rev_id, fulltext, parent_ids,
                                      left_matching_blocks=blocks))
@@ -2722,7 +2725,7 @@
 
         :param key: The key to annotate.
         """
-        if True or len(self._knit._fallback_vfs) > 0:
+        if len(self._knit._fallback_vfs) > 0:
             # stacked knits can't use the fast path at present.
             return self._simple_annotate(key)
         records = self._get_build_graph(key)




More information about the bazaar-commits mailing list