You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Mark Phippard <ma...@gmail.com> on 2006/11/22 01:14:59 UTC

New JavaHL features

Daniel,

Since you are doing some stuff with JavaHL lately, one to add to your 
to-do list would be some kind of support for the svn diff --summarize 
option.  I think this is something we could use in Subclipse to improve 
performance when comparing two tags of a large project.

Also, there have been those problems reported where something is up with 
the configuration area that keeps it from caching passwords and SSL certs.

Mark

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

Re: New JavaHL features

Posted by Daniel Rall <dl...@collab.net>.
On Wed, 22 Nov 2006, Daniel Rall wrote:

> On Tue, 21 Nov 2006, Mark Phippard wrote:
> 
> > Daniel,
> > 
> > Since you are doing some stuff with JavaHL lately, one to add to your 
> > to-do list would be some kind of support for the svn diff --summarize 
> > option.  I think this is something we could use in Subclipse to improve 
> > performance when comparing two tags of a large project.
> 
> Sure Mark.  Do you think the summarize option should be a parameter to
> SVNClientInterface.diff(), or a separate API entirely?  svn_client.h
> uses two separate APIs to implement 'diff' and 'diff --summarize'.

Mark, please examine the patch below which adds the Java API (but not
the corresponding JNI implementation), and see if it meets your
expectations, and the needs of Subclipse.

One point in particular that I'd like your feedback on is use of a
callback API (which is a more streamy interface) vs. an API which just
returns a list of diff summaries (which is slightly easier to use).
For comparison, see the SVNClientInterface.logMessages() API -- it
returns a LogMessage[] array, where as the underlying svn_ra_get_log()
API uses a svn_log_message_receiver_t callback and baton (the
equivalent of passing in a Java interface, as I do with the new
diffSummarize() API in the patch below).

