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

Re: ctypes + Subversion + a few high level python modules = really great python bindings

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: 2007-04-10 04:44:50 CEST

Sage La Torra wrote:
> On 4/9/07, David James <james@cs.toronto.edu> wrote:
...
>> Here's an example code snippet, which atomically replaces the "abc"
>> branch at "http://svn.collab.net/repos/svn/branches/abc" with a brand
>> new copy of trunk. This code snippet is useful for folks who want to
>> rebranch in a single atomic commit.
>>
>> client = Client("http://svn.collab.net/repos/svn")
>> txn = client.session().txn()
>> client.rm("branches/abc")
>> client.cp("trunk", "branches/abc")
>> txn.commit("Rebranch the abc branch from the latest revision of
>> trunk")
>>
>> The above task is significantly easier to implement using csvn
>> high-level API than it is using the low-level C API. To implement the
>> above functionality using the low-level C API, you would need to drive
>> the commit editor by hand, much like mucc does, and this is not
>> simple.
>>
>
> I think an interface like this is great: it's close to what the user
> would do if they were doing the same thing themselves on the command
> line as opposed to in code.

I also think that such an interface would be great. I don't feel
qualified to offer an opinion on whether or not to implement it using
ctypes, but however we implement it, I *strongly* encourage a consistent
interface across language bindings. This may mean a more thorough
design discussion on this list before we finalize a generic high-level
bindings interface.

FWIW, I've been toying around with some C++ bindings for the last few
weeks, and I think the object model used for the higher-level Python
bindings would, or should, easily translate to other object-oriented
languages. It would also make writing some generic cross-layer bindings
documentation a reasonable goal.

-Hyrum

Received on Tue Apr 10 04:44:45 2007

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.