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

Re: [PATCH]Can we accept JavaHL Revison.Number.Number(-1)?

From: Mark Phippard <markphip_at_gmail.com>
Date: Wed, 26 Mar 2008 10:50:37 -0400

On Wed, Mar 26, 2008 at 10:34 AM, Kamesh Jayachandran <kamesh_at_collab.net> wrote:

> I am working on exposing 'svn_client__get_revision_number' in JavaHL.
>
> I want a equivalent of youngest_rev(in/out param in
> svn_client__get_revision_number method).
>
> Unfortunately our JavaHl does not allow revision numbers to be '-1'.
>
> My API would look like this
>
> /**
> * Returns the revision number as represented by @revision.
> * To ensure consistency of HEAD across multiple operations,
> * one can pass valid @youngestRevision so that it would return
> * @youngestRevision. @youngestRevision can be null if one
> * does not want ensure the consistent HEAD.
> * If @youngestRevision is Revision.SVN_INVALID_REVNUM and
> * revision's kind is HEAD we set @youngestRevision with
> * return value of this function.
> * @since 1.6
> */
> public native long getRevisionNumber(
> Revision.Number youngestRevision,
> String pathOrUrl,
> Revision revision);
>
>
> Attaching the patch to create object Revison.Number.Number(-1).
>
> Would like to what others think about this.
>
> With regards
> Kamesh Jayachandran
>
> [[[
> JavaHL's Revision.Number.Number(long) should accept -1, to
> implement a behaviour that can set 'Revision.Number' object
> with some valid revision if it is '-1'.
>
> * subversion/bindings/javahl/src/org/tigris/subversion/javahl/Revision.java
> (Revision.Number.Number): Accept -1 as special revision number.
> ]]]
>
> inside svn_client__get_revision_number revision->kind=5
> Index: subversion/bindings/javahl/src/org/tigris/subversion/javahl/Revision.java
> ===================================================================
> --- subversion/bindings/javahl/src/org/tigris/subversion/javahl/Revision.java (revision 30056)
> +++ subversion/bindings/javahl/src/org/tigris/subversion/javahl/Revision.java (working copy)
> @@ -209,7 +209,7 @@
> public Number(long number)
> {
> super(Kind.number, true);
> - if (number < 0)
> + if (number < SVN_INVALID_REVNUM)
> throw new IllegalArgumentException
> ("Invalid (negative) revision number: " + number);
> revNumber = number;
>
>

So you are saying you want to add a new method to JavaHL that gets the
youngest revision number for a WC or URL? And to do that you need to
be able to pass a -1 into the native function? Is there some reason
this cannot just be hidden in the method interface? I guess I just do
not understand what this new method does or when someone would call
it. The JavaDoc is not really clear to me.

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-03-26 15:50:54 CET

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.