Index: subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/SVNClientInterface.java
===================================================================
--- subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/SVNClientInterface.java	(revision 22403)
+++ subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/SVNClientInterface.java	(working copy)
@@ -587,6 +587,32 @@
             throws ClientException;
 
     /**
+     * Produce a diff summary which lists the items changed between
+     * path and revision pairs.
+     *
+     * @param target1 Path or URL.
+     * @param revision1 Revision of <code>target1</code>.
+     * @param target2 Path or URL.
+     * @param revision2 Revision of <code>target2</code>.
+     * @param recurse Whether to recurse.
+     * @param ignoreAncestry Whether to ignore unrelated files during
+     * comparison.  False positives may potentially be reported if
+     * this parameter <code>false</code>, since a file might have been
+     * modified between two revisions, but still have the same
+     * contents.
+     * @param receiver As each is difference found, this callback is
+     * invoked with a description of the difference.
+     *
+     * @exception ClientException
+     * @since 1.5
+     */
+    void diffSummarize(String target1, Revision revision1,
+                       String target2, Revision revision2,
+                       boolean recurse, boolean ignoreAncestry,
+                       DiffSummaryReceiver receiver)
+            throws ClientException;
+
+    /**
      * Retrieves the properties of an item
      * @param path  the path of the item
      * @return array of property objects
Index: subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/SVNClient.java
===================================================================
--- subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/SVNClient.java	(revision 22408)
+++ subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/SVNClient.java	(working copy)
@@ -670,6 +670,32 @@
                             boolean force) throws ClientException;
 
     /**
+     * Produce a diff summary which lists the items changed between
+     * path and revision pairs.
+     *
+     * @param target1 Path or URL.
+     * @param revision1 Revision of <code>target1</code>.
+     * @param target2 Path or URL.
+     * @param revision2 Revision of <code>target2</code>.
+     * @param recurse Whether to recurse.
+     * @param ignoreAncestry Whether to ignore unrelated files during
+     * comparison.  False positives may potentially be reported if
+     * this parameter <code>false</code>, since a file might have been
+     * modified between two revisions, but still have the same
+     * contents.
+     * @param receiver As each is difference found, this callback is
+     * invoked with a description of the difference.
+     *
+     * @exception ClientException
+     * @since 1.5
+     */
+    public native void diffSummarize(String target1, Revision revision1,
+                                     String target2, Revision revision2,
+                                     boolean recurse, boolean ignoreAncestry,
+                                     DiffSummaryReceiver receiver)
+        throws ClientException;
+
+    /**
      * Retrieves the properties of an item
      * @param path  the path of the item
      * @return array of property objects
Index: subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/SVNClientSynchronized.java
===================================================================
--- subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/SVNClientSynchronized.java	(revision 22403)
+++ subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/SVNClientSynchronized.java	(working copy)
@@ -873,6 +873,39 @@
     }
 
     /**
+     * Produce a diff summary which lists the items changed between
+     * path and revision pairs.
+     *
+     * @param target1 Path or URL.
+     * @param revision1 Revision of <code>target1</code>.
+     * @param target2 Path or URL.
+     * @param revision2 Revision of <code>target2</code>.
+     * @param recurse Whether to recurse.
+     * @param ignoreAncestry Whether to ignore unrelated files during
+     * comparison.  False positives may potentially be reported if
+     * this parameter <code>false</code>, since a file might have been
+     * modified between two revisions, but still have the same
+     * contents.
+     * @param receiver As each is difference found, this callback is
+     * invoked with a description of the difference.
+     *
+     * @exception ClientException
+     * @since 1.5
+     */
+    public void diffSummarize(String target1, Revision revision1,
+                              String target2, Revision revision2,
+                              boolean recurse, boolean ignoreAncestry,
+                              DiffSummaryReceiver receiver)
+        throws ClientException
+    {
+        synchronized (clazz)
+        {
+            diffSummarize(target1, revision1, target2, revision2,
+                          recurse, ignoreAncestry, receiver);
+        }
+    }
+
+    /**
      * Retrieves the properties of an item
      * @param path  the path of the item
      * @return array of property objects
Index: subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/DiffSummaryReceiver.java
===================================================================
--- subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/DiffSummaryReceiver.java	(revision 0)
+++ subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/DiffSummaryReceiver.java	(revision 0)
@@ -0,0 +1,34 @@
+/**
+ * @copyright
+ * ====================================================================
+ * Copyright (c) 2006 CollabNet.  All rights reserved.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at http://subversion.tigris.org/license-1.html.
+ * If newer versions of this license are posted there, you may use a
+ * newer version instead, at your option.
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals.  For exact contribution history, see the revision
+ * history and logs, available at http://subversion.tigris.org/.
+ * ====================================================================
+ * @endcopyright
+ */
+package org.tigris.subversion.javahl;
+
+/**
+ * Subversion diff summarization interface.
+ *
+ * @since 1.5
+ */
+public interface DiffSummaryReceiver
+{
+    /**
+     * Implement this interface to receive diff summaries from the
+     * {@link SVNClientInterface#diffSummarize} API.
+     *
+     * @param descriptor A summary of the diff.
+     */
+    public void onSummary(DiffSummary descriptor);
+}
Index: subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/DiffSummary.java
===================================================================
--- subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/DiffSummary.java	(revision 0)
+++ subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/DiffSummary.java	(revision 0)
@@ -0,0 +1,125 @@
+/**
+ * @copyright
+ * ====================================================================
+ * Copyright (c) 2006 CollabNet.  All rights reserved.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at http://subversion.tigris.org/license-1.html.
+ * If newer versions of this license are posted there, you may use a
+ * newer version instead, at your option.
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals.  For exact contribution history, see the revision
+ * history and logs, available at http://subversion.tigris.org/.
+ * ====================================================================
+ * @endcopyright
+ */
+package org.tigris.subversion.javahl;
+
+import java.util.EventObject;
+
+/**
+ * The event passed to the {@link
+ * DiffSummarizer.summarize(DiffSummary)} API in response to path
+ * differences reported by {@link SVNClientInterface#diffSummarize}.
+ *
+ * @since 1.5
+ */
+public class DiffSummary extends EventObject
+{
+    private DiffKind diffKind;
+    private boolean propsChanged;
+    private NodeKind nodeKind;
+
+    /**
+     * This constructor is to be used by the native code.
+     *
+     * @param path The path we have a diff for.
+     * @param diffKind The kind of diff this describes.
+     * @param propChanged Whether any properties have changed.
+     */
+    DiffSummary(String path, int diffKind, boolean propsChanged,
+                   NodeKind nodeKind)
+    {
+        super(path);
+        this.diffKind = DiffKind.getInstance(diffKind);
+        this.propsChanged = propsChanged;
+        this.nodeKind = nodeKind;
+    }
+
+    /**
+     * @return The path we have a diff for.
+     */
+    public String getPath()
+    {
+        return (String) super.source;
+    }
+
+    /**
+     * @return The kind of summary this describes.
+     */
+    public DiffKind getDiffKind()
+    {
+        return this.diffKind;
+    }
+
+    /**
+     * @return Whether any properties have changed.
+     */
+    public boolean isPropsChanged()
+    {
+        return this.propsChanged;
+    }
+
+    /**
+     * @return Whether any properties have changed.
+     */
+    public NodeKind getNodeKind()
+    {
+        return this.nodeKind;
+    }
+
+    /**
+     * The type of difference being summarized.
+     */
+    public static class DiffKind
+    {
+        // Corresponds to the svn_client_diff_summarize_kind_t enum.
+        public static DiffKind NORMAL = new DiffKind(0);
+        public static DiffKind ADDED = new DiffKind(1);
+        public static DiffKind MODIFIED = new DiffKind(2);
+        public static DiffKind DELETED = new DiffKind(3);
+
+        private int kind;
+
+        private DiffKind(int kind)
+        {
+            this.kind = kind;
+        }
+
+        /**
+         * @return The appropriate instance.
+         * @exception IllegalArgumentException If the diff kind is not
+         * recognized.
+         */
+        public static DiffKind getInstance(int diffKind)
+            throws IllegalArgumentException
+        {
+            switch (diffKind)
+            {
+            case 0:
+                return NORMAL;
+            case 1:
+                return ADDED;
+            case 2:
+                return MODIFIED;
+            case 3:
+                return DELETED;
+            default:
+                throw new IllegalArgumentException("Diff kind " + diffKind +
+                                                   " not recognized");
+            }
+        }
+    }
+}

