Rev 1721: fix double handling of error code. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Tue Sep 30 03:57:53 BST 2008


At http://people.samba.org/bzr/jelmer/bzr-svn/trunk

------------------------------------------------------------
revno: 1721
revision-id: jelmer at samba.org-20080930025748-g055tkmk8384qzhw
parent: jelmer at samba.org-20080924160138-uvnoloi6cvo72y1c
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Tue 2008-09-30 04:57:48 +0200
message:
  fix double handling of error code.
modified:
  errors.py                      errors.py-20061226172623-w1sbj8ynpo0eojqp-1
  tests/test_errors.py           test_errors.py-20070129114605-ban03f32t6ja14ez-1
=== modified file 'errors.py'
--- a/errors.py	2008-08-30 21:53:19 +0000
+++ b/errors.py	2008-09-30 02:57:48 +0000
@@ -94,14 +94,6 @@
         self.path = path
 
 
-class RaRequestFailed(BzrError):
-    _fmt = """A Subversion remote access command failed: %(message)"""
-
-    def __init__(self, message):
-        BzrError.__init__(self)
-        self.mesage = message
-
-
 class RevpropChangeFailed(BzrError):
     _fmt = """Unable to set revision property %(name)s."""
 
@@ -111,7 +103,7 @@
 
 
 class DavRequestFailed(BzrError):
-    _fmt = """%(msg)s"""
+    _fmt = """A Subversion remote access command failed: %(msg)s"""
 
     def __init__(self, msg):
         BzrError.__init__(self)
@@ -138,8 +130,6 @@
         return TransportError("Malformed data", msg)
     elif num == ERR_RA_NOT_IMPLEMENTED:
         return NotImplementedError("Function not implemented in remote server")
-    elif num == ERR_RA_DAV_REQUEST_FAILED:
-        return RaRequestFailed(msg)
     elif num == ERR_UNKNOWN_HOSTNAME:
         return ConnectionError(msg=msg)
     elif num == ERR_RA_DAV_REQUEST_FAILED:

=== modified file 'tests/test_errors.py'
--- a/tests/test_errors.py	2008-08-01 21:39:54 +0000
+++ b/tests/test_errors.py	2008-09-30 02:57:48 +0000
@@ -45,8 +45,8 @@
         self.assertIsInstance(convert_error(SubversionException("foo", -4)),
                 SubversionException)
 
-    def test_convert_ra_request_failed(self):
-        self.assertIsInstance(convert_error(SubversionException("foo", ERR_RA_DAV_REQUEST_FAILED)), RaRequestFailed)
+    def test_convert_dav_request_failed(self):
+        self.assertIsInstance(convert_error(SubversionException("foo", ERR_RA_DAV_REQUEST_FAILED)), DavRequestFailed)
 
     def test_convert_malformed(self):
         self.assertIsInstance(convert_error(SubversionException("foo", ERR_RA_SVN_MALFORMED_DATA)), TransportError)




More information about the bazaar-commits mailing list