Rev 2746: (robertc) Add a number of -Devil checks. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Aug 24 04:16:14 BST 2007


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

------------------------------------------------------------
revno: 2746
revision-id: pqm at pqm.ubuntu.com-20070824031612-53wd9sywqa4zima5
parent: pqm at pqm.ubuntu.com-20070823005013-ada9x55rc31yiwou
parent: robertc at robertcollins.net-20070824021547-ov2abtu3buhgzsuz
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2007-08-24 04:16:12 +0100
message:
  (robertc) Add a number of -Devil checks.
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: 2745.1.2
    merged: robertc at robertcollins.net-20070824021547-ov2abtu3buhgzsuz
    parent: robertc at robertcollins.net-20070823213656-055xdmkyesohby3u
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: devil
    timestamp: Fri 2007-08-24 12:15:47 +1000
    message:
      Ensure mutter_callsite is not directly called on a lazy_load object, to make the stacklevel parameter work correctly.
    ------------------------------------------------------------
    revno: 2745.1.1
    merged: 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 file 'bzrlib/index.py'
--- a/bzrlib/index.py	2007-08-22 04:13:35 +0000
+++ b/bzrlib/index.py	2007-08-24 02:15:47 +0000
@@ -29,6 +29,7 @@
 
 from bzrlib.lazy_import import lazy_import
 lazy_import(globals(), """
+from bzrlib import trace
 from bzrlib.trace import mutter
 """)
 from bzrlib import debug, errors
@@ -322,6 +323,9 @@
             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:
+            trace.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 +614,9 @@
             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:
+            trace.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 00:00:26 +0000
+++ b/bzrlib/knit.py	2007-08-24 02:15:47 +0000
@@ -74,10 +74,12 @@
 lazy_import(globals(), """
 from bzrlib import (
     pack,
+    trace,
     )
 """)
 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:
+            trace.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:
+            trace.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-22 05:28:32 +0000
+++ b/bzrlib/repository.py	2007-08-23 21:36:56 +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
@@ -545,6 +545,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())
@@ -870,6 +872,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 {}
@@ -902,6 +907,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-24 02:15:47 +0000
@@ -43,6 +43,7 @@
     bzrdir,
     cache_utf8,
     conflicts as _mod_conflicts,
+    debug,
     delta,
     dirstate,
     errors,
@@ -55,6 +56,7 @@
     revision as _mod_revision,
     revisiontree,
     textui,
+    trace,
     transform,
     urlutils,
     xml5,
@@ -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:
+            trace.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