You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Petri Savolainen <pe...@iki.fi> on 2003/10/18 16:31:09 UTC

More pythonic API, direct bdb access?

While nicely complete, the python swig-generated api would benefit from
something more "pythonic" on top of it. Is anyone in process of building a
more pythonic api on top of the C-to-python swig-wrapped api?

I am thinking along the lines of something that would allow simple iteration
over the directories, entries and properties.

By the way, since python has good berkeley db support built-in now, could
someone elaborate how would accessing the svn database directly rather than
via the current api compare, in terms of effort and difficulty? 

Direct access would allow skipping the swig layer and apr stuff completely,
which would seem quite a bonus to me, even though I don't have a good idea
of what kind of overhead they bring. Having to maintain code that accesses
an internal database structure directly is, of course, a downside, but I
don't think it would be too much of an effort to abstract that and keep it
up-to-date. 

Thoughts?

 Petri


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

Re: More pythonic API, direct bdb access?

Posted by Russell Yanofsky <re...@columbia.edu>.
Petri Savolainen wrote:
> While nicely complete, the python swig-generated api would benefit
> from something more "pythonic" on top of it. Is anyone in process of
> building a more pythonic api on top of the C-to-python swig-wrapped
> api?
>
> I am thinking along the lines of something that would allow simple
> iteration over the directories, entries and properties.

Barry Scott (barry@barrys-emacs.org) recently started working on a swig
wrapper for the SvnCpp API (http://rapidsvn.tigris.org/svncpp.html). It's
not specifically pythonic, but it is oopish, and cleaner than the C api.

> By the way, since python has good berkeley db support built-in now,
> could someone elaborate how would accessing the svn database directly
> rather than via the current api compare, in terms of effort and
> difficulty?

It'd be a lot more difficult to access the database through bdb. The fs api
is actually pretty straighforward. You can see for yourself by comparing the
fs api documentation:

  http://svn.collab.net/repos/svn/trunk/subversion/include/svn_fs.h

with the schema documentation:

  http://svn.collab.net/repos/svn/trunk/subversion/libsvn_fs/structure

One reason why accessing the berkeley db directly might be harder than you'd
expect is that subversion uses it's own serialization mechanism to store
structured data in the database. See:

  http://svn.collab.net/repos/svn/trunk/subversion/libsvn_fs/util/skel.h

You'd have to either wrap this or reimplement this do to anything useful
with the database in python.

> Direct access would allow skipping the swig layer and apr stuff
> completely, which would seem quite a bonus to me, even though I don't
> have a good idea of what kind of overhead they bring. Having to
> maintain code that accesses an internal database structure directly
> is, of course, a downside, but I don't think it would be too much of
> an effort to abstract that and keep it up-to-date.
>
> Thoughts?

I'd actually like to see a few basic fs operations implemented in python. I
imagine the python implementations could be a lot cleaner than the C ones.

- Russ



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

Re: More pythonic API, direct bdb access?

Posted by Barry Scott <ba...@barrys-emacs.org>.
I agree that a pythonic API is required. I think that basing a solution
on the rapidsvn's svncpp API is a better starting point then the C API.

At 18-10-2003 17:31, Petri Savolainen wrote:
>While nicely complete, the python swig-generated api would benefit from
>something more "pythonic" on top of it. Is anyone in process of building a
>more pythonic api on top of the C-to-python swig-wrapped api?
>
>I am thinking along the lines of something that would allow simple iteration
>over the directories, entries and properties.
>By the way, since python has good berkeley db support built-in now, could
>someone elaborate how would accessing the svn database directly rather than
>via the current api compare, in terms of effort and difficulty?

Having the BDB access is only a small part of what you need to build a SVN
clone in python. There is the WebDAV protocol and the SVNserver protocol
to deal with as well.

>Direct access would allow skipping the swig layer and apr stuff completely,
>which would seem quite a bonus to me, even though I don't have a good idea
>of what kind of overhead they bring. Having to maintain code that accesses
>an internal database structure directly is, of course, a downside, but I
>don't think it would be too much of an effort to abstract that and keep it
>up-to-date.

The overhead of SWIG is not an issue.

Barry



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