Index: subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c =================================================================== --- subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c (revision 16842) +++ subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c (working copy) @@ -326,7 +326,7 @@ /*** Helper/Conversion Routines ***/ /* Functions for making Python wrappers around Subversion structs */ -static PyObject *make_ob_pool(void *pool) +static PyObject *make_ob_pool(void *unused_ptr) { /* Return a brand new default pool to Python. This pool isn't * normally used for anything. It's just here for compatibility @@ -334,12 +334,14 @@ apr_pool_t *new_pool = svn_pool_create(_global_pool); PyObject *new_py_pool = svn_swig_NewPointerObj(new_pool, svn_swig_TypeQuery("apr_pool_t *"), _global_svn_swig_py_pool); - (void) pool; /* Silence compiler warnings about unused parameter. */ + (void) unused_ptr; /* Silence compiler warnings about unused parameter. */ return new_py_pool; } -static PyObject *make_ob_fs_root(svn_fs_root_t *ptr, PyObject *py_pool) +static PyObject *make_ob_fs_root(svn_fs_root_t *ptr) { - return svn_swig_NewPointerObjString(ptr, "svn_fs_root_t *", py_pool); + /* TODO: Duplicate the svn_fs_root_t * object */ + return svn_swig_NewPointerObjString(ptr, "svn_fs_root_t *", + _global_svn_swig_py_pool); } /***/ @@ -926,7 +928,7 @@ /* ### python doesn't have 'const' on the method name and format */ if ((result = PyObject_CallMethod(ib->editor, (char *)"open_root", (char *)"lO&", base_revision, - make_ob_pool, dir_pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); goto finished; @@ -955,7 +957,7 @@ /* ### python doesn't have 'const' on the method name and format */ if ((result = PyObject_CallMethod(ib->editor, (char *)"delete_entry", (char *)"slOO&", path, revision, ib->baton, - make_ob_pool, pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); goto finished; @@ -987,7 +989,7 @@ if ((result = PyObject_CallMethod(ib->editor, (char *)"add_directory", (char *)"sOslO&", path, ib->baton, copyfrom_path, copyfrom_revision, - make_ob_pool, dir_pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); goto finished; @@ -1018,7 +1020,7 @@ if ((result = PyObject_CallMethod(ib->editor, (char *)"open_directory", (char *)"sOlO&", path, ib->baton, base_revision, - make_ob_pool, dir_pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); goto finished; @@ -1049,7 +1051,7 @@ (char *)"Oss#O&", ib->baton, name, value ? value->data : NULL, value ? value->len : 0, - make_ob_pool, pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); goto finished; @@ -1087,7 +1089,7 @@ if ((result = PyObject_CallMethod(ib->editor, (char *)"add_file", (char *)"sOslO&", path, ib->baton, copyfrom_path, copyfrom_revision, - make_ob_pool, file_pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); goto finished; @@ -1119,7 +1121,7 @@ if ((result = PyObject_CallMethod(ib->editor, (char *)"open_file", (char *)"sOlO&", path, ib->baton, base_revision, - make_ob_pool, file_pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); goto finished; @@ -1239,7 +1241,7 @@ (char *)"Oss#O&", ib->baton, name, value ? value->data : NULL, value ? value->len : 0, - make_ob_pool, pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); goto finished; @@ -1590,7 +1592,7 @@ if ((result = PyObject_CallFunction(function, (char *)"O&O&", make_ob_lock, lock, - make_ob_pool, pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); } @@ -1640,7 +1642,7 @@ if ((result = PyObject_CallFunction(function, (char *)"OO&", cmt_items, - make_ob_pool, pool)) == NULL) + make_ob_pool, NULL)) == NULL) { Py_DECREF(cmt_items); err = callback_exception_error(); @@ -1681,7 +1683,6 @@ { PyObject *function = baton; PyObject *result; - PyObject *py_pool, *py_root; svn_error_t *err = SVN_NO_ERROR; *allowed = TRUE; @@ -1691,21 +1692,11 @@ svn_swig_py_acquire_py_lock(); - py_pool = make_ob_pool(pool); - if (py_pool == NULL) { - err = callback_exception_error(); - goto finished; - } - py_root = make_ob_fs_root(root, py_pool); - if (py_root == NULL) { - Py_DECREF(py_pool); - err = callback_exception_error(); - goto finished; - } - if ((result = PyObject_CallFunction(function, - (char *)"OsO", - py_root, path, py_pool)) == NULL) + (char *)"O&sO&", + make_ob_fs_root, root, + path, + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); } @@ -1719,9 +1710,6 @@ err = callback_bad_return_error("Not an integer"); Py_DECREF(result); } - Py_DECREF(py_root); - Py_DECREF(py_pool); -finished: svn_swig_py_release_py_lock(); return err; } @@ -1743,7 +1731,7 @@ if ((result = PyObject_CallFunction(function, (char *)"slO&", path, revision, - make_ob_pool, pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); } @@ -1767,7 +1755,7 @@ apr_pool_t *pool) { PyObject *receiver = baton; - PyObject *result, *py_pool; + PyObject *result; PyObject *chpaths; svn_error_t *err = SVN_NO_ERROR; @@ -1776,12 +1764,6 @@ svn_swig_py_acquire_py_lock(); - py_pool = make_ob_pool(pool); - if (py_pool == NULL) { - err = callback_exception_error(); - goto finished; - } - if (changed_paths) { chpaths = convert_hash(changed_paths, convert_log_changed_path, @@ -1794,9 +1776,9 @@ } if ((result = PyObject_CallFunction(receiver, - (char *)"OlsssO", + (char *)"OlsssO&", chpaths, rev, author, date, msg, - py_pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); } @@ -1808,8 +1790,6 @@ } Py_DECREF(chpaths); - Py_DECREF(py_pool); -finished: svn_swig_py_release_py_lock(); return err; } @@ -1836,7 +1816,7 @@ (char *) (SVN_APR_INT64_T_PYCFMT "lsssO&"), line_no, revision, author, date, line, - make_ob_pool, pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); } @@ -1873,7 +1853,7 @@ if ((result = PyObject_CallFunction(function, (char *)"sslO&", realm, username, may_save, - make_ob_pool, pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); } @@ -1924,7 +1904,7 @@ if ((result = PyObject_CallFunction(function, (char *)"slO&", realm, may_save, - make_ob_pool, pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); } @@ -1976,7 +1956,7 @@ if ((result = PyObject_CallFunction(function, (char *)"slO&lO&", realm, failures, make_ob_auth_ssl_server_cert_info, - cert_info, may_save, make_ob_pool, pool)) == NULL) + cert_info, may_save, make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); } @@ -2027,7 +2007,7 @@ if ((result = PyObject_CallFunction(function, (char *)"slO&", realm, may_save, - make_ob_pool, pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); } @@ -2078,7 +2058,7 @@ if ((result = PyObject_CallFunction(function, (char *)"slO&", realm, may_save, - make_ob_pool, pool)) == NULL) + make_ob_pool, NULL)) == NULL) { err = callback_exception_error(); }