Rev 2731: Merge -Devil checking patch. in http://people.ubuntu.com/~robertc/baz2.0/repository

Robert Collins robertc at robertcollins.net
Fri Aug 24 02:35:36 BST 2007


At http://people.ubuntu.com/~robertc/baz2.0/repository

------------------------------------------------------------
revno: 2731
revision-id: robertc at robertcollins.net-20070824013533-d2gx1702ipr8rct9
parent: robertc at robertcollins.net-20070824000553-zt52bftmpw60ylv4
parent: robertc at robertcollins.net-20070823213656-055xdmkyesohby3u
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Fri 2007-08-24 11:35:33 +1000
message:
  Merge -Devil checking patch.
modified:
  bzrlib/index.py                index.py-20070712131115-lolkarso50vjr64s-1
  bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
    ------------------------------------------------------------
    revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.75
    revision-id: robertc at robertcollins.net-20070823213656-055xdmkyesohby3u
    parent: pqm at pqm.ubuntu.com-20070823005013-ada9x55rc31yiwou
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: devil
    timestamp: Fri 2007-08-24 07:36:56 +1000
    message:
      Add a number of -Devil checkpoints.
    modified:
      bzrlib/index.py                index.py-20070712131115-lolkarso50vjr64s-1
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
=== modified file 'bzrlib/index.py'
--- a/bzrlib/index.py	2007-08-22 06:23:52 +0000
+++ b/bzrlib/index.py	2007-08-24 01:35:33 +0000
@@ -29,7 +29,7 @@
 
 from bzrlib.lazy_import import lazy_import
 lazy_import(globals(), """
-from bzrlib.trace import mutter
+from bzrlib.trace import mutter, mutter_callsite
 """)
 from bzrlib import debug, errors
 
@@ -322,6 +322,8 @@
             There is no defined order for the result iteration - it will be in
             the most efficient order for the index.
         """
+        if 'evil' in debug.debug_flags:
+            mutter_callsite(2, "iter_all_entries scales with size of history.")
         if self._nodes is None:
             self._buffer_all()
         if self.node_ref_lists:
@@ -610,6 +612,8 @@
             defined order for the result iteration - it will be in the most
             efficient order for the index (in this case dictionary hash order).
         """
+        if 'evil' in debug.debug_flags:
+            mutter_callsite(2, "iter_all_entries scales with size of history.")
         if self.reference_lists:
             for key, (absent, references, value) in self._nodes.iteritems():
                 if not absent:

=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py	2007-08-22 06:23:52 +0000
+++ b/bzrlib/knit.py	2007-08-24 01:35:33 +0000
@@ -75,9 +75,11 @@
 from bzrlib import (
     pack,
     )
+from bzrlib.trace import mutter_callsite
 """)
 from bzrlib import (
     cache_utf8,
+    debug,
     diff,
     errors,
     osutils,
@@ -631,10 +633,14 @@
 
     def versions(self):
         """See VersionedFile.versions."""
+        if 'evil' in debug.debug_flags:
+            mutter_callsite(2, "versions scales with size of history")
         return self._index.get_versions()
 
     def has_version(self, version_id):
         """See VersionedFile.has_version."""
+        if 'evil' in debug.debug_flags:
+            mutter_callsite(2, "has_version is a LBYL scenario")
         version_id = osutils.safe_revision_id(version_id)
         return self._index.has_version(version_id)
 

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2007-08-23 21:56:32 +0000
+++ b/bzrlib/repository.py	2007-08-24 01:35:33 +0000
@@ -24,6 +24,7 @@
 from bzrlib import (
     bzrdir,
     check,
+    debug,
     deprecated_graph,
     errors,
     generate_ids,
@@ -45,7 +46,6 @@
 from bzrlib.store.versioned import VersionedFileStore
 from bzrlib.store.text import TextStore
 from bzrlib.testament import Testament
-
 """)
 
 from bzrlib.decorators import needs_read_lock, needs_write_lock
@@ -54,7 +54,7 @@
 from bzrlib.symbol_versioning import (
         deprecated_method,
         )
-from bzrlib.trace import mutter, note, warning
+from bzrlib.trace import mutter, mutter_callsite, note, warning
 
 
 # Old formats display a warning, but only once
@@ -547,6 +547,8 @@
     @needs_read_lock
     def has_revision(self, revision_id):
         """True if this repository has a copy of the revision."""
+        if 'evil' in debug.debug_flags:
+            mutter_callsite(2, "has_revision is a LBYL symptom.")
         revision_id = osutils.safe_revision_id(revision_id)
         return self._revision_store.has_revision_id(revision_id,
                                                     self.get_transaction())
@@ -872,6 +874,9 @@
         operation and will be removed in the future.
         :return: a dictionary of revision_id->revision_parents_list.
         """
+        if 'evil' in debug.debug_flags:
+            mutter_callsite(2,
+                "get_revision_graph scales with size of history.")
         # special case NULL_REVISION
         if revision_id == _mod_revision.NULL_REVISION:
             return {}
@@ -904,6 +909,9 @@
         :param revision_ids: an iterable of revisions to graph or None for all.
         :return: a Graph object with the graph reachable from revision_ids.
         """
+        if 'evil' in debug.debug_flags:
+            mutter_callsite(2,
+                "get_revision_graph_with_ghosts scales with size of history.")
         result = deprecated_graph.Graph()
         if not revision_ids:
             pending = set(self.all_revision_ids())

=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py	2007-08-21 01:40:39 +0000
+++ b/bzrlib/workingtree_4.py	2007-08-23 21:36:56 +0000
@@ -43,6 +43,7 @@
     bzrdir,
     cache_utf8,
     conflicts as _mod_conflicts,
+    debug,
     delta,
     dirstate,
     errors,
@@ -62,6 +63,7 @@
     )
 import bzrlib.branch
 from bzrlib.transport import get_transport
+from bzrlib.trace import mutter_callsite
 import bzrlib.ui
 """)
 
@@ -431,6 +433,9 @@
 
     def _get_inventory(self):
         """Get the inventory for the tree. This is only valid within a lock."""
+        if 'evil' in debug.debug_flags:
+            mutter_callsite(2,
+                "accessing .inventory forces a size of tree translation.")
         if self._inventory is not None:
             return self._inventory
         self._must_be_locked()



More information about the bazaar-commits mailing list