epg@tigris.org writes:
> Author: epg
> Date: Mon Dec 3 18:06:06 2007
> New Revision: 28226
>
> Log:
> Replace bare SubversionException implemented in C with
> SubversionException written in Python, exposing the full chain of
> svn_error_t objects.
>
> * subversion/bindings/swig/python/svn/core.py
> (SubversionException): Add Exception class with apr_err, message,
> child, file, and line attributes, plus args attribute that is
> compatible with pre-1.5 bindings.
>
> * subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
> (SubversionException, svn_swig_py_exception_type,
> svn_swig_py_register_exception): Remove.
> (svn_swig_py_svn_exception): Turn svn_error_t chain into
> svn.core.SubversionException chain and raise that.
>
> * subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h
> (svn_swig_py_exception_type, svn_swig_py_register_exception): Remove.
>
> * subversion/bindings/swig/core.i
> Drop reference to svn_swig_py_exception_type.
> Don't register SubversionException here.
>
> * subversion/bindings/swig/python/tests/client.py
> * subversion/bindings/swig/python/tests/mergeinfo.py
> * subversion/bindings/swig/python/tests/repository.py
> * subversion/bindings/swig/python/tests/wc.py
> Import SubversionException from svn.core instead of libsvn.core.
Do we need backward compatibility for this? I think that, even
though the Python binding has no documentation, libsvn is not
part of the "documented" interface, but only an implementation
detail. No one should be importing anything from libsvn. But,
if we had to, compat is as simple as:
Index: core.py
===================================================================
--- core.py (revision 28226)
+++ core.py (working copy)
@@ -64,7 +64,11 @@
# Don't use @classmethod, we support 2.2.
_new_from_err_list = classmethod(_new_from_err_list)
+# pre-1.5 compat
+import libsvn.core
+libsvn.core.SubversionException = SubversionException
+
def _cleanup_application_pool():
"""Cleanup the application pool before exiting"""
if application_pool and application_pool.valid():
Thoughts?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Dec 4 03:12:24 2007