You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Robert Koberg <ro...@koberg.com> on 2002/11/02 15:58:14 UTC

request for simple example: commit or update a file with java

Hi,

Can anybody post a simple, basic example of the best way to perform a commit or
update from within a java app? Lets say the app lives on the same machine as the
subversion repos. Is there any way to pass the commit info as headers in a http
response? Is the only way, currently, to do a Runtime.exec()? Any advice is
appreciated.

I remember seeing some posts on somebody doing some work on the java bindings.
has that gotten anywhere? I can do some QA if or when ready.

Thanks,
-Rob



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

Re: request for simple example: commit or update a file with java

Posted by Daniel Rall <dl...@finemaltcoding.com>.
"Robert Koberg" <ro...@koberg.com> writes:

> Hi,
> 
> Can anybody post a simple, basic example of the best way to perform
> a commit or update from within a java app? Lets say the app lives on
> the same machine as the subversion repos. Is there any way to pass
> the commit info as headers in a http response? Is the only way,
> currently, to do a Runtime.exec()? Any advice is appreciated.
> 
> I remember seeing some posts on somebody doing some work on the java bindings.
> has that gotten anywhere? I can do some QA if or when ready.

As Mike said, Runtime.exec() is your best bet.

The Ant <http://jakarta.apache.org/ant/> folks indicated they were
working on an Ant Task to do just this.  As a Task is basically just a
JavaBean with an exec() method to trigger the Task's action based on
the state of the bean attributes, this is likely to serve your
purposes just dandy (assuming they've actually implemented this Task
-- let us know if they haven't had a chance yet).  You can reach them
here:  <ma...@jakarta.apache.org>

-- 

Daniel Rall <dl...@finemaltcoding.com>

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

Re: request for simple example: commit or update a file with java

Posted by Daniel Rall <dl...@finemaltcoding.com>.
cmpilato@collab.net writes:

> "Robert Koberg" <ro...@koberg.com> writes:
> 
> > Hi,
> > 
> > Am I asking something totally stupid? Can anybody give me some hints
> > (offlist if this is an offtopic question)?
> 
> Stupid?  Heck, no.  You just asked on a weekend. :-)
> 
> > > Can anybody post a simple, basic example of the best way to perform a
> > > commit or update from within a java app? Lets say the app lives on
> > > the same machine as the subversion repos. Is there any way to pass
> > > the commit info as headers in a http response? Is the only way,
> > > currently, to do a Runtime.exec()? Any advice is appreciated.
> 
> Currently, yes, you'll need to use something like Runtime.exec() --
> effectively running system() on the Subversion command-line client.
> The Java SWIG bindings aren't yet mature enough for you to use them
> directly.  Contributions here would be appreciated, of course.

Speaking of which, I'm feeling like I should check in my JNI/SWIG
patch.  I haven't done any more work on it, but it doesn't seem to
break the build and it's not like anyone else can work on it with it
just sitting on my machine.  ;-)

Please speak up if this is likely to cause you merge conflicts or
other woes.
-- 

Daniel Rall <dl...@finemaltcoding.com>

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

Re: request for simple example: commit or update a file with java

Posted by cm...@collab.net.
"Robert Koberg" <ro...@koberg.com> writes:

> Hi,
> 
> Am I asking something totally stupid? Can anybody give me some hints
> (offlist if this is an offtopic question)?

Stupid?  Heck, no.  You just asked on a weekend. :-)

> > Can anybody post a simple, basic example of the best way to perform a
> > commit or update from within a java app? Lets say the app lives on
> > the same machine as the subversion repos. Is there any way to pass
> > the commit info as headers in a http response? Is the only way,
> > currently, to do a Runtime.exec()? Any advice is appreciated.

Currently, yes, you'll need to use something like Runtime.exec() --
effectively running system() on the Subversion command-line client.
The Java SWIG bindings aren't yet mature enough for you to use them
directly.  Contributions here would be appreciated, of course.

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

Re: request for simple example: commit or update a file with java

Posted by Philip Martin <ph...@codematters.co.uk>.
"Robert Koberg" <ro...@koberg.com> writes:

> Am I asking something totally stupid? Can anybody give me some hints (offlist if
> this is an offtopic question)?

It's on-topic, it's just I don't think we have that many Java
programmers.

> > -----Original Message-----
> > From: Robert Koberg [mailto:rob@koberg.com]
> > Sent: Saturday, November 02, 2002 7:58 AM
> > To: dev@subversion.tigris.org
> > Subject: request for simple example: commit or update a file with java
> >
> >
> > Hi,
> >
> > Can anybody post a simple, basic example of the best way to perform a
> > commit or update from within a java app? Lets say the app lives on
> > the same machine as the subversion repos. Is there any way to pass
> > the commit info as headers in a http response? Is the only way,
> > currently, to do a Runtime.exec()? Any advice is appreciated.

I'm not a Java programmer, and I'm not quite sure what you want.  If
you are using http then whether the app and the repository are on the
same machine is irrelevant.

If you have a mod_dav_svn server then you certainly can talk to it
using http, but generating the correct commit http without using the
subversion libraries is quite a complex tast.  That's what the
libraries are for.

I assume your app is manipulating a local working copy, in which case
you want to call svn_client_commit.  This is a C function so, as far
as I know, this means you need a JNI wrapper for it.  This wrapper
could be generated by SWIG (I know as much about SWIG as I do about
Java :) or you could create it manually.

> > I remember seeing some posts on somebody doing some work on the java
> > bindings. has that gotten anywhere? I can do some QA if or when ready.

-- 
Philip Martin

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

RE: request for simple example: commit or update a file with java

Posted by Robert Koberg <ro...@koberg.com>.
Hi,

Am I asking something totally stupid? Can anybody give me some hints (offlist if
this is an offtopic question)?

thanks,
-Rob

> -----Original Message-----
> From: Robert Koberg [mailto:rob@koberg.com]
> Sent: Saturday, November 02, 2002 7:58 AM
> To: dev@subversion.tigris.org
> Subject: request for simple example: commit or update a file with java
>
>
> Hi,
>
> Can anybody post a simple, basic example of the best way to perform a
> commit or update from within a java app? Lets say the app lives on
> the same machine as the subversion repos. Is there any way to pass
> the commit info as headers in a http response? Is the only way,
> currently, to do a Runtime.exec()? Any advice is appreciated.
>
> I remember seeing some posts on somebody doing some work on the java
> bindings. has that gotten anywhere? I can do some QA if or when ready.
>
> Thanks,
> -Rob



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