Re: JavaHL: Bindings for svn_client_diff_summarize()

Posted by Mark Phippard <ma...@gmail.com>.
On 12/15/06, Daniel Rall <dl...@collab.net> wrote:
>
> On Thu, 14 Dec 2006, Mark Phippard wrote:
> The way the C API handles the "prop changes and possible text changes"
> case is via the svn_client_diff_summarize_t's summarize_kind field,
> which is set to svn_client_diff_summarize_kind_normal (documented to
> describe an "item with no text modifications"), or another value.  The
> JavaHL API currently provides access to this value through the
> DiffSummary.getDiffKind() API.
>
> Do you think we should represent this differently in the JavaHL API,
> or simply document things better?


Now that you have said it, it seems obvious.  I suppose the JavaDoc could
state it more clearly as it is not likely that most consumers of the API
would be aware of the C API.

Thanks

Mark Phippard
http://markphip.blogspot.com/

Re: JavaHL: Bindings for svn_client_diff_summarize()

Posted by Daniel Rall <dl...@collab.net>.
On Thu, 14 Dec 2006, Mark Phippard wrote:
...
> >On Thu, 07 Dec 2006, Daniel Rall wrote:
> >...
> >> Mark, could you take a look at the DiffSummaryReceiver and
> >> DiffSummary APIs, and make sure they're in usable shape?  I'm
> >> especially interested if you think we should pull the
> >> DiffSummary.DiffKind class out and make it more like the other
> >> classes which correspond to C enums which are found in JavaHL.
...
> 1)  Should the diffSummarize method take pegRevision arguments?

Yes, we should also support svn_client.h's svn_client_diff_summarize_peg()
API.

