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

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

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: Wed, 26 Mar 2008 20:04:22 +0530

Hi All,

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;

Received on 2008-03-26 15:55:13 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.