Based on a discussion we had over on the Subclipse mailing list, Daniel
Rall asked me to send this to the Subversion dev@ list. He said to
provide the Java-side of this patch as an illustration and he or someone
else could look at the C++ side.
Basically, it would be nice from Subclipse to know the version of the
JavaHL library that is loaded. We have to ship the JavaHL JAR file as
part of Subclipse but the native library comes from their Subversion
distribution (except on Windows where we also provide the library). So it
is possible, as an example, that we are using the 1.2 version of JavaHL on
the Java side but it is loading a 1.1 native library. This then leads to
problems when we try to use incompatible features.
I currently work around this by doing "feature" testing such as doing a
test construction of an object that didn't exist in prior versions or
calling a new method etc... It would be nicer if there were just a method
in JavaHL that returns the version of the loaded library.
The attached patch contains my proposal for the sort of methods I would
like to see on the Java side. When all is said and done, we just need the
information so feel free to modify the methods to suit what you can or
cannot do easily on the C++ side to fulfill the methods.
Thanks
Mark
Index: src/org/tigris/subversion/javahl/SVNClient.java
===================================================================
--- src/org/tigris/subversion/javahl/SVNClient.java (revision 17076)
+++ src/org/tigris/subversion/javahl/SVNClient.java (working copy)
@@ -1116,4 +1116,28 @@
public native Info2[] info2(String pathOrUrl, Revision revision,
Revision pegRevision, boolean recurse)
throws ClientException;
+
+ /**
+ * @return The full version string for the loaded JavaHL library
+ * @since 1.3
+ */
+ public native String getLibraryVersion();
+
+ /**
+ * @return The major version number for the loaded JavaHL library
+ * @since 1.3
+ */
+ public native int getLibraryMajorVersion();
+
+ /**
+ * @return The minor version number for the loaded JavaHL library
+ * @since 1.3
+ */
+ public native int getLibraryMinorVersion();
+
+ /**
+ * @return The patch version number for the loaded JavaHL library
+ * @since 1.3
+ */
+ public native int getLibraryPatchVersion();
}
Index: src/org/tigris/subversion/javahl/SVNClientInterface.java
===================================================================
--- src/org/tigris/subversion/javahl/SVNClientInterface.java (revision
17076)
+++ src/org/tigris/subversion/javahl/SVNClientInterface.java (working
copy)
@@ -30,6 +30,26 @@
*/
void dispose();
/**
+ * @return The full version string for the loaded JavaHL library
+ * @since 1.3
+ */
+ public String getLibraryVersion();
+ /**
+ * @return The major version number for the loaded JavaHL library
+ * @since 1.3
+ */
+ public int getLibraryMajorVersion();
+ /**
+ * @return The minor version number for the loaded JavaHL library
+ * @since 1.3
+ */
+ public int getLibraryMinorVersion();
+ /**
+ * @return The patch version number for the loaded JavaHL library
+ * @since 1.3
+ */
+ public int getLibraryPatchVersion();
+ /**
* @return The name of the working copy's administrative
* directory, which is usually <code>.svn</code>.
* @see <a
Index: src/org/tigris/subversion/javahl/SVNClientSynchronized.java
===================================================================
--- src/org/tigris/subversion/javahl/SVNClientSynchronized.java (revision
17076)
+++ src/org/tigris/subversion/javahl/SVNClientSynchronized.java (working
copy)
@@ -1443,5 +1443,53 @@
return worker.getVersionInfo(path, trailUrl, lastChanged);
}
}
+
+ /**
+ * @return The full version string for the loaded JavaHL library
+ * @since 1.3
+ */
+ public String getLibraryVersion()
+ {
+ synchronized(clazz)
+ {
+ return worker.getLibraryVersion();
+ }
+ }
+ /**
+ * @return The major version number for the loaded JavaHL library
+ * @since 1.3
+ */
+ public int getLibraryMajorVersion()
+ {
+ synchronized(clazz)
+ {
+ return worker.getLibraryMajorVersion();
+ }
+ }
+
+ /**
+ * @return The minor version number for the loaded JavaHL library
+ * @since 1.3
+ */
+ public int getLibraryMinorVersion()
+ {
+ synchronized(clazz)
+ {
+ return worker.getLibraryMinorVersion();
+ }
+ }
+
+ /**
+ * @return The patch version number for the loaded JavaHL library
+ * @since 1.3
+ */
+ public int getLibraryPatchVersion()
+ {
+ synchronized(clazz)
+ {
+ return worker.getLibraryPatchVersion();
+ }
+ }
+
}
_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. and SoftLanding Europe Plc by IBM Email Security Management Services powered by MessageLabs.
_____________________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Oct 28 17:49:02 2005