Add error for up to date mappings.
authorJelmer Vernooij <jelmer@samba.org>
Wed, 24 Oct 2007 17:42:03 +0000 (19:42 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 24 Oct 2007 17:42:03 +0000 (19:42 +0200)
errors.py
tests/test_errors.py

index c720354f3e3f2c3caa31be6a081df78e3b42be0b..aceba6e2204015d5246e8b3e1ad4c93eed8ca4df 100644 (file)
--- a/errors.py
+++ b/errors.py
@@ -66,6 +66,14 @@ def convert_error(err):
         return err
 
 
+class UpToDateMappings(BzrError):
+    _fmt = """Branch %(branch)s is already using the latest bzr-svn mapping version %(mapping_version)s."""
+
+    def __init__(self, branch, mapping_version):
+        self.branch = branch
+        self.mapping_version = mapping_version
+
+
 def convert_svn_error(unbound):
     """Decorator that catches particular Subversion exceptions and 
     converts them to Bazaar exceptions.
index 0c4d880a7534e34b470a517974f5dfa08dbaac05..fd22474d25090211f81df796d8740a850017fb5f 100644 (file)
@@ -20,7 +20,7 @@ from bzrlib.errors import (ConnectionError, ConnectionReset, LockError,
 from bzrlib.tests import TestCase
 
 from errors import (convert_svn_error, convert_error, InvalidPropertyValue, 
-                    SVN_ERR_UNKNOWN_HOSTNAME)
+                    SVN_ERR_UNKNOWN_HOSTNAME, UpToDateMappings)
 
 import svn.core
 from svn.core import SubversionException
@@ -74,3 +74,10 @@ class TestConvertError(TestCase):
         self.assertEqual(
           "Invalid property value for Subversion property svn:foobar: corrupt", 
           str(error))
+
+    def test_up_to_date_mappings(self):
+        error = UpToDateMappings("location", 42)
+
+        self.assertEqual(
+          "Branch location is already using the latest bzr-svn mapping version 42.",
+          str(error))