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

Re: More pythonic API, direct bdb access?

From: Russell Yanofsky <rey4_at_columbia.edu>
Date: 2003-10-18 20:25:25 CEST

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
Received on Sat Oct 18 20:27:06 2003

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

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