Rev 4506: Add more generic InconsistentDeltaDelta error class for use when the exact cause of an inconsistent delta isn't trivially accessible. in http://people.ubuntu.com/~robertc/baz2.0/pending/apply-inventory-delta
Robert Collins
robertc at robertcollins.net
Tue Jul 7 04:40:36 BST 2009
At http://people.ubuntu.com/~robertc/baz2.0/pending/apply-inventory-delta
------------------------------------------------------------
revno: 4506
revision-id: robertc at robertcollins.net-20090707034029-dg8llays6d1py3un
parent: pqm at pqm.ubuntu.com-20090702231053-955txia3151h0z2o
committer: Robert Collins <robertc at robertcollins.net>
branch nick: apply-inventory-delta
timestamp: Tue 2009-07-07 13:40:29 +1000
message:
Add more generic InconsistentDeltaDelta error class for use when the exact cause of an inconsistent delta isn't trivially accessible.
=== modified file 'bzrlib/errors.py'
--- a/bzrlib/errors.py 2009-06-30 15:54:23 +0000
+++ b/bzrlib/errors.py 2009-07-07 03:40:29 +0000
@@ -2162,6 +2162,18 @@
self.reason = reason
+class InconsistentDeltaDelta(InconsistentDelta):
+ """Used when we get a delta that is not valid."""
+
+ _fmt = ("An inconsistent delta was supplied: %(delta)r"
+ "\nreason: %(reason)s")
+
+ def __init__(self, delta, reason):
+ BzrError.__init__(self)
+ self.delta = delta
+ self.reason = reason
+
+
class UpgradeRequired(BzrError):
_fmt = "To use this feature you must upgrade your branch at %(path)s."
=== modified file 'bzrlib/tests/test_errors.py'
--- a/bzrlib/tests/test_errors.py 2009-06-19 00:33:36 +0000
+++ b/bzrlib/tests/test_errors.py 2009-07-07 03:40:29 +0000
@@ -87,6 +87,12 @@
"reason: reason for foo",
str(error))
+ def test_inconsistent_delta_delta(self):
+ error = errors.InconsistentDeltaDelta([], 'reason')
+ self.assertEqualDiff(
+ "An inconsistent delta was supplied: []\nreason: reason",
+ str(error))
+
def test_in_process_transport(self):
error = errors.InProcessTransport('fpp')
self.assertEqualDiff(
More information about the bazaar-commits
mailing list