Rev 2639: Add useful -Dindex flag. in http://people.ubuntu.com/~robertc/baz2.0/index

Robert Collins robertc at robertcollins.net
Fri Aug 3 08:09:45 BST 2007


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

------------------------------------------------------------
revno: 2639
revision-id: robertc at robertcollins.net-20070803070942-1lrseqr6ligvrtrk
parent: robertc at robertcollins.net-20070801075314-2maihdqr02hah1t3
committer: Robert Collins <robertc at robertcollins.net>
branch nick: index
timestamp: Fri 2007-08-03 17:09:42 +1000
message:
  Add useful -Dindex flag.
modified:
  bzrlib/debug.py                debug.py-20061102062349-vdhrw9qdpck8cl35-1
  bzrlib/index.py                index.py-20070712131115-lolkarso50vjr64s-1
  bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
=== modified file 'bzrlib/debug.py'
--- a/bzrlib/debug.py	2007-07-09 04:31:30 +0000
+++ b/bzrlib/debug.py	2007-08-03 07:09:42 +0000
@@ -25,6 +25,7 @@
  * error - show stack traces for all top level exceptions
  * hooks 
  * hpss - trace smart protocol requests and responses
+ * index - trace major index operations
  * lock - trace when lockdir locks are taken or released
 
 """

=== modified file 'bzrlib/index.py'
--- a/bzrlib/index.py	2007-08-01 07:53:14 +0000
+++ b/bzrlib/index.py	2007-08-03 07:09:42 +0000
@@ -27,7 +27,11 @@
 from cStringIO import StringIO
 import re
 
-from bzrlib import errors
+from bzrlib.lazy_import import lazy_import
+lazy_import(globals(), """
+from bzrlib.trace import mutter
+""")
+from bzrlib import debug, errors
 
 _OPTION_KEY_ELEMENTS = "key_elements="
 _OPTION_NODE_REFS = "node_ref_lists="
@@ -240,6 +244,8 @@
 
         Mutates self._nodes and self.keys_by_offset.
         """
+        if 'index' in debug.debug_flags:
+            mutter('Reading entire index %s', self._transport.abspath(self._name))
         stream = self._transport.get(self._name)
         self._read_prefix(stream)
         expected_elements = 3 + self._key_length

=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py	2007-08-01 07:53:14 +0000
+++ b/bzrlib/knit.py	2007-08-03 07:09:42 +0000
@@ -90,7 +90,6 @@
     RevisionAlreadyPresent,
     )
 from bzrlib.tuned_gzip import GzipFile
-from bzrlib.trace import mutter
 from bzrlib.osutils import (
     contains_whitespace,
     contains_linebreaks,



More information about the bazaar-commits mailing list