subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1494521 - in /subversion/branches/javahl-ra/subversion/bindings/javahl: native/ src/org/apache/subversion/javahl/ src/org/apache/subversion/javahl/remote/ tests/org/apache/subversion/javahl/
Date Wed, 19 Jun 2013 09:03:24 GMT
Author: brane
Date: Wed Jun 19 09:03:24 2013
New Revision: 1494521

URL: http://svn.apache.org/r1494521
Log:
On the javahl-ra branch: Add ISVNRemote.getReposRootUrl.

[in subversion/bindings/javahl/src/org/apache/subversion/javahl]
* ISVNRemote.java, remote/RemoteSession.java
  (ISVNRemote.getReposRootUrl): New method.

[in subversion/bindings/javahl/native]
* RemoteSession.h, RemoteSession.cpp
  (RemoteSession::getReposRootUrl): New method.

[in subversion/bindings/javahl/tests/org/apache/subversion/javahl]
* SVNRemoteTests.java (SVNRemoteTests.testGetRootUrl): New test case.

Modified:
    subversion/branches/javahl-ra/subversion/bindings/javahl/native/RemoteSession.cpp
    subversion/branches/javahl-ra/subversion/bindings/javahl/native/RemoteSession.h
    subversion/branches/javahl-ra/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp
    subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java
    subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteSession.java
    subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/native/RemoteSession.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/native/RemoteSession.cpp?rev=1494521&r1=1494520&r2=1494521&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/native/RemoteSession.cpp (original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/native/RemoteSession.cpp Wed
Jun 19 09:03:24 2013
@@ -341,6 +341,22 @@ RemoteSession::getReposUUID()
   return juuid;
 }
 
+jstring
+RemoteSession::getReposRootUrl()
+{
+  SVN::Pool subPool(pool);
+  const char* url;
+
+  SVN_JNI_ERR(svn_ra_get_repos_root2(m_session, &url, subPool.getPool()),
+              NULL);
+
+  jstring jurl = JNIUtil::makeJString(url);
+  if (JNIUtil::isJavaExceptionThrown())
+    return NULL;
+
+  return jurl;
+}
+
 jlong
 RemoteSession::getLatestRevision()
 {

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/native/RemoteSession.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/native/RemoteSession.h?rev=1494521&r1=1494520&r2=1494521&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/native/RemoteSession.h (original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/native/RemoteSession.h Wed Jun
19 09:03:24 2013
@@ -63,6 +63,7 @@ class RemoteSession : public SVNBase
     jstring getSessionRelativePath(const char* url);
     jstring getReposRelativePath(const char* url);
     jstring getReposUUID();
+    jstring getReposRootUrl();
     jlong getLatestRevision();
 
     jlong getRevisionByTimestamp(jlong timestamp);

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp?rev=1494521&r1=1494520&r2=1494521&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp
(original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp
Wed Jun 19 09:03:24 2013
@@ -129,6 +129,17 @@ Java_org_apache_subversion_javahl_remote
   return ras->getReposUUID();
 }
 
+JNIEXPORT jstring JNICALL
+Java_org_apache_subversion_javahl_remote_RemoteSession_getReposRootUrl(
+    JNIEnv *env, jobject jthis)
+{
+  JNIEntry(RemoteSession, geRepostUUID);
+  RemoteSession *ras = RemoteSession::getCppObject(jthis);
+  CPPADDR_NULL_PTR(ras, NULL);
+
+  return ras->getReposRootUrl();
+}
+
 JNIEXPORT jlong JNICALL
 Java_org_apache_subversion_javahl_remote_RemoteSession_getLatestRevision(
     JNIEnv *env, jobject jthis)

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java?rev=1494521&r1=1494520&r2=1494521&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java
(original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java
Wed Jun 19 09:03:24 2013
@@ -84,6 +84,12 @@ public interface ISVNRemote
     String getReposUUID() throws ClientException;
 
     /**
+     * Get the root URL of the session's repository.
+     * @throws ClientException
+     */
+    String getReposRootUrl() throws ClientException;
+
+    /**
      * Get the latest revision number from the session's repository.
      * @throws ClientException
      */

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteSession.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteSession.java?rev=1494521&r1=1494520&r2=1494521&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteSession.java
(original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteSession.java
Wed Jun 19 09:03:24 2013
@@ -73,6 +73,8 @@ public class RemoteSession extends JNIOb
 
     public native String getReposUUID() throws ClientException;
 
+    public native String getReposRootUrl() throws ClientException;
+
     public native long getLatestRevision() throws ClientException;
 
     public long getRevisionByDate(Date date) throws ClientException

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java?rev=1494521&r1=1494520&r2=1494521&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
(original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
Wed Jun 19 09:03:24 2013
@@ -188,6 +188,13 @@ public class SVNRemoteTests extends SVNT
         assertEquals(getTestRepoUrl(), session.getSessionUrl());
     }
 
+    public void testGetRootUrl() throws Exception
+    {
+        ISVNRemote session = getSession();
+        session.reparent(session.getSessionUrl() + "/A/B/E");
+        assertEquals(getTestRepoUrl(), session.getReposRootUrl());
+    }
+
     public void testGetUrl_viaSVNClient() throws Exception
     {
         ISVNRemote session = client.openRemoteSession(getTestRepoUrl());



Mime
View raw message