> 2)  Should DiffSummary have a textChanged boolean that corresponds to the
> propsChanged boolean?  Obviously if an item is modified, and propsChanged is
> false, then you know the text has changed.  But if propsChanged is true, you
> have no way to know whether the text was also changed.  It is conceivable
> that someone doing a graphical diff tool would only care about file changes
> and not prop changes.

The way the C API handles the "prop changes and possible text changes"
case is via the svn_client_diff_summarize_t's summarize_kind field,
which is set to svn_client_diff_summarize_kind_normal (documented to
describe an "item with no text modifications"), or another value.  The
JavaHL API currently provides access to this value through the
DiffSummary.getDiffKind() API.

Do you think we should represent this differently in the JavaHL API,
or simply document things better?

- Dan

p.s. Merge Tracking questions to be answered in a separate email.

Re: JavaHL: Bindings for svn_client_diff_summarize()

Posted by Mark Phippard <ma...@gmail.com>.
On 12/13/06, Daniel Rall <dl...@collab.net> wrote:
>
> On Thu, 07 Dec 2006, Daniel Rall wrote:
> ...
> > Mark, could you take a look at the DiffSummaryReceiver and
> > DiffSummary APIs, and make sure they're in usable shape?  I'm
> > especially interested if you think we should pull the
> > DiffSummary.DiffKind class out and make it more like the other
> > classes which correspond to C enums which are found in JavaHL.
>
> Ping.  Not urgent, just don't want to forget about it before the API
> ships and is frozen...


I had forgotten, thanks.

I think the shape of the API's is OK.  These are the comments I would make:

1)  Should the diffSummarize method take pegRevision arguments?

2)  Should DiffSummary have a textChanged boolean that corresponds to the
propsChanged boolean?  Obviously if an item is modified, and propsChanged is
false, then you know the text has changed.  But if propsChanged is true, you
have no way to know whether the text was also changed.  It is conceivable
that someone doing a graphical diff tool would only care about file changes
and not prop changes.

On a related note, when the merge tracking stuff is brought to trunk, will
their be JavaHL related changes to make?  I assume there will be some new
methods and/or new method signatures?  I have not looked into what is
happening on that branch too closely.

Thanks

Mark

Re: JavaHL: Bindings for svn_client_diff_summarize()

Posted by Daniel Rall <dl...@collab.net>.
On Thu, 07 Dec 2006, Daniel Rall wrote:
...
> Mark, could you take a look at the DiffSummaryReceiver and
> DiffSummary APIs, and make sure they're in usable shape?  I'm
> especially interested if you think we should pull the
> DiffSummary.DiffKind class out and make it more like the other
> classes which correspond to C enums which are found in JavaHL.

Ping.  Not urgent, just don't want to forget about it before the API
ships and is frozen...

Re: JavaHL: Bindings for svn_client_diff_summarize()

Posted by Daniel Rall <dl...@collab.net>.
On Thu, 07 Dec 2006, Daniel Rall wrote:

> On Thu, 07 Dec 2006, Mark Phippard wrote:
> 
> > On 12/7/06, Mark Phippard <ma...@gmail.com> wrote:
> > >
> > >On 12/6/06, Daniel Rall <dl...@collab.net> wrote:
> > >
> > >> On Wed, 22 Nov 2006, Mark Phippard wrote:
> > >>
> > >> > Daniel Rall wrote:
> > >> > >On Tue, 21 Nov 2006, Mark Phippard wrote:
> > >> ...
> > >> > >>Since you are doing some stuff with JavaHL lately, one to add to
> > >> your
> > >> > >>to-do list would be some kind of support for the svn diff
> > >> --summarize
> > >> > >>option.  I think this is something we could use in Subclipse to
> > >> improve
> > >> > >>performance when comparing two tags of a large project.
> > >> ...
> > >> > ... it would return an array of the items that have been modified,
> > >> > or maybe it would send notifications that would have to be trapped.
> > >> > Either way, it would be something really different from what diff
> > >> > does now.
> > >> >
> > >> > Ideally, I'd probably like the API to return an array of some sort of
> > >> Java
> > >> > objects that describe the item and the type of change etc.
> > >>
> > >> Mark, I've written the code for the diff summarize JavaHL bindings:
> > >>
> > >>   http://svn.collab.net/repos/svn/branches/javahl-diff-summarize
> > >>
> > >> When you have a moment, I'd appreciate review of at least the Java
> > >> APIs.  The JUnit test case in BasicTests.java shows how to use it, and
> > >> return all diff summaries in a list.
> > >>
> > >> Unfortunately, there's a bug hiding somewhere in my implementation
> > >> which I haven't been able to shake out.  The bug is triggering an
> > >> exception (in native code, I think), which subsequently causes a JVM
> > >> segfault when JavaHL's error handling code calls the
> > >> env->DescribeException() JNI routine to output a stack trace for the
> > >> exception.  I've spent quite a bit of time on this bug, and could
> > >> really use some extra eyes.

