[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Merging python-bindings-improvements to trunk

From: <kfogel_at_collab.net>
Date: 2005-08-04 18:18:11 CEST

David James <james82@gmail.com> writes:
> I'd like to merge my changes from the python-bindings-improvements
> branch to trunk. Please take a look and let me know what you think!

David, some good news: Ben Reser has agreed to look these over in the
next few days. (And thank you, Ben!)

Since there's no reason to be mysterious about the goal here, I'll
just say it out loud: this is a bootstrap review, the purpose of which
is to be able to say "Hey, this David James guy knows his way around
the Python bindings, so we should just give him commit access there,
so he doesn't need to wait on others to commit bindings trunk changes
from now on."

Obviously, if Ben finds any serious problems, he'll raise questions
here, and we'll work them out. I'm unfortunately not experienced
enough with the Python bindings to review the changes themselves, but
I looked over your log messages and saw nothing alarming. They were
clear, well-formatted, referred to previous changes where appropriate,
etc. And the general direction of the changes seems very good,
needless to say.

Thanks also for this summary mail, which really packaged things up in
an easy-to-comprehend way for potential reviewers.

-Karl

> Here's a summary of the changes as of r15529.
>
> - Automated Test Suite
> * Simple test suite for memory pools (r15396, r15462)
> * In-build-directory testing (r15478)
> * Nightly smoke tests (r15505)
> - Automatic Memory Management
> * Autogenerated proxy classes for SVN structs (r15428)
> * Hand-written proxy classes for APR structs (r15484)
> * Real reference counting for Pool objects (r15489, r15495, r15500)
> * Optional Pool Arguments (r15370, r15529)
> - Better documentation and error messages
> * Enabled SWIG autodoc feature (r15490)
> * Report assertion failures when variables are deleted prematurely
> (r15488, r15489, r15492)
> * Python argument numbers in error messages (r15460, r15493, r15525)
> - Streamlined build process
> * Automatic dependency checking for SWIG files (r15381, r15405,
> r15426, r15429, r15430)
> * Makefile rule for clean-swig-py (r15476)
> - Other changes
> * Compile-time type lookups for SWIG (r15397, r15407, r15408, r15409,
> r15412, r15417)
> * Move SWIG includes into include directory (r15407, r15408, r15413)
> * Refactoring (r15411, r15425, r15453, r15521, r15522, r15527)
> * Minor bugfixes (r15409, r15494, r15496, r15497, r15498, r15499,
> r15501, r15511, r15519, r15526)
> * Merges from trunk (r15414, r15418, r15461, r15491, r15506, r15528)
>
> Here's some sample code which uses the automatic memory management feature:
> from svn import core, repos, fs
>
> # Return the youngest revision in a repository as an integer.
> # The pool used by this function is automatically cleaned up
> # when both the repos_ptr and fs_ptr variables go out of scope.
> def youngest_rev(path):
> repos_ptr = repos.open(path, core.Pool())
> fs_ptr = repos.fs(repos_ptr)
> return fs.youngest_rev(fs_ptr)
>
> With this new code, you shouldn't need to worry about keeping pools in
> scope -- the pool will stay in scope for as long as its variables are
> in scope. You can still manage pools manually, if you like -- Python
> will only destroy a pool if it is not deleted manually.
>
> If, by some programming accident, you delete a pool manually, but still
> try to use the variables inside it, Subversion will raise a Python
> exception so that you can easily track down the error. These Python
> exceptions are much easier to debug than segfaults.
>
> I've attached a log of my changes to the branch.
>
> Thanks for your help!
>
> David
>
> --
> David James -- http://www.cs.toronto.edu/~james
>
> ------------------------------------------------------------------------
> r15527 | djames | 2005-07-31 20:42:24 -0400 (Sun, 31 Jul 2005) | 17 lines
>
> Use SWIG_fail instead of "return NULL" for the Python bindings.
>
> * swig/core.i:
> (svn_stream_read, svn_stream_write, apr_header_t *providers, void *value,
> FILE *): Use SWIG_fail instead of "return NULL".
> * swig/include/svn_global.swg:
> (SWIGTYPE *, void *, SWIGTYPE []): Use SWIG_fail instead of "return NULL".
> * swig/include/svn_types.swg:
> (svn_error_t *, PTR/LEN, apr_pool_t *): Use SWIG_fail instead of
> "return NULL".
> * swig/include/svn_string.swg:
> (RET_STRING, svn_stringbuf_t *, const svn_string_t *, const char **OUTPUT,
> apr_array_header_t *STRINGLIST): Use SWIG_fail instead of "return NULL".
> * swig/svn_client.i:
> (apr_array_header_t *props): Use SWIG_fail instead of "return NULL".
>
>
> ------------------------------------------------------------------------
> r15526 | djames | 2005-07-31 20:31:19 -0400 (Sun, 31 Jul 2005) | 5 lines
>
> * swig/include/svn_types.swg:
> (apr_pool_t *): Create temporary variables in a local pool if a local pool
> is available.
>
>
> ------------------------------------------------------------------------
> r15525 | djames | 2005-07-31 18:51:18 -0400 (Sun, 31 Jul 2005) | 25 lines
>
> Instead of reporting the SWIG/C argument number in error messages,
> report argument numbers that correspond to the Python inputs. Our
> reported argument numbers are now consistent with those reported
> by the Python interpreter.
>
> * swig/include/svn_global.swg:
> ($svn_argnum): New macro. Expands to the current Python argument number.
> (POOLINIT): New typemap for parameters which require a global pool
> and a global py_pool. Applied this typemap to SWIGTYPE, void *,
> SWIGTYPE *, and SWIGTYPE [].
> (SWIGTYPE *, SWIGTYPE []): Switch from $argnum to $svn_argnum. Apply
> typemap to void *.
> (char *, char const *, char * const, char const * const, char,
> unsigned char, short, unsigned short, int, enum SWIGTYPE, svn_boolean_t,
> apr_seek_where_t, apr_fileperms_t, unsigned int, long, ssize_t, unsigned
> long, size_t, __int64, long long, unsigned __int64, unsigned long long):
> Use Python format specifiers instead of standard SWIG typemaps to parse these
> basic types, because Python reports better error messages with correct
> argument numbers.
> * swig/core.i:
> (apr_header_t *providers): Switch from $argnum to $svn_argnum.
> * swig/include/svn_types.swg:
> (apr_pool_t *): Switch from $argnum to $svn_argnum.
>
>
> ------------------------------------------------------------------------
> r15524 | djames | 2005-07-31 18:36:56 -0400 (Sun, 31 Jul 2005) | 5 lines
>
> * swig/include/svn_global.swg:
> (svn_string_createv, svn_stringbuf_createv): Ignore these functions, because
> SWIG can't handle the variadic parameters.
>
>
> ------------------------------------------------------------------------
> r15522 | djames | 2005-07-31 18:10:08 -0400 (Sun, 31 Jul 2005) | 10 lines
>
> Remove global declarations of _global_pool and _global_svn_swig_py_pool.
>
> * swig/python/libsvn_swig_py/swigutil_py.h:
> (_global_pool, _global_svn_swig_py_pool): Remove declarations.
> * swig/python/libsvn_swig_py/swigutil_py.c:
> (_global_pool, _global_svn_swig_py_pool): Make variables static.
> * swig/include/svn_global.swg:
> (_global_svn_swig_py_pool): Declare variable as NULL.
>
>
> ------------------------------------------------------------------------
> r15521 | djames | 2005-07-31 17:45:38 -0400 (Sun, 31 Jul 2005) | 4 lines
>
> * swig/include/svn_global.swg:
> Disable default constructors in Python.
>
>
> ------------------------------------------------------------------------
> r15519 | djames | 2005-07-31 16:51:52 -0400 (Sun, 31 Jul 2005) | 7 lines
>
> * swig/python/libsvn_swig_py.c:
> (make_ob_pool): Ensure that the pool "decref" cleanup function is
> registered before we call "proxy_set_pool" so that the "decref" cleanup
> function will execute after any cleanup functions initialized by
> "proxy_set_pool". Followup to r15511.
>
>
> ------------------------------------------------------------------------
> r15511 | djames | 2005-07-30 18:43:02 -0400 (Sat, 30 Jul 2005) | 11 lines
>
> Fix memory leaks in swigutil_py.c.
>
> * swig/python/libsvn_swig_py/swigutil_py.c:
> (svn_swig_MustGetPtr): Turn *py_pool into a borrowed reference by
> running Py_DECREF on it right away. This solves a potential memory
> leak.
> (make_ob_pool): Solve memory leak when proxy_set_pool fails
> unexpectedly by moving Py_INCREF and cleanup registration
> below the proxy_set_pool call.
>
>
> ------------------------------------------------------------------------
> r15506 | djames | 2005-07-30 10:47:07 -0400 (Sat, 30 Jul 2005) | 3 lines
>
> Merge r15490:r15505 from trunk.
>
>
> ------------------------------------------------------------------------
> r15505 | djames | 2005-07-30 10:09:46 -0400 (Sat, 30 Jul 2005) | 4 lines
>
> * tools/test-scripts/svntest/svntest-bindings.sh:
> (TEST_BINDINGS_SWIG_PYTHON) Enable automated tests for Python
>
>
> ------------------------------------------------------------------------
> r15501 | djames | 2005-07-30 02:26:30 -0400 (Sat, 30 Jul 2005) | 5 lines
>
> * swig/python/svn/core.py:
> (run_app): Use libsvn.core.application_pool instead of
> svn.core.application_pool.
>
>
> ------------------------------------------------------------------------
> r15500 | djames | 2005-07-30 02:17:55 -0400 (Sat, 30 Jul 2005) | 13 lines
>
> Upgrade reference checker to detect that variables are deleted
> when pools are cleared.
>
> * swig/proxy/proxy_apr.swg:
> (proxy.set_parent_pool): Set self._is_valid to a weakreference to
> parent_pool._is_valid.
> (proxy.assert_valid): Check variable validity by checking whether
> the weakreference is still valid.
> * swig/proxy/proxy_apr.swg:
> (apr_pool_t._mark_valid): Set self._is_valid to lambda: 1 instead
> of just a number so that self._is_valid will be weakreferenceable.
>
>
> ------------------------------------------------------------------------
> r15499 | djames | 2005-07-30 01:23:41 -0400 (Sat, 30 Jul 2005) | 4 lines
>
> * swig/include/svn_types.swg:
> (apr_pool_t *): Initialize default parameter.
>
>
> ------------------------------------------------------------------------
> r15498 | djames | 2005-07-30 01:17:06 -0400 (Sat, 30 Jul 2005) | 4 lines
>
> * swig/include/svn_types.swg:
> Initialize $1 pool parameter based on _global_pool
>
>
> ------------------------------------------------------------------------
> r15497 | djames | 2005-07-30 01:08:00 -0400 (Sat, 30 Jul 2005) | 4 lines
>
> * swig/proxy/proxy_apr.swg:
> Switch apr_array_header_t * to an opaque proxy.
>
>
> ------------------------------------------------------------------------
> r15496 | djames | 2005-07-30 01:00:36 -0400 (Sat, 30 Jul 2005) | 3 lines
>
> (svn_swig_MustGetPtr): Fix typo where 1 was returned instead of NULL.
>
>
> ------------------------------------------------------------------------
> r15495 | djames | 2005-07-30 00:57:04 -0400 (Sat, 30 Jul 2005) | 22 lines
>
> Children inherit pools from passed proxy objects when real pools are not passed.
>
> * swig/python/libsvn_swig_py/swigutil_py.c:
> (parentPool): Add variable.
> (_global_swig_py_is_local_pool): Add variable.
> (svn_swig_MustGetPtr): Add py_pool parameter. Fill *py_pool with parent
> pool of Python input object, if such a pool can be found. Otherwise,
> fill *py_pool with the global pool object.
> * swig/python/libsvn_swig_py/swigutil_py.h:
> (_global_swig_py_is_local_pool): Add variable.
> (svn_swig_MustGetPtr): Add py_pool parameter.
> * swig/include/svn_global.swg:
> (SWIGTYPE *): Initialize local variables for holding pool objects, and
> fill them using svn_swig_MustGetPtr.
> * swig/include/svn_types.swg:
> (apr_pool_t *): Update arguments to svn_swig_MustGetPtr. Override inherited
> pools if _global_swig_py_is_local_pool == 0.
> * swig/core.i:
> (apr_header_t **providers): Update arguments to svn_swig_MustGetPtr.
>
>
>
> ------------------------------------------------------------------------
> r15494 | djames | 2005-07-29 23:32:22 -0400 (Fri, 29 Jul 2005) | 16 lines
>
> Repair and refactor auto-defaulting behaviour for Python
> pools. Followup to r15493.
>
> * swig/core.i:
> (svn_swig_py_get_application_pool): Remove function.
> * swig/python/libsvn_swig_py/swigutil_py.c,
> swig/python/libsvn_swig_py/swigutil_py.h,
> (svn_swig_py_get_application_pool): Remove function.
> (svn_swig_py_convert_pool): Remove function.
> (svn_swig_get_application_pool): Add function. Gets the apr pool and the
> python pool.
> * swig/include/svn_types.swg:
> (apr_pool_t *): Get both the python pool and the apr pool using
> svn_swig_get_application_pool if the pool cannot be found.
>
>
> ------------------------------------------------------------------------
> r15493 | djames | 2005-07-29 22:55:22 -0400 (Fri, 29 Jul 2005) | 11 lines
>
> Switch svn_swig_py_convert_pool to MustGetPtr interface so that we will
> see argument numbers in our error messages.
>
> * swig/include/svn_types.swg:
> (apr_pool_t *): Switch svn_swig_py_convert_pool to use MustGetPtr interface
> instead of ConvertPtr interface.
> * swig/python/libsvn_swig_py/swigutil_py.h,
> swig/python/libsvn_swig_py/swigutil_py.c:
> Switch svn_swig_py_convert_pool to use MustGetPtr interface
> instead of ConvertPtr interface.
>
> ------------------------------------------------------------------------
> r15492 | djames | 2005-07-29 22:39:25 -0400 (Fri, 29 Jul 2005) | 3 lines
>
> * swig/python/libsvn_swig_py/swigutil_py.c
> (svn_swig_MustGetPtr): Validate pointer before converting
>
> ------------------------------------------------------------------------
> r15491 | djames | 2005-07-29 22:16:22 -0400 (Fri, 29 Jul 2005) | 3 lines
>
> Merge 15460-15490 from trunk.
>
>
> ------------------------------------------------------------------------
> r15490 | djames | 2005-07-29 22:15:00 -0400 (Fri, 29 Jul 2005) | 9 lines
>
> Add documentation to all SWIG functions via SWIG's autodoc feature.
>
> * swig/include/svn_global.swg:
> Enable SWIG autodoc feature
> * subversion/bindings/swig/proxy/proxy_apr.swg:
> (apr_pool_t.set_parent_pool): Access C functions directly, so that we
> protect the actual functions from the GC, instead of the autodoc
> wrappers.
>
> ------------------------------------------------------------------------
> r15489 | djames | 2005-07-29 21:39:39 -0400 (Fri, 29 Jul 2005) | 81 lines
>
> Implement validated automatic memory management for the Python bindings.
>
> * subversion/bindings/swig/include/apr.swg:
> (apr_file_t **): Add py_pool argument to call to svn_swig_NewPointerObj.
> * subversion/bindings/swig/include/svn_global.swg:
> (SWIGTYPE *): Add py_pool argument to call to svn_swig_NewPointerObj.
> * subversion/bindings/swig/include/svn_types.swg:
> (SWIGTYPE **OUTPARAM): Add py_pool argument to call to
> svn_swig_NewPointerObj.
> (apr_pool_t *): Initialize local _global_svn_swig_py_pool variable.
> (apr_hash_t **dirents, apr_hash_t **entries_p, apr_hash_t **changed_paths_p,
> apr_hash_t **locks, apr_hash_t **entries):
> Pass py_pool argument to call to svn_swig_py_convert_hash.
> * subversion/bindings/swig/core.i:
> (apr_hash_t **cfg_hash): Switch from SWIG_NewPointerObj to
> svn_swig_NewPointerObj. Add py_pool argument to call to
> svn_swig_NewPointerObj.
> (svn_swig_py_set_application_pool): Add py_pool argument.
> (svn_swig_py_register_cleanup): Add.
> * subversion/bindings/swig/proxy/proxy_apr.swg:
> (apr_pool_t): Remove autogenerated opaque proxy class for apr_pool_t.
> Extend apr_pool_t class to support the full functionality of pools, including
> automatic memory management.
> * subversion/bindings/swig/python/tests/pool.py:
> Update tests to reflect new scheme for automatic memory management. All pool
> pointers are now wrapped with Python classes, so they all protect their
> parents from being automatically deleted. The core application_pool is now
> stored inside libsvn.core instead of svn.core.
> * subversion/bindings/swig/python/svn/core.py:
> Replace Pool class with a pointer to the svn_pool_create function.
> * subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h:
> (_global_svn_swig_py_pool): Add.
> (svn_swig_py_set_application_pool): Add py_pool parameter.
> (svn_swig_py_register_cleanup): Add.
> (svn_swig_py_convert_hash): Add py_pool parameter.
> * subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c:
> (poolAttribute): Remove unused variable.
> (_global_svn_swig_py_pool): Add variable. Contains pointer to the Python
> wrapper around the global pool.
> (setParentPool): Add. Contains the name of the "set_parent_pool" function.
> (objectTuple): Add. String describing a single-object tuple.
> (svn_swig_set_application_pool): Add py_pool argument. Use py_pool argument
> to set _global_svn_swig_py_pool.
> (svn_swig_py_pool_destroyed): Add function. Mark pool as invalid after its
> memory has been destroyed.
> (svn_swig_py_pool_decref): Add function. Decreases a pool's reference count
> after it has been destroyed.
> (svn_swig_py_register_cleanup): Add function. Registers the
> "svn_swig_py_pool_destroyed" function to be called upon cleanup of the
> specified pool.
> (svn_swig_py_convert_pool): Remove code for converting between Pool objects
> and apr_pool_t wrappers, because the two are now one and the same.
> (proxy_set_pool): Add function. Sets the parent pool of a proxy object.
> (svn_swig_NewPointerObj): Set the parent pool of each proxy object as it
> is created. Parent pool is now specified as a parameter.
> (svn_swig_ConvertPtr): Check the validity of the pool memory of Python
> objects before converting them into C objects.
> (make_ob_pool): Create C-managed Pool object which sticks around at least as
> long as the C version of the memory pool.
> (make_ob_window, make_ob_status, make_ob_lock, make_ob_fs_root,
> make_ob_server_cert_info): Update to accept pool parameter and pass it in
> to svn_swig_NewPointerObjString.
> (convert_hash): Update to accept pool parameter and pass into
> converter_func.
> (convert_to_swigtype): Update to accept pool parameter and pass it into
> svn_swig_newPointerObj.
> (convert_svn_string_t: Update to accept and ignore pool parameter.
> (svn_swig_py_prophash_to_dict): Update to pass NULL pool parameter to
> convert_hash.
> (svn_swig_py_convert_hash): Update to accept pool parameter and pass it into
> convert_hash.
> (svn_swig_py_fs_get_locks_func): Update to create pool object early and pass
> it into the make_ob_lock function.
> (svn_swig_py_repos_authz_func): Update to create pool object early and pass
> it into the make_ob_fs_root function.
> (svn_swig_py_log_receiver): Update to create pool object early and pass it
> into the svn_swig_py_convert_hash function.
> (svn_swig_py_auth_ssl_server_trust_prompt_func): Update to create pool object
> early and pass it into the make_ob_server_cert_info function.
>
>
> ------------------------------------------------------------------------
> r15488 | djames | 2005-07-29 17:49:44 -0400 (Fri, 29 Jul 2005) | 6 lines
>
> Switch the Python bindings to use classic classes so that we can
> more easily override attribute access in a consistent manner.
>
> * Makefile.in
> (RUN_SWIG_PY): Add -classic option
>
> ------------------------------------------------------------------------
> r15484 | djames | 2005-07-29 12:14:03 -0400 (Fri, 29 Jul 2005) | 11 lines
>
> Add missing file which contains proxy classes for APR classes.
> Follow up to r15428.
>
> Suggested by: Christian Boos <cboos@wanadoo.fr>
>
> * swig/proxy/proxy_apr.swg:
> Proxy class interface to APR. With APR, we only want to create
> a limited number of proxy class objects, so I created this file
> manually.
>
>
> ------------------------------------------------------------------------
> r15478 | djames | 2005-07-29 00:14:14 -0400 (Fri, 29 Jul 2005) | 17 lines
>
> Update Python test suite to test the bindings in the build directory.
> We test the build dir version of Subversion.
>
> * subversion/bindings/swig/python/tests/run_all.py
> Add potential library directories to path.
> * Makefile.in:
> (swig-py): Add $(SWIG_PY_DIR)/__init__.py and $(SWIG_PY_DIR)/libsvn
> as dependencies.
> (SWIG_PY_DIR/__init__.py): Copy __init__.py from source directory to build
> directory if it does not already exist there. Needed when build_dir !=
> src_dir.
> (SWIG_PY_DIR/libsvn): Create link to SWIG_PY_DIR with name libsvn so that
> Python will look in SWIG_PY_DIR for the libsvn library.
> (clean-swig-py): Remove $(SWIG_PY_DIR)/libsvn. Remove
> $(SWIG_PY_DIR)/__init__.py if it is an unncessary copy. Needed when
> build_dir != src_dir.
>
> ------------------------------------------------------------------------
> r15476 | djames | 2005-07-28 20:15:08 -0400 (Thu, 28 Jul 2005) | 7 lines
>
> Add clean-swig-py Makefile rule.
>
> * Makefile.in: Add clean-swig-py rule.
> * build/ac-macros/swig.m4:
> (SVN_FIND_SWIG): Add clean-swig-py rule to list of cleanup rules if we
> enable the Python bindings.
>
> ------------------------------------------------------------------------
> r15462 | djames | 2005-07-28 16:06:48 -0400 (Thu, 28 Jul 2005) | 10 lines
>
> Add check-swig-py target for checking the correctness of the
> currently installed version of the SWIG Python bindings. (We
> hope to extend this in future to test the build-dir version
> of the Python bindings.)
>
> * Makefile.in:
> (SWIG_PY_DIR): Add. Path to Python bindings build dir.
> (SWIG_PY_SRC_DIR): Add. Path to Python bindings src dir.
> (check-swig-py): Add.
>
> ------------------------------------------------------------------------
> r15461 | djames | 2005-07-28 15:33:54 -0400 (Thu, 28 Jul 2005) | 2 lines
>
> Merge r15417-r15460 from trunk.
>
> ------------------------------------------------------------------------
> r15460 | djames | 2005-07-28 15:24:35 -0400 (Thu, 28 Jul 2005) | 17 lines
>
> Switch from svn_swig_ConvertPtr to svn_swig_MustGetPtr where possible.
> svn_swig_MustGetPtr reports better error messages.
>
> * swig/core.i:
> (apr_header_t *providers): Switch from svn_swig_ConvertPtr to
> svn_swig_MustGetPtr. Add if statement to return NULL if there
> was an error.
> * include/svn_global.swg:
> (SWIGTYPE *, SWIGTYPE []): Switch from svn_swig_ConvertPtr to
> svn_swig_MustGetPtr
> * swig/python/libsvn_swig_py/swigutil_py.c:
> (svn_swig_MustGetPtr): Add svn_swig_MustGetPtr function.
> * swig/python/libsvn_swig_py/swigutil_py.h:
> (SWIG_MustGetPtr): Add #define for SWIG_MustGetPtr.
> (svn_swig_MustGetPtr): Add svn_swig_MustGetPtr function.
>
>
> ------------------------------------------------------------------------
> r15453 | djames | 2005-07-27 11:04:38 -0400 (Wed, 27 Jul 2005) | 13 lines
>
> Switch from SWIG_NewPointerObj and SWIG_ConvertPtr to svn_swig_NewPointerObj
> and svn_swig_ConvertPtr.
>
> * swig/include/apr.swg:
> (apr_file_t **): Switch from SWIG_NewPointerObj to svn_swig_NewPointerObj.
> * swig/include/svn_types.swg:
> (SWIGTYPE **OUTPARAM): Switch from SWIG_NewPointerObj to
> svn_swig_NewPointerObj.
> * swig/include/svn_global.swg:
> (SWIGTYPE *, SWIGTYPE[]): Add. Override default input and output typemaps
> for Python to use svn_swig_ConvertPtr and svn_swig_NewPointerObj.
>
>
> ------------------------------------------------------------------------
> r15430 | djames | 2005-07-26 00:32:46 -0400 (Tue, 26 Jul 2005) | 12 lines
>
> Add option to build.conf for configuring the wildcards autogen.sh uses to
> define a "header". Currently, header files can have any of the following
> extensions: *.h, *.i, *.swg.
>
> * build.conf
> (options.include-wildcards): Add. Describes the valid extensions of header
> files.
> * build/generator/gen_base.py:
> (GeneratorBase.__init__): Extract options.include-wildcards from build.conf.
> (GeneratorBase.compute_hdrs): Instead of hardcoding the wildcards, use
> the value of "options.include-wildcards" from build.conf.
>
> ------------------------------------------------------------------------
> r15429 | djames | 2005-07-26 00:19:34 -0400 (Tue, 26 Jul 2005) | 14 lines
>
> Move swig-related includes into their own section, so as to ensure
> that they aren't installed with the rest of the header files.
> Followup to r15407.
>
> * build.conf:
> (options.includes): Remove SWIG-related includes.
> (options.swig-includes): Add. Defines SWIG-related includes.
> * build/generator/gen_base.py:
> (GeneratorBase.__init__): Extract SWIG-related includes from
> build.conf and save as self.swig_includes.
> (GeneratorBase.compute_hdrs): Include swig_includes in our
> list of header files.
>
>
> ------------------------------------------------------------------------
> r15428 | djames | 2005-07-26 00:11:08 -0400 (Tue, 26 Jul 2005) | 43 lines
>
> Autogenerate Python proxy classes for all SVN datatypes and a
> limited number of APR datatypes. Python proxy classes offer
> greater flexibility than standard SWIG datatypes.
>
> * Makefile.in:
> (SWIG_INCLUDES): Add $(SWIG_SRC_DIR)/proxy to list of includes
> * autogen.sh: Create SWIG headers by calling gen-make.py -t swig
> * gen-make.py:
> (gen_modules): Add SWIG header generation module
> * build.conf:
> (options.includes): Add $(SWIG_SRC_DIR)/proxy/*.swg to list of
> includes
> (options.swig-proxy-dir): Add. Points to $(SWIG_SRC_DIR)/proxy
> * build/generator/gen_swig.py: New file. Generate SWIG headers
> with simple Python proxy classes automatically.
> * subversion/bindings/swig/perl/native/Makefile.PL.in:
> ($swig_command): Add $(swig_srcdir/proxy) to list of includes
> * subversion/bindings/swig/proxy/apr_h.swg: New file. Includes
> "apr.h" and defines proxy classes.
> * subversion/bindings/swig/include/proxy.swg:
> New file. Defines a new proxy class interface for all Python classes.
> * subversion/bindings/swig/proxy/proxy_apr.swg:
> Proxy class interface for APR. With APR, we only want to generate
> a limited number of proxy class objects, so I created this file
> manually.
> * subversion/bindings/swig/svn_ra.i,
> subversion/bindings/swig/svn_repos.i,
> subversion/bindings/swig/svn_delta.i,
> subversion/bindings/swig/svn_client.i,
> subversion/bindings/swig/include/apr.swg,
> subversion/bindings/swig/include/svn_types.swg: Use new autogenerated
> SWIG interface files for includes.
> * subversion/bindings/swig/svn_wc.i: Add svn_ra.i as dependency. Use new
> autogenerated SWIG interface files for includes.
> * subversion/bindings/swig/core.i: Add proxy APR classes via proxy_apr.swg.
> Use new autogenerated SWIG interface files for includes.
> * subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c:
> Use the "_pool" attribute to identify pools, instead of the
> "assert_valid" attribute. The "assert_valid" attribute is no
> longer a unique identifier for the Pool class thanks to the new
> proxy classes which also define "assert_valid".
>
>
> ------------------------------------------------------------------------
> r15426 | djames | 2005-07-25 16:29:33 -0400 (Mon, 25 Jul 2005) | 6 lines
>
> * build/generator/gen_base.py:
> (IncludeDependencyInfo._re_include): Don't allow semicolons in the names
> of include files. This change allows us to correctly parse include
> statements such as %include import.i;
>
>
> ------------------------------------------------------------------------
> r15425 | djames | 2005-07-25 15:09:10 -0400 (Mon, 25 Jul 2005) | 7 lines
>
> * build/generator/gen_base.py:
> (GeneratorBase.compute_hdr_deps): Move code for computing a list of
> the header files into a separate function called "compute_hdrs". Add
> doc strings.
> (GeneratorBase.compute_hdrs): New function.
>
>
> ------------------------------------------------------------------------
> r15418 | djames | 2005-07-24 23:11:11 -0400 (Sun, 24 Jul 2005) | 4 lines
>
> Merge r15413:r15417 from trunk so we will have access to the nls_init
> function. Thanks Kouhei!
>
>
> ------------------------------------------------------------------------
> r15417 | djames | 2005-07-24 22:18:51 -0400 (Sun, 24 Jul 2005) | 29 lines
>
> Switch all SWIG libraries to use the $descriptor(type) convention
> instead of using svn_descriptor(type) or SVN_TypeQuery(type).
> $descriptor(type) is faster and more reliable than SWIG_TypeQuery
> because it imports types at compile time. Follow-up to r15412 and
> r15407.
>
> * swig/core.i:
> (apr_header_t *providers, apr_hash_t **cfg_hash):
> Rename svn_descriptor(type *) to $descriptor(type *).
> * swig/include/svn_global.swg:
> (svn_descriptor): Remove macro.
> * swig/include/svn_types.swg:
> (apr_hash_t **dirents):
> Rename SWIG_TypeQuery("type *") to $descriptor(type *).
> * swig/svn_client.i:
> (array_header_t **props, apr_hash_t *config,
> apr_array_header_t *wcprop_changes):
> Rename SWIG_TypeQuery("type *") to $descriptor(type *).
> * swig/svn_fs.i:
> (apr_hash_t **entries_p, apr_hash_t **changed_paths_p):
> Rename svn_descriptor(type *) to $descriptor(type *).
> * swig/svn_wc.i:
> (apr_hash_t **entries):
> Rename svn_descriptor(type *) to $descriptor(type *).
> * swig/svn_repos.i:
> (apr_hash_t **locks):
> Rename svn_descriptor(type *) to $descriptor(type *).
>
>
> ------------------------------------------------------------------------
> r15414 | djames | 2005-07-24 18:12:26 -0400 (Sun, 24 Jul 2005) | 2 lines
>
> Weekly merge from trunk.
>
> ------------------------------------------------------------------------
> r15413 | djames | 2005-07-24 17:59:09 -0400 (Sun, 24 Jul 2005) | 21 lines
>
> Move apr.i, svn_types.i, and svn_string.i into the include directory
> and rename their extension from ".i" to ".swg". These files are include
> files, not interface files.
>
> * subversion/bindings/swig/apr.swg,
> subversion/bindings/swig/svn_types.swg,
> subversion/bindings/swig/svn_string.swg:
> Rename include files to have ".swg" extension.
> * subversion/bindings/swig/apr.i,
> subversion/bindings/swig/svn_types.i,
> subversion/bindings/swig/svn_string.i:
> Remove files.
> * subversion/bindings/swig/core.i,
> subversion/bindings/swig/svn_ra.i,
> subversion/bindings/swig/svn_wc.i,
> subversion/bindings/swig/svn_client.i,
> subversion/bindings/swig/svn_repos.i,
> subversion/bindings/swig/svn_delta.i:
> Update references to apr.swg, svn_types.swg, and svn_string.swg
>
>
> ------------------------------------------------------------------------
> r15412 | djames | 2005-07-24 17:43:52 -0400 (Sun, 24 Jul 2005) | 17 lines
>
> Rename svn_swigtype(p, type) to svn_descriptor(type *).
> Use $descriptor(type) SWIG feature to reliably extract typenames.
>
> * swig/core.i:
> (apr_header_t *providers, apr_hash_t **cfg_hash):
> Rename svn_swigtype(p, type) to svn_descriptor(type *).
> * swig/svn_fs.i:
> (apr_hash_t **entries_p, apr_hash_t **changed_paths_p):
> Rename svn_swigtype(p, type) to svn_descriptor(type *).
> * swig/svn_wc.i:
> (apr_hash_t **entries):
> Rename svn_swigtype(p, type) to svn_descriptor(type *).
> * swig/svn_repos.i:
> (apr_hash_t **locks):
> Rename svn_swigtype(p, type) to svn_descriptor(type *).
>
>
> ------------------------------------------------------------------------
> r15411 | djames | 2005-07-24 17:22:06 -0400 (Sun, 24 Jul 2005) | 33 lines
>
> Wrap calls to SWIG_ConvertPtr, SWIG_NewPointerObj and
> SWIG_TypeQuery using svn_swig_ConvertPtr, svn_swig_NewPointerObj,
> and svn_swig_TypeQuery.
>
> * subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c:
> (svn_swig_TypeQuery): New macro. Wrapper for SWIG_TypeQuery.
> (svn_swig_NewPointerObj): New function. Wrapper for SWIG_NewPointerObj.
> (svn_swig_NewPointerObjString): New function. Wrapper for SWIG_NewPointerObj
> which accepts the typename as a string.
> (svn_swig_ConvertPtr): New function. Wrapper for SWIG_ConvertPtr.
> (svn_swig_ConvertPtrString): New function. Wrapper for SWIG_ConvertPtr
> which accepts the typename as a string.
> (make_pointer): Removed. Replaced by SWIG_NewPointerObjString.
> (make_ob_pool, make_ob_window, make_ob_status, make_ob_lock,
> make_ob_fs_root, make_ob_server_cert_info):
> Use svn_swig_NewPointerObjString instead of make_pointer.
> (convert_to_swigtype):
> Use svn_swig_NewPointerObjString instead of SWIG_NewPointer and
> SWIG_TypeQuery.
> (svn_swig_py_auth_simple_prompt_func,
> svn_swig_py_auth_username_prompt_func,
> svn_swig_py_auth_ssl_server_trust_prompt_func,
> svn_swig_py_auth_ssl_client_cert_prompt_func,
> svn_swig_py_auth_ssl_client_cert_pw_prompt_func):
> Use svn_swig_ConvertPtrString instead of SWIG_ConvertPtr and SWIG_TypeQuery.
> (svn_swig_py_log_receiver): Use svn_swig_TypeQuery instead of SWIG_TypeQuery.
> * subversion/bindings/python/libsvn_swig_py/swigutil_py.h:
> (svn_swig_NewPointerObj, svn_swig_ConvertPtr): Add declarations for new
> functions.
> * subversion/bindings/swig/core.i:
> (apr_header_t *providers): Use svn_swig_ConvertPtr instead of
> SWIG_ConvertPtr.
>
> ------------------------------------------------------------------------
> r15409 | djames | 2005-07-24 16:44:10 -0400 (Sun, 24 Jul 2005) | 4 lines
>
> * subversion/bindings/swig/svn_fs.i:
> (apr_hash_t **changed_paths): Fix parentheses. Follow up to r15407.
>
>
> ------------------------------------------------------------------------
> r15408 | djames | 2005-07-24 16:42:22 -0400 (Sun, 24 Jul 2005) | 8 lines
>
> Add $(SWIG_SRC_DIR)/include to list of included directories for Perl.
> Follow up to r15407.
>
> * python-bindings-improvements/subversion/bindings/swig/perl:
> (swig_command): Add $swig_src_dir/include to list of included
> directories for perl.
>
>
> ------------------------------------------------------------------------
> r15407 | djames | 2005-07-24 16:06:51 -0400 (Sun, 24 Jul 2005) | 28 lines
>
> Refactor SWIG interface files to use svn_swigtype macro
> instead of hardcoded SWIGTYPE. Define svn_swigtype macro
> in svn_global.swg and include svn_global.swg in all SWIG
> interface files.
>
> * Makefile.in:
> (SWIG_INCLUDES): Add $(SWIG_SRC_DIR)/include to list of included directories.
> * build.conf:
> (options.includes): Add SWIG include directory to list of includes.
> * subversion/bindings/swig/include/svn_global.swg:
> New file. Defines svn_swigtype macro.
> * subversion/bindings/swig/core.i:
> (apr_header_t *providers, apr_hash_t **cfg_hash):
> Use svn_swigtype instead of hardcoded SWIGTYPE. Include svn_global.swg.
> * subversion/bindings/swig/svn_fs.i:
> (apr_hash_t **entries_p, apr_hash_t **changed_paths_p):
> Use svn_swigtype instead of hardcoded SWIGTYPE. Include svn_global.swg.
> * subversion/bindings/swig/svn_wc.i:
> (apr_hash_t **entries):
> Use svn_swigtype instead of hardcoded SWIGTYPE. Include svn_global.swg.
> * subversion/bindings/swig/svn_repos.i:
> (apr_hash_t **locks):
> Use svn_swigtype instead of hardcoded SWIGTYPE. Include svn_global.swg.
> * subversion/bindings/swig/svn_delta.i, subversion/bindings/swig/client.i,
> subversion/bindings/swig/svn_ra.i:
> Include svn_global.swg.
>
>
> ------------------------------------------------------------------------
> r15406 | djames | 2005-07-24 15:26:23 -0400 (Sun, 24 Jul 2005) | 4 lines
>
> * build/generator/gen_base.py:
> (GeneratorBase.compute_hdr_deps): Remove trailing semicolon
>
>
> ------------------------------------------------------------------------
> r15405 | djames | 2005-07-24 15:24:14 -0400 (Sun, 24 Jul 2005) | 5 lines
>
> * build/generator/gen_base.py:
> (GeneratorBase.compute_hdr_deps): Include .swg files in
> dependency calculations
>
>
> ------------------------------------------------------------------------
> r15397 | djames | 2005-07-23 13:12:20 -0400 (Sat, 23 Jul 2005) | 13 lines
>
> Pass in typename of pool as argument to svn_swig_py_convert_pool.
>
> * subversion/bindings/swig/svn_types.i:
> (svn_swig_py_convert_pool): Pass in typename of pool as argument
> to svn_swig_py_convert_pool.
>
> * subversion/bindings/swig/swigutil_py.h:
> (svn_swig_py_convert_pool): Accept typename of pool as argument.
>
> * subversion/bindings/swig/swigutil_py.c:
> (svn_swig_py_convert_pool): Accept typename of pool as argument.
>
>
> ------------------------------------------------------------------------
> r15396 | djames | 2005-07-23 13:05:15 -0400 (Sat, 23 Jul 2005) | 10 lines
>
> Test suite for Pythonic pools.
>
> * subversion/bindings/swig/python/tests/pool.py:
> New file. Contains test case for the new automatic pool management
> infrastructure.
>
> * subversion/bindings/swig/python/tests/run_all.py:
> New file. Run all of the Python test cases.
>
>
> ------------------------------------------------------------------------
> r15381 | djames | 2005-07-21 16:27:23 -0400 (Thu, 21 Jul 2005) | 14 lines
>
> Update dependency generator to parse %include and %import statements in
> SWIG interface files.
>
> * build/generator/gen_base.py:
> (GeneratorBase.compute_hdr_deps): Include SWIG interface files in
> the list of dependencies.
>
> (TargetSWIG.add_dependencies): Look in SWIG source directories for
> dependencies.
>
> (IncludeDependencyInfo._re_include): Parse SWIG %import and %include
> definitions.
>
>
> ------------------------------------------------------------------------
> r15373 | djames | 2005-07-20 01:15:40 -0400 (Wed, 20 Jul 2005) | 30 lines
>
> Improve performance of pool validation from O(N) to O(1).
> Instead of asking child pools to constantly check whether
> the parent pool still exists, we now notify child pools
> when parent pools are deleted.
>
> * subversion/bindings/swig/python/svn/core.py
> (_mark_weakpool_invalid): Mark a child pool as invalid
>
> (Pool.__init__): Use self._mark_valid procedure to mark
> self as valid, instead of using clear counters
>
> (Pool.valid): Check validity of pool by looking for
> member variable, instead of recursively checking parents
>
> (Pool.clear): Use self._mark_valid to mark that pool has
> been cleared, instead of incrementing a clear counter.
>
> (Pool.destroy): Use self._mark_invalid to mark that pool
> has been destroyed. Move code for deleting member variables
> into self._mark_invalid.
>
> (Pool._mark_valid): Mark pool as valid, and set up
> callbacks to mark pool as invalid when parents are
> destroyed. Use weakreference to refer to self so as
> to avoid reference cycles in closure.
>
> (Pool._mark_invalid): Mark pool as invalid. Free up
> memory by deleting unneeded member variables.
>
>
> ------------------------------------------------------------------------
> r15371 | djames | 2005-07-19 22:20:28 -0400 (Tue, 19 Jul 2005) | 14 lines
>
> Convert poolAttribute, assertValid, and emptyTuple from casted
> "char *" variables into "char[]" variables so as to avoid
> unsafe casts.
>
> Thread: http://svn.haxx.se/dev/archive-2005-07/0796.shtml
> Suggested By: Philip Martin <philip@codematters.co.uk>
> (Thanks Philip! Good catch!)
>
> * subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
> (Automatic Pool Management Functions): Convert poolAttribute,
> assertValid, and emptyTuple from (char *) variables into char[]
> variables.
>
>
> ------------------------------------------------------------------------
> r15370 | djames | 2005-07-19 16:54:49 -0400 (Tue, 19 Jul 2005) | 70 lines
>
> Implement Pythonic pool management for the Python bindings.
>
> Assisted by: Mark Rowe <code@bdash.net.nz>
> (Mark donated his automatic pool management code as a starting point
> for my patch. Thanks Mark!)
>
> * subversion/bindings/swig/core.i
> (svn_swig_py_set_application_pool, svn_swig_py_clear_application_pool,
> svn_swig_py_get_application_pool): New wrappers for new functions.
>
> * subversion/bindings/swig/python/svn/core.py
> (run_app, svn_pool_destroy, svn_pool_create, svn_pool_clear):
> Deprecate. Reimplemented interface using Pythonic pools.
>
> (apr_pool_clear, apr_pool_destroy): Remove functions. These functions
> can be accessed by directly including libsvn.core. I did not create a
> compatibility layer for these functions because svn_pool_clear and
> svn_pool_destroy are favored over apr_pool_clear and apr_pool_destroy.
>
> (apr_initialize, apr_terminate): Deprecate. APR initialization and
> termination is now handled automatically. Old functions are now no-ops.
>
> (application_pool): New variable. Global application pool.
>
> (Pool): New object. A Pythonic pool object, managed by Python.
>
> (Pool.init): New method. Create a new memory pool.
>
> (Pool.valid): New method. Check whether this memory pool is still valid.
>
> (Pool.assert_valid): New method. Assert that this memory_pool is still
> valid.
>
> (Pool.clear): New method. Clear embedded memory pool.
>
> (Pool.destroy): New method. Destroy embedded memory pool.
>
> (Pool.__del__): New method. Automatically destroys memory pools, if
> necessary.
>
> * subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
> (_global_pool): New variable. Contains application pool.
> Intentionally uses same variable name as function-level global pool
> so that the SWIG/C code will fall-back to the application-level pool
> if no function-level global pool is available.
>
> (svn_swig_py_set_application_pool): New function. Sets the
> application-level global pool.
>
> (svn_swig_py_clear_application_pool): New function. Clears the
> application-level global pool.
>
> (svn_swig_py_get_application_pool): New function. Gets the
> application-level global pool.
>
> (svn_swig_py_convert_pool): New function. Converts a Python pool
> object into a SWIG Pool object. Raises a Python AssertionError or
> TypeError if the Python pool object is invalid.
>
> * subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h
> (_global_pool): Add declaration for new global variable.
> (svn_swig_py_set_application_pool, svn_swig_py_clear_application_pool,
> svn_swig_py_get_application_pool, svn_swig_py_convert_pool): Add
> declarations for new functions.
>
> * subversion/bindings/swig/svn_types.i
> (apr_pool_t): Update typemap for apr_pool_t to convert Python pools
> into APR pools, and to use the application-level pool if no local
> pool is available.
>
> ------------------------------------------------------------------------
> r15369 | djames | 2005-07-19 16:29:50 -0400 (Tue, 19 Jul 2005) | 5 lines
>
> Renamed python branch to python-bindings-improvements.
>
> Suggested by: C. Michael Pilato <cmpilato@collab.net>
>
>
> ------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 4 19:13:00 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.