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

RE: Re: Java Question

From: Dan Pozmanter <dan_at_siteworx.com>
Date: 2006-08-02 02:54:35 CEST

Is there any code I can check out to start looking through?

Comments inline.

Best,
Dan

> -----Original Message-----
> From: Daniel Rall [mailto:dlr@collab.net]
> Sent: Tue 8/1/2006 6:50 PM
> To: Dan Pozmanter
> Cc: dev@subversion.tigris.org
> Subject: Re: Java Question
>
> On Tue, 01 Aug 2006, Dan Pozmanter wrote:
>
> > Hmmm, that sounds nice. I suppose I am biased towards dev time itself.
> > I will be able to go straight in without auth.
>
> Okay. Subversion has two layers which you might be interested in --
> libsvn_repos, and libsvn_fs. It sounds like libsvn_fs would be more
> useful to you. Should also/instead expose a repos layer, or is
> SVNClient sufficient API here?
>
We should probably expose both.
>
> > Perhaps:
> > (pools would be automatic)
>
> Yup. Pools are currently managed in the C++ JNI code using
> thread-local storage. This should work fine for a repository or FS
> class.
>
>
Super Sweet!

> The pseudo-code you listed below is quite helpful. More comments
> in-line...
>
>
> > svnConnection conn = new svnConnection(reposPath);
>
> Is this a connection to the repos (the thing that Subversion's RA
> layer talks to, like svnserve or mod_dav_svn), or directly to the FS?
>
> While I rather like how you've made this object look JDBC
> Connection-like, how about calling it what it is instead
> (e.g. SVNFileSystem or SVNRepository)?
>
SVNFileSystem and SVNRepository both sound great.
>
> > conn.begin();
>
> If we stayed with the Connection metaphor (or are talking directly to
> the FS), I'd suggest beginTrans().

This would be a matter of taste. I would prefer begin, or beginTransaction.

>
> > svnPath sp = new svnPath(conn, path);
>
> A slightly different usage pattern involving retrofitting the existing
> org.tigris.subversion.javahl.Path class or using a basic data type
> like java.lang.String. See below.
>
> > sp.getLogs();
>
> I wouldn't think that we need an explicit transaction to retrieve
> logs. This functionality is already available through SVNClient, but
> involved auth.
>

We'd want to allow local auth free manipulation, so anything available
through the client should ideally be available through the repos and fs
libs we implement.

>
> > sp.move(newpath);
> > sp.add(object);
>
> Allowing a series of editor-esque operation here inside the
> transaction sounds good. What do the other bindings allow?
>
> conn.move(srcPath, destPath);
> conn.addFile(targetInputStream, targetPath);
>
I like this alot.
>
> > svnFile f = sp.getFile(subpath);
> > f.read(); //Whole String
> > f.write(data); //Whole String
>
> I'm not sure that I follow these.

The idea would be some object which represents a file in svn.
So methods to read and write to this file would be quite useful.

> > conn.commit(msg);
>
> commitTrans(), I take it?

Indeedily

> > conn.rollback();
>
> This would typically be found in a catch block?

Typically.

>
> > -----Original Message-----
> > From: Daniel Rall [mailto:dlr@collab.net]
> > Sent: Tuesday, August 01, 2006 5:30 PM
> > To: Dan Pozmanter
> > Cc: dev@subversion.tigris.org
> > Subject: Re: Java Question
> >
> > On Tue, 01 Aug 2006, Dan Pozmanter wrote:
> >
> > > Swig/Java API
> > >
> > > I think we should precisely mirror the c api.
> > > This will be faster to write, and the same docs/experience exists.
> >
> > Experience with the bindings -- especially the Python bindings -- has
> > shown us that typical users want language bindings with the look and
> > feel of APIs they're familiar with in that language.
> >
> > Which is to say, Java APIs should look like Java APIs, not C APIs.
> >
> >
> > > Here are a few example python lines:
> > >
> > > fs.node_history(connection._v_root, self.svnpath, pool)
> > >
> > > stream = fs.file_contents(repository_root, target_path, pool) data =
> > > util.svn_stream_read(stream, CHUNK_SIZE)
> > >
> > > if kind_of_node == core.svn_node_none:
> > > return ()
> > > elif kind_of_node != core.svn_node_dir:
> > > return (target_path, self.GetFileData(repository_root,
> > target_path,
> > > pool))
> > >
> > > svn_pool_destroy(pool)
> > >
> > > revision = fs.youngest_rev(fs, pool)
> >
> > This example is quite helpful, but deals with the libsvn_fs API. I
> > assumed that you were trying to get the data via the RA layer. Is this
> > not the case? Can you go straight to the repository's file system with
> > no need for auth?
> >
> > Please elaborate on the specifics of what you're trying to do.
>
>
>
Received on Wed Aug 2 02:55:08 2006

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.