I found and fixed this bug (thanks to glasser for helping me narrow
things down), and merged the branch into trunk in r22601.

Mark, could you take a look at the DiffSummaryReceiver and DiffSummary
APIs, and make sure they're in usable shape?  I'm especially
interested if you think we should pull the DiffSummary.DiffKind class
out and make it more like the other classes which correspond to C
enums which are found in JavaHL.

Re: JavaHL: Bindings for svn_client_diff_summarize()

Posted by Daniel Rall <dl...@collab.net>.
On Thu, 07 Dec 2006, Mark Phippard wrote:

> On 12/7/06, Mark Phippard <ma...@gmail.com> wrote:
> >
> >On 12/6/06, Daniel Rall <dl...@collab.net> wrote:
> >
> >> On Wed, 22 Nov 2006, Mark Phippard wrote:
> >>
> >> > Daniel Rall wrote:
> >> > >On Tue, 21 Nov 2006, Mark Phippard wrote:
> >> ...
> >> > >>Since you are doing some stuff with JavaHL lately, one to add to
> >> your
> >> > >>to-do list would be some kind of support for the svn diff
> >> --summarize
> >> > >>option.  I think this is something we could use in Subclipse to
> >> improve
> >> > >>performance when comparing two tags of a large project.
> >> ...
> >> > ... it would return an array of the items that have been modified,
> >> > or maybe it would send notifications that would have to be trapped.
> >> > Either way, it would be something really different from what diff
> >> > does now.
> >> >
> >> > Ideally, I'd probably like the API to return an array of some sort of
> >> Java
> >> > objects that describe the item and the type of change etc.
> >>
> >> Mark, I've written the code for the diff summarize JavaHL bindings:
> >>
> >>   http://svn.collab.net/repos/svn/branches/javahl-diff-summarize
> >>
> >> When you have a moment, I'd appreciate review of at least the Java
> >> APIs.  The JUnit test case in BasicTests.java shows how to use it, and
> >> return all diff summaries in a list.
> >>
> >> Unfortunately, there's a bug hiding somewhere in my implementation
> >> which I haven't been able to shake out.  The bug is triggering an
> >> exception (in native code, I think), which subsequently causes a JVM
> >> segfault when JavaHL's error handling code calls the
> >> env->DescribeException() JNI routine to output a stack trace for the
> >> exception.  I've spent quite a bit of time on this bug, and could
> >> really use some extra eyes.
> >
> >I had a little trouble getting a diff for this since you made the branch
> >and commit in one step.  Just an fyi..  I had to resort to the commit email
> >and eventually just checked it out.

Sorry, didn't mean to make things more difficult than they have to be.
FYI, you can get the delta for a branch which was branched with
changes by diffing its HEAD against the branch it was created from at
the revision it was created from (determined via 'svn log -v').

# Find trunk revnum
svn log -v --stop-on-copy \
    http://svn.collab.net/repos/svn/branches/javahl-diff-summarize

# Get delta
svn di http://svn.collab.net/repos/svn/trunk@22588 \
       http://svn.collab.net/repos/svn/branches/javahl-diff-summarize@HEAD

> >Is there a reason that DiffSummary extends EventObject?  I do not know
> >what that class is and cannot see any precedent for extending it in JavaHL.
> >
> >I'll keep digging though.
> 
> I see that the Notify stuff uses the same technique, so just ignore
> this comment.  I'll keep looking.

It's just conventional (like using the EventListener marker
interface).  EventObject is a common marker interface used for events
passed to Java listeners.  It's not strictly necessary.

Re: JavaHL: Bindings for svn_client_diff_summarize()

Posted by Mark Phippard <ma...@gmail.com>.
On 12/7/06, Mark Phippard <ma...@gmail.com> wrote:
>
> On 12/6/06, Daniel Rall <dl...@collab.net> wrote:
>
> > On Wed, 22 Nov 2006, Mark Phippard wrote:
> >
> > > Daniel Rall wrote:
> > > >On Tue, 21 Nov 2006, Mark Phippard wrote:
> > ...
> > > >>Since you are doing some stuff with JavaHL lately, one to add to
> > your
> > > >>to-do list would be some kind of support for the svn diff
> > --summarize
> > > >>option.  I think this is something we could use in Subclipse to
> > improve
> > > >>performance when comparing two tags of a large project.
> > ...
> > > ... it would return an array of the items that have been modified,
> > > or maybe it would send notifications that would have to be trapped.
> > > Either way, it would be something really different from what diff
> > > does now.
> > >
> > > Ideally, I'd probably like the API to return an array of some sort of
> > Java
> > > objects that describe the item and the type of change etc.
> >
> > Mark, I've written the code for the diff summarize JavaHL bindings:
> >
> >   http://svn.collab.net/repos/svn/branches/javahl-diff-summarize
> >
> > When you have a moment, I'd appreciate review of at least the Java
> > APIs.  The JUnit test case in BasicTests.java shows how to use it, and
> > return all diff summaries in a list.
> >
> > Unfortunately, there's a bug hiding somewhere in my implementation
> > which I haven't been able to shake out.  The bug is triggering an
> > exception (in native code, I think), which subsequently causes a JVM
> > segfault when JavaHL's error handling code calls the
> > env->DescribeException() JNI routine to output a stack trace for the
> > exception.  I've spent quite a bit of time on this bug, and could
> > really use some extra eyes.
>
>
> I had a little trouble getting a diff for this since you made the branch
> and commit in one step.  Just an fyi..  I had to resort to the commit email
> and eventually just checked it out.
>
> Is there a reason that DiffSummary extends EventObject?  I do not know
> what that class is and cannot see any precedent for extending it in JavaHL.
>
> I'll keep digging though.
>

I see that the Notify stuff uses the same technique, so just ignore this
comment.  I'll keep looking.

Mark

Re: JavaHL: Bindings for svn_client_diff_summarize()

Posted by Mark Phippard <ma...@gmail.com>.
On 12/6/06, Daniel Rall <dl...@collab.net> wrote:
>
> On Wed, 22 Nov 2006, Mark Phippard wrote:
>
> > Daniel Rall wrote:
> > >On Tue, 21 Nov 2006, Mark Phippard wrote:
> ...
> > >>Since you are doing some stuff with JavaHL lately, one to add to your
> > >>to-do list would be some kind of support for the svn diff --summarize
> > >>option.  I think this is something we could use in Subclipse to
> improve
> > >>performance when comparing two tags of a large project.
> ...
> > ... it would return an array of the items that have been modified,
> > or maybe it would send notifications that would have to be trapped.
> > Either way, it would be something really different from what diff
> > does now.
> >
> > Ideally, I'd probably like the API to return an array of some sort of
> Java
> > objects that describe the item and the type of change etc.
>
> Mark, I've written the code for the diff summarize JavaHL bindings:
>
>   http://svn.collab.net/repos/svn/branches/javahl-diff-summarize
>
> When you have a moment, I'd appreciate review of at least the Java
> APIs.  The JUnit test case in BasicTests.java shows how to use it, and
> return all diff summaries in a list.
>
> Unfortunately, there's a bug hiding somewhere in my implementation
> which I haven't been able to shake out.  The bug is triggering an
> exception (in native code, I think), which subsequently causes a JVM
> segfault when JavaHL's error handling code calls the
> env->DescribeException() JNI routine to output a stack trace for the
> exception.  I've spent quite a bit of time on this bug, and could
> really use some extra eyes.


I had a little trouble getting a diff for this since you made the branch and
commit in one step.  Just an fyi..  I had to resort to the commit email and
eventually just checked it out.

Is there a reason that DiffSummary extends EventObject?  I do not know what
that class is and cannot see any precedent for extending it in JavaHL.

I'll keep digging though.

Mark

JavaHL: Bindings for svn_client_diff_summarize()

Posted by Daniel Rall <dl...@collab.net>.
On Wed, 22 Nov 2006, Mark Phippard wrote:

> Daniel Rall wrote:
> >On Tue, 21 Nov 2006, Mark Phippard wrote:
...
> >>Since you are doing some stuff with JavaHL lately, one to add to your 
> >>to-do list would be some kind of support for the svn diff --summarize 
> >>option.  I think this is something we could use in Subclipse to improve 
> >>performance when comparing two tags of a large project.
...
> ... it would return an array of the items that have been modified,
> or maybe it would send notifications that would have to be trapped.
> Either way, it would be something really different from what diff
> does now.
> 
> Ideally, I'd probably like the API to return an array of some sort of Java 
> objects that describe the item and the type of change etc.

Mark, I've written the code for the diff summarize JavaHL bindings:

  http://svn.collab.net/repos/svn/branches/javahl-diff-summarize

When you have a moment, I'd appreciate review of at least the Java
APIs.  The JUnit test case in BasicTests.java shows how to use it, and
return all diff summaries in a list.

Unfortunately, there's a bug hiding somewhere in my implementation
which I haven't been able to shake out.  The bug is triggering an
exception (in native code, I think), which subsequently causes a JVM
segfault when JavaHL's error handling code calls the
env->DescribeException() JNI routine to output a stack trace for the
exception.  I've spent quite a bit of time on this bug, and could
really use some extra eyes.

Re: New JavaHL features

Posted by Mark Phippard <ma...@gmail.com>.
Daniel Rall wrote:
> On Tue, 21 Nov 2006, Mark Phippard wrote:
>
>   
>> Daniel,
>>
>> Since you are doing some stuff with JavaHL lately, one to add to your 
>> to-do list would be some kind of support for the svn diff --summarize 
>> option.  I think this is something we could use in Subclipse to improve 
>> performance when comparing two tags of a large project.
>>     
>
> Sure Mark.  Do you think the summarize option should be a parameter to
> SVNClientInterface.diff(), or a separate API entirely?  svn_client.h
> uses two separate APIs to implement 'diff' and 'diff --summarize'.
>   
It probably makes sense to be a separate API, the reasoning being that the summarize info would have to be communicated differently than what a normal diff does.  Either it would return an array of the items that have been modified, or maybe it would send notifications that would have to be trapped.  Either way, it would be something really different from what diff does now.

Ideally, I'd probably like the API to return an array of some sort of Java objects that describe the item and the type of change etc.

Mark

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

Re: New JavaHL features

Posted by Daniel Rall <dl...@collab.net>.
On Tue, 21 Nov 2006, Mark Phippard wrote:

> Daniel,
> 
> Since you are doing some stuff with JavaHL lately, one to add to your 
> to-do list would be some kind of support for the svn diff --summarize 
> option.  I think this is something we could use in Subclipse to improve 
> performance when comparing two tags of a large project.

Sure Mark.  Do you think the summarize option should be a parameter to
SVNClientInterface.diff(), or a separate API entirely?  svn_client.h
uses two separate APIs to implement 'diff' and 'diff --summarize'.


> Also, there have been those problems reported where something is up
> with the configuration area that keeps it from caching passwords and
> SSL certs.

Yeah, I have that thread saved, with every intention of looking into
it.

- Dan