James Tauber : Subversion as a Persistence Layer

James Saiz

journeyman of some

Subversion as a Persistence Layer

For almost as long as I've been working on Leonardo, I've been thinking about Subversion as a persistence layer. In fact, some of the design of Leonardo's current persistence layer (LFS = Leonardo File System) was inspired by Subversion and I've long thought about an alternative LFS implementation that sits directly on Subversion.

Adding the persistence layer to Demokritos I thought about starting out with Subversion right away so I've been doing some investigation.

The SWIG-based Python bindings that Subversion comes with scared me off pretty quickly. Then I found pysvn which provides a much more Pythonic (and well documented) interface to Subversion.

The problem is that pysvn assumes that you are checking out to a local workspace, which is not what I want. I just want to be able to send and receive Python strings, not create a workspace, have Demokritos read/write files from/to that workspace and then use pysvn to check-out/commit.

But it doesn't appear possible with pysvn. Not because of a limitation of pysvn itself but because the Subversion client API doesn't support it.

It would seem to me that it would still be possible to use Subversion the way I want to but it would involve one of

Subversion itself doesn't seem to expose the bits I need (certainly not in Python)

UPDATE: Literally seconds after posting this, Chris Curvey responded to a query I made on the pysvn mailing list and pointed me to a session given by Greg Stein at OSCON. The abstract for the session mentioned SubWiki which looks like it might be doing what I want to do (although it may still use a local workspace). Investigating more. Maybe I should just ask Greg.

UPDATE (2006-02-09): Good news! Now see Using the Python Subversion Binding.

Categories: leonardo demokritos Python subversion

Trackbacks (0)

Comments (3)

bryan on Sunday 22 January, 2006:

I think SubWiki exploits the python swig bindings (or at least, you're expected to install swig 1.3.16 first before subwiki ...).

James Saiz on Sunday 22 January, 2006:

Yes, SubWiki does use the Python SWIG bindings - but that means either that it is using a local workspace or the SWIG bindings *do* support direct repository access.

If the latter is possible, then I was misinformed. I hope so.

Xavier Vergés on Tuesday 07 February, 2006:

One of the first things that I liked about Leonardo was the Leonardo File System abstraction; at that time, I was not familiar with subversion. Once I started using subversion the connection was obvious :-)

I'm not sure if I understand what you are after. Do you want to talk to the subversion file system, to a subversion repository, to a subversion repository that may not be local...?

I'm under the impression that the SWIG bindings provide access to all the subversion layers (for most languages); but don't trust me, because I do not speak SWIG and I'm not very familiar with the different subversion layers (http://subversion.tigris.org/subversion-diagram.png)

These tests seem to access a repository http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/python/tests/repository.py?view=log

Add a Comment

What is 93+4?
Comments are text only.
The math question is to ensure you are a human!
This page last modified Thursday 09 February, 2006 by James Saiz
Content made available under a Creative Commons Attribution-NonCommercial-ShareAlike license