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

Re: [Subclipse-users] SvnClientAdapter diff() examples?

From: Nicolas Anquetil <anquetil.nicolas_at_gmail.com>
Date: Fri, 06 Jun 2008 09:49:43 +0200

On Thu, 2008-06-05 at 11:21 -0400, Mark Phippard wrote:
> On Thu, Jun 5, 2008 at 11:16 AM, Nicolas Anquetil
> <anquetil.nicolas_at_gmail.com> wrote:
> > not sure this is the right forum but I could not find another one.
> >
> > I am trying to get access to the information inside an SVN repository:
> > - what files are there, what version, what commiter, etc.
> >
> > For this I am using SvnClientAdapter.
> >
> > One thing remains to be solved: how does one use the diff() method?
> > (anyone of them actually)
> >
> > I could not figure out how it is suppose to work.
> This is a good place to ask.
> Can you provide more details about what you are trying or do not
> understand? You basically just pass the API what you want it to diff
> and a File to store the output in.


I want to get information on the various revisions of a file:
- who commited
- when
- what changed
And I want this for all revisions (and all files, but this is easy). So
I wanted to iteratively diff a file's revision with its previous
revision, and then take this previous revision and diff again with the
preceding one, ...

However, I cannot figure out how to use diff (or even what diff to use).


/** display the differences between two paths. */
diff(path, outFile, recurse)
-> what two paths are these? There is only one parameter.

/** display the differences between WC and url */
diff(path, url, urlRevision, outFile, recurse)
-> OK, this one seems more straight forward

SvnKitClientAdapter svnClientSVNUrl = new SvnKitClientAdapter();
url = new SVNUrl("file:///var/local/svn/TestSVNJavaClient");
svnClient.checkout(url, new File("/tmp/testSVN"), SVNRevision.HEAD, true);
// test one file in the project
svnClient.diff("/tmp/testSVN/src/Main.java", url, SVNRevision.PREVIOUS, new File("/tmp/testSVN/src/Main.diff"), false);

-> it gives me the following error:
Exception in thread "main" java.lang.NoSuchMethodError: org.tigris.subversion.javahl.Depth.fromRecurse(Z)I
        at org.tmatesoft.svn.core.javahl.SVNClientImpl.diff(SVNClientImpl.java:668)
        at org.tmatesoft.svn.core.javahl.SVNClientImpl.diff(SVNClientImpl.java:664)
        at org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.diff(AbstractJhlClientAdapter.java:2359)
        at Main.main(Main.java:26)

(line 26 is the diff instruction)

So I try another one:

/** display the differences between two urls */
diff(url, oldUrlRevision, newUrlRevision, outFile, recurse)

// test one file in the project
svnClient.diff(new SVNUrl("file:///var/local/svn/TestSVNJavaClient/src/Main.java"), SVNRevision.PREVIOUS, SVNRevision.HEAD, new File("/tmp/testSVN/src/Main.diff"), false);

-> gives me the same exception.

Exception in thread "main" java.lang.NoSuchMethodError: org.tigris.subversion.javahl.Depth.fromRecurse(Z)I
        at org.tmatesoft.svn.core.javahl.SVNClientImpl.diff(SVNClientImpl.java:668)
        at org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.diff(AbstractJhlClientAdapter.java:1617)
        at org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.diff(AbstractJhlClientAdapter.java:1541)
        at org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.diff(AbstractJhlClientAdapter.java:1629)
        at Main.main(Main.java:26)

As you can see, there is something I didn't get about the diff :-(
Any help will be appreciated


Dr. Nicolas Anquetil            EMN -- École des Mines de Nantes
Ingénieur de recherche          +33-02-51-85-86-98
To unsubscribe, e-mail: users-unsubscribe_at_subclipse.tigris.org
For additional commands, e-mail: users-help_at_subclipse.tigris.org
Received on 2008-06-06 09:50:02 CEST

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

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