Rev 3848: Merge Ian's try/except helper for aiding in debugging strange failures. in http://bazaar.launchpad.net/%7Ebzr/bzr/brisbane-core

John Arbash Meinel john at arbash-meinel.com
Thu Mar 5 15:14:13 GMT 2009


At http://bazaar.launchpad.net/%7Ebzr/bzr/brisbane-core

------------------------------------------------------------
revno: 3848
revision-id: john at arbash-meinel.com-20090305151325-0dzhdganz7lnx6vq
parent: john at arbash-meinel.com-20090305144238-dm8yf1m5s6xzstsy
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: brisbane-core
timestamp: Thu 2009-03-05 09:13:25 -0600
message:
  Merge Ian's try/except helper for aiding in debugging strange failures.
-------------- next part --------------
=== modified file 'bzrlib/chk_map.py'
--- a/bzrlib/chk_map.py	2009-03-05 14:42:38 +0000
+++ b/bzrlib/chk_map.py	2009-03-05 15:13:25 +0000
@@ -51,6 +51,7 @@
     lru_cache,
     osutils,
     registry,
+    trace,
     )
 
 # approx 4MB
@@ -834,7 +835,11 @@
 
     def unmap(self, store, key):
         """Unmap key from the node."""
-        self._raw_size -= self._key_value_len(key, self._items[key])
+        try:
+            self._raw_size -= self._key_value_len(key, self._items[key])
+        except KeyError:
+            trace.mutter("key %s not found in %r", key, self._items)
+            raise
         self._len -= 1
         del self._items[key]
         self._key = None



More information about the bazaar-commits mailing list