trow


Patch
r844138, r844124, r843810, r843497, r843485, r843469, r843455, r843183

r843183 | trow | 2002-08-31 20:02:08 +0000 (Sat, 31 Aug 2002)

This fixes a few small bugs in the Client library bindings.

* bindings/swig/svn_client.i:
  - Fixed a crash in the 'out' %typemap that converts an apr_array_header_t
    into a python list.
  - Added %typemaps for const char *xml_src and const char *xml_dst that
    explicitly allow these arguments to be 'None' in python.



r843455 | trow | 2002-10-17 06:56:36 +0000 (Thu, 17 Oct 2002)


A few bindings-related changes.

* Makefile.in
  Modified the 'install-swig-py-ext' rule to install into the correct
  prefix.

* subversion/bindings/swig/swigutils_py.h
* subversion/bindings/swig/swigutils_py.c
  (svn_swig_py_notify_func): Added.  This is a notify callback that
  "thunks" the arguments into a python function call.

* subversion/bindings/swig/svn_client.i
  Added swig magic for handling svn_wc_notify_func_t/baton pairs.
  



r843469 | trow | 2002-10-18 05:46:53 +0000 (Fri, 18 Oct 2002)


This is another chunk of work towards getting the python bindings into shape.
My goal is to just get things more-or-less working --- there is some ugly,
graceless stuff in here that should be cleaned up later.

* subversion/bindings/swig/apr.i
  Added a typemap for apr_file_t *.

* subversion/bindings/swig/svn_string.i
  Added a cast to the const apr_array_header_t * typemap tTo suppress
  a compiler warning.

* subversion/bindings/swig/svn_client.i
  %import svn_opt.i and don't %ignore svn_client_commit, svn_client_log
  and svn_client_diff.

* subversion/bindings/swig/svn_opt.i
  Added.  SWIGification of svn_opt.h, which we particularly need for
  the definition of svn_opt_revision_t.

* subversion/bindings/swig/python/setup.py
  Added the proper incantation to make sure that svn_opt.i gets processed.

* subversion/bindings/swig/swigutil_py.h
* subversion/bindings/swig/swigutil_py.c
  Added more glue code for the python bindings.
  (svn_swig_py_make_file): Converts a PyObject * to an apr_file_t.
  (svn_swig_py_make_opt_revision): Converts a PyObject * to an 
    svn_opt_revision_t *.



r843485 | trow | 2002-10-20 06:47:13 +0000 (Sun, 20 Oct 2002)


A small fix.

* subversion/bindings/swig/python/setup.py
  Our _util module needs to link against the svn_swig_py-1 library.



r843497 | trow | 2002-10-21 06:04:26 +0000 (Mon, 21 Oct 2002)


Greg Stein has (very wisely) suggested that the bindings for svn_opt.h
should be inside of the _util extension.  This gets rid of the
_opt namespace that I created in revision 3395 and lets SWIG do more 
of the work.

* subversion/bindings/swig/svn_opt.i
  Deleted.

* subversion/bindings/swig/svn_client.i
  Remove the %import of svn_opt.i

* subversion/bindings/swig/python/setup.py
  Removed the code to build the opt stuff.

* subversion/bindings/swig/swigutils_py.h
* subversion/bindings/swig/swigutils_py.c
  Removed my misbegotten python -> svn_opt_revision_t marshaller.

* subversion/bindings/swig/util.i
  Included svn_opt.h.



r843810 | trow | 2002-11-11 22:31:26 +0000 (Mon, 11 Nov 2002)


These are a few small changes to fix the bindings for svn_client_ls.

* util.i
  Commented out an "%ignore svn_dirent" directive, since we need those
  wrappers to be generated.

* svn_client.i
  Added a typemap to deal with the apr_hash_t of svn_dirent_t's returned
  by svn_client_ls.



r844124 | trow | 2002-12-07 22:11:26 +0000 (Sat, 07 Dec 2002)


Added code to make the swig bindings release python's global
interpreter lock before calling the subversion function being bound,
and to re-acquire the lock after the call is complete.  This allows us
to perform slow operations in a python thread without blocking
the execution of other python code.

* subversion/bindings/swig/svn_types.i:
  Added an %exception block to release/acquire the interpreter lock
  around our function calls.

* subversion/bindings/swig/swigutil_py.c:
  (release_py_lock): Added.  Releases the python interpreter lock and
    saves the thread state.
  (acquire_py_lock): Added.  Reacquires the interpreter lock and
    restores the thread state.
  (close_baton): Reacquire the lock before trying to evaluate any python
    code, the release the lock before returning.
  (thunk_set_target_revision): Ditto.
  (thunk_open_root): Ditto.
  (thunk_delete_entry): Ditto.
  (thunk_add_directory): Ditto.
  (thunk_open_directory): Ditto.
  (thunk_change_dir_prop): Ditto.
  (thunk_add_file): Ditto.
  (thunk_open_file): Ditto.
  (thunk_window_handler): Ditto.
  (thunk_apply_textdelta): Ditto.
  (thunk_change_file_prop): Ditto.
  (svn_swig_py_notify_func): Ditto.
  (svn_swig_py_get_commit_log_func): Ditto.
  (svn_swig_py_thunk_log_receiver): Ditto.



r844138 | trow | 2002-12-09 07:46:22 +0000 (Mon, 09 Dec 2002)


OK, now I understand a bit more about how python's threads work.  It
turns out that the python thread API puts the burden on us to do some
of their bookkeeping and track some data on a per-thread basis.
Luckily, apr provides a wrapper around pthread_{set,get}specific so
that we can do this in a portable way.

* swigutil_py.c
  (release_py_lock) Store the PyThreadState in the thread's private
    address space.
  (acquire_py_lock) When re-acquiring the interpreter lock, get the
    PyThreadState from the thread's private address space.