Rev 3825: Add some context information to the Retry exceptions. in http://bzr.arbash-meinel.com/branches/bzr/1.9-dev/pack_retry_153786

John Arbash Meinel john at arbash-meinel.com
Fri Dec 19 16:48:09 GMT 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.9-dev/pack_retry_153786

------------------------------------------------------------
revno: 3825
revision-id: john at arbash-meinel.com-20081219164804-5hgw636eeadadxwm
parent: john at arbash-meinel.com-20081216150741-mp88ad7yjfok68yi
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: pack_retry_153786
timestamp: Fri 2008-12-19 10:48:04 -0600
message:
  Add some context information to the Retry exceptions.
  
  Just in case one of them leaks out into the 'real world'.
-------------- next part --------------
=== modified file 'bzrlib/errors.py'
--- a/bzrlib/errors.py	2008-12-16 14:58:29 +0000
+++ b/bzrlib/errors.py	2008-12-19 16:48:04 +0000
@@ -1496,9 +1496,10 @@
 
     internal_error = True
 
-    _fmt = ("Pack files have changed, reload and retry. %(orig_error)s")
+    _fmt = ("Pack files have changed, reload and retry. context: %(context)s"
+            " %(orig_error)s")
 
-    def __init__(self, reload_occurred, exc_info):
+    def __init__(self, context, reload_occurred, exc_info):
         """create a new RetryWithNewPacks error.
 
         :param reload_occurred: Set to True if we know that the packs have
@@ -1527,7 +1528,8 @@
 
     internal_error = True
 
-    _fmt = ("Pack files have changed, reload and try autopack again.")
+    _fmt = ("Pack files have changed, reload and try autopack again."
+            " context: %(context)s %(orig_error)s")
 
 
 class NoSuchExportFormat(BzrError):

=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py	2008-12-11 03:18:52 +0000
+++ b/bzrlib/knit.py	2008-12-19 16:48:04 +0000
@@ -2594,7 +2594,8 @@
                     # If we don't have a _reload_func there is nothing that can
                     # be done
                     raise
-                raise errors.RetryWithNewPacks(reload_occurred=True,
+                raise errors.RetryWithNewPacks(transport.abspath(path),
+                                               reload_occurred=True,
                                                exc_info=sys.exc_info())
             try:
                 reader = pack.make_readv_reader(transport, path, offsets)
@@ -2605,7 +2606,8 @@
                 # missing on disk, we need to trigger a reload, and start over.
                 if self._reload_func is None:
                     raise
-                raise errors.RetryWithNewPacks(reload_occurred=False,
+                raise errors.RetryWithNewPacks(transport.abspath(path),
+                                               reload_occurred=False,
                                                exc_info=sys.exc_info())
 
     def set_writer(self, writer, index, transport_packname):

=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2008-12-16 15:07:41 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2008-12-19 16:48:04 +0000
@@ -1756,7 +1756,7 @@
             # Re-raise the original exception, because something went missing
             # and a restart didn't find it
             raise
-        raise errors.RetryAutopack(False, sys.exc_info())
+        raise errors.RetryAutopack(self.repo, False, sys.exc_info())
 
     def _clear_obsolete_packs(self):
         """Delete everything from the obsolete-packs directory.



More information about the bazaar-commits mailing list