On Mon, 2006-06-12 at 11:53 -0700, David James wrote:
> On 6/11/06, Jelmer Vernooij <jelmer@vernstok.nl> wrote:
> > > Could you update our test suite with a few new tests to make sure your
> > > code works? For example, you could register a few callback functions
> > > in Python and make sure they get called with appropriate arguments.
> > ra_local doesn't actually call these callbacks, which makes it very hard
> > to write tests using the file:// RA backend. Apparently ra_dav uses them
> > most often, but there are no Python tests that use it. I have used them
> > successfully here using other protocols though.
>
> Ah, OK. Jelmer, could you provide some example test scripts which use
> these functions so that I can test them myself?
I've attached an example script that does a checkout, which crashes
without this patch.
> In all new functions: Use Py_XDECREF instead of Py_DECREF.
> Py_XDECREF handles NULL values safely. Only use Py_DECREF if you are
> absolutely sure that the variable in question will not be NULL.
Fixed.
I've attached a patch that contains the subset of functions that are
proven to work now using the attached example script.
[[[
Allow some callbacks in svn_ra_callbacks2_t() to be implemented in
Python.
* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
(svn_swig_py_setup_ra_callbacks): Fill in callback function pointer
for open_tmp_file and auth_baton.
(ra_callbacks_open_tmp_file): Add wrapper for Python callbacks
]]]
Cheers,
Jelmer
--
Jelmer Vernooij <jelmer_at_samba.org> - http://samba.org/~jelmer/
Received on Thu Jul 6 01:00:47 2006