Rev 409: Move error conversion function to errors.py. in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev

Jelmer Vernooij jelmer at samba.org
Sat Jan 20 22:41:20 GMT 2007


------------------------------------------------------------
revno: 409
revision-id: jelmer at samba.org-20070120224027-8bmtpksroz7awkla
parent: jelmer at samba.org-20070120181401-r8zj3xtwyezlnfnl
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Sat 2007-01-20 23:40:27 +0100
message:
  Move error conversion function to errors.py.
modified:
  NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
  __init__.py                    __init__.py-20051008155114-eae558e6cf149e1d
  errors.py                      errors.py-20061226172623-w1sbj8ynpo0eojqp-1
=== modified file 'NEWS'
--- a/NEWS	2007-01-20 18:14:01 +0000
+++ b/NEWS	2007-01-20 22:40:27 +0000
@@ -5,7 +5,8 @@
    * Non-ascii characters in file ids are now supported (fixes imports 
      of the Python repository).
 
-   * Fixed error raised during version incompatibility. (Wouter van Heyst)
+   * Fixed error raised during version incompatibility. (Wouter van Heyst, 
+                                                         #80467)
 
   IMPROVEMENTS
 

=== modified file '__init__.py'
--- a/__init__.py	2007-01-20 16:02:08 +0000
+++ b/__init__.py	2007-01-20 22:40:27 +0000
@@ -89,23 +89,6 @@
 import transport
 import checkout
 
-def convert_svn_exception(unbound):
-    """Decorator that catches particular Subversion exceptions and 
-    converts them to Bazaar exceptions.
-    """
-    def convert(self, *args, **kwargs):
-        try:
-            unbound(self, *args, **kwargs)
-        except SubversionException, (msg, num):
-            if num == svn.core.SVN_ERR_RA_SVN_CONNECTION_CLOSED:
-                raise ConnectionReset(msg=msg)
-            else:
-                raise
-
-    convert.__doc__ = unbound.__doc__
-    convert.__name__ = unbound.__name__
-    return convert
-
 from bzrlib.transport import register_transport
 register_transport('svn://', transport.SvnRaTransport)
 register_transport('svn+', transport.SvnRaTransport)

=== modified file 'errors.py'
--- a/errors.py	2006-12-26 22:25:29 +0000
+++ b/errors.py	2007-01-20 22:40:27 +0000
@@ -24,5 +24,19 @@
         self.branch_path = branch_path
         self.revnum = revnum
 
-
-
+def convert_svn_exception(unbound):
+    """Decorator that catches particular Subversion exceptions and 
+    converts them to Bazaar exceptions.
+    """
+    def convert(self, *args, **kwargs):
+        try:
+            unbound(self, *args, **kwargs)
+        except SubversionException, (msg, num):
+            if num == svn.core.SVN_ERR_RA_SVN_CONNECTION_CLOSED:
+                raise ConnectionReset(msg=msg)
+            else:
+                raise
+
+    convert.__doc__ = unbound.__doc__
+    convert.__name__ = unbound.__name__
+    return convert




More information about the bazaar-commits mailing list