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

[PATCH] Major perl bindings update.

From: Ben Reser <ben_at_reser.org>
Date: 2003-12-19 11:04:12 CET

This is a large patch that's all in one because so many of the changes
depend on each other. In order to make the prompt callbacks work I had
to objectify the client interface so I had a place to store the SVs.

Hopefully tomorrow (US time) I can finish going through the client
methods, testing them, and writing documentation and unit tests for

I also want to figure out a better way to handle apr_hash_t's. Right
now we're converting them to perl hashes. For cases where we get a hash
and then return it back to the C API this is rather inefficent. I hope
turn the apr_hash_t's into magic variables that appear to be a normal
perl hash but are actually manipulating the C hash. But I won't know
for sure how well that will work until I try it.

In the meantime I've put an ugly hack in the $ctx->config() accessor to
allow people to be able to set the config with
SVN::Core::config_get_config(undef). The Client object does this
for you automatically now too unless you pass a config into the

I also spent a fair amount of time checking to make sure that the prompt
callbacks work in every imagineable perl construct (probably didn't
think of every way but I sure tried) and that the variables die when
the context falls out of scope.

The new handle of pools in the Client should also allow programs that
make and destroy lots of client contexts to be more efficient about
memory. In the past there was one main context that unless you made
calls to SVN::Pool would be used for all accesses. This pool would
get bigger and bigger without effort on the users part. Now each
context automatically creates it's own pool and destroys it when it
falls out of scope. This does not however, break the ability to do
things the old way. You can still pass in a pool to all the methods
and still manage the pools on your own. It just makes it by default you
can be blissfully unaware of pools in most cases.

I also put a fair amount of documentation in. It probably needs some
work but it is a start.

There is one issue that clkao and I need to figure out and that's style.
The various files all seem to have a different style to them. Some are
using tabs for indention some aren't. I left the style alone for the
most part in all the files that I messed with. I did use a consistent
style on the Client.pm file though which is slightly different from the
other perl modules. The difference is in braces, with the exception of
else lines opening brackes start are on a line by themselves so they
line up. I noticed I had a number of multi-line if's and that putting
the { on the end of them made it hard to read the blocks. If clako is
interested I'll be happy to go through and do a style cleanup on all the
files and make them consistent. But first we need to decide exactly
what the style on these perl files should be.

I'm probably forgetting to mention something. But ohh well, it's time
to go to bed.


Large perl bindings update that adds support for prompt authentication
providers, makes the Client interface object oriented, allows import
to not segfault because the client can set a config now, adds
perl client context default pool configurability, and automatically
loads the normal subversion config for the client unless they
specify otherwise.

* subversion/bindings/swig/swigutil_pl.c
* subversion/bindings/swig/swigutil_pl.h
    Add thunks for the callbacks to the various prompt callbacks
    (svn_client_get_simple_prompt, svn_client_get_username_prompt,

* subversion/bindings/swig/svn_client.i
    Add typemaps to support the thunks for prompt callbacks.
    Make the prompt providers return two parameters, one of
    which is a reference to the SV they were passed
  (svn_client_ctx_t_config_set): Make this accessor accept perl hashes,
    so that clients can load a config.

* subversion/bindings/swig/perl/t/3client.t
    New File. Start of a unit testing setup.

* subversion/bindings/swig/perl/Core.pm
  (auth_open_helper): New function to help split up the returns from the
    various auth provider functions.
  Documentation for (auth_open).

* subversion/bindings/swig/perl/Base.pm
  Implement a method of ignoring certain symbols to be imported.

* subversion/bindings/swig/perl/Client.pm
  Objectify the interface.
  Per client context default pool support.
  Support for prompt callbacks.
  Lots of Documentation.

* subversion/bindings/swig/perl/Ra.pm
  Support for prompt callbacks.


Ben Reser <ben@reser.org>
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Fri Dec 19 11:05:49 2003

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.