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

Re: Bugs in new JavaHL merge tracking API's

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: 2007-06-05 04:37:57 CEST

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark Phippard wrote:
> Here is a test you can use locally to produce the crash in #1 below.
> Just paste it into BasicTests.java.
>
> /**
> * Test the basic functionality of {@link
> * org.tigris.subversion.javahl.SVNClientInterface#getMergeInfo(}).
> * @throws Throwable
> * @since 1.5
> */
> public void testMergeInfoCrash() throws Throwable
> {
> OneTest thisTest = new OneTest();
> File localPath = new File(thisTest.getWCPath(), "notesWC");
> client.checkout("http://svn.collab.net/repos/svn/trunk/notes",
> localPath.toString(),
> Revision.HEAD, Revision.HEAD, 1, true, true);
> MergeInfo mergeInfo =
> client.getMergeInfo(localPath.toString(), Revision.HEAD);
> System.out.println(mergeInfo.toString());
> }

I've tracked the problem down to a NULL mergeinfo hash which gets passed
back through the get_mergeinfo() apis. The following patch fixes the
symptom, but I'm not familiar enough with the purpose of the code to
determine if it is correct or not.

Dan, does this change fit with the existing api conventions?

- -Hyrum

Index: subversion/libsvn_client/merge.c
===================================================================
- --- subversion/libsvn_client/merge.c (revision 25290)
+++ subversion/libsvn_client/merge.c (working copy)
@@ -1125,6 +1125,10 @@
           *target_mergeinfo = repos_mergeinfo;
           *indirect = TRUE;
         }
+ else
+ {
+ *target_mergeinfo = apr_hash_make(pool);
+ }
     }
   return SVN_NO_ERROR;
 }

> On 6/4/07, Mark Phippard <markphip@gmail.com> wrote:
>> Ran into a couple of bugs in some of the new merge-tracking related
>> API's in JavaHL. I imagine some of these are not just in JavaHL.
>>
>> 1) getMergeInfo(localPath, Revision.HEAD) crashes the JVM when called
>> on a WC from an http repository. In this case, it was tigris.org (SVN
>> 1.3.x). To recreate, checkout:
>>
>> svn co http://subclipse.tigris.org/svn/subclipse/trunk/subclipse/feature
>>
>> Chosen because it is small and demonstrates the problem.
>>
>> Recreated this problem on Windows and OSX.
>>
>> 2) getCopySource(localPath, Revision.HEAD) when called on a local
>> path that has never been copied gives these errors:
>>
>> Exception in thread "main" java.lang.IllegalArgumentException: Invalid
>> (negative) revision number: -1
>> at
>> org.tigris.subversion.javahl.Revision$Number.<init>(Revision.java:216)
>> at
>> org.tigris.subversion.javahl.Revision.getInstance(Revision.java:127)
>> at org.tigris.subversion.javahl.SVNClient.getCopySource(Native
>> Method)
>> at
>> org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.getCopySource(AbstractJhlClientAdapter.java:2034)
>>
>> at
>> org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.getCopySource(AbstractJhlClientAdapter.java:2025)
>>
>>
>>
>> I think the problem is that the C++ code is trying to create null
>> revision objects for the path by using a value of -1. But that is not
>> a value the JavaHL Revision class will accept. This problem does not
>> appear to cause any additional problems other than the exception being
>> logged.
>>
>> Let me know if you would rather I file issues in the issue tracker.
>>
>> --
>> Thanks
>>
>> Mark Phippard
>> http://markphip.blogspot.com/
>>
>
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGZMyFCwOubk4kUXwRAuhoAKC05Y8HfSk/yZv+iw1WK994upVJIACgjWVR
kqVgClo5iUUiboDMTcn92yE=
=BLYN
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jun 5 04:35:13 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.