subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r917569 - in /subversion/trunk/subversion/bindings/javahl: src/org/apache/subversion/javahl/ src/org/tigris/subversion/javahl/ tests/org/apache/subversion/javahl/
Date Mon, 01 Mar 2010 16:10:06 GMT
Author: hwright
Date: Mon Mar  1 16:10:06 2010
New Revision: 917569

URL: http://svn.apache.org/viewvc?rev=917569&view=rev
Log:
JavaHL: Convert RevisionRange[] args to a couple of methods into
List<RevisionRange> args.

[ in subversion/bindings/javahl/ ]
* tests/org/apache/subversion/javahl/BasicTests.java
  (testBasicLogMessage, testMergeUsingHistory, testMergeReintegrate,
   testMergeConflictResolution, testRecordOnlyMerge, toRevisionRange,
   collectLogMessages): Update tests to reflect the API change.

* src/org/tigris/subversion/javahl/SVNClient.java
  (logMessages, merge): Update wrappers to the new API.

* src/org/apache/subversion/javahl/SVNClient.java
  (logMessages, merge): Update APIs to take a List of RevisionRanges, rather
    than an array.  Update wrappers accordingly.

* src/org/apache/subversion/javahl/ISVNClient.java
  (logMessages, merge): Update the API to use a List of RevisionRanges, rather
    than an array.

Modified:
    subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
    subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
    subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
    subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java

Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java?rev=917569&r1=917568&r2=917569&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
Mon Mar  1 16:10:06 2010
@@ -149,7 +149,7 @@
      * @since 1.6
      */
     void logMessages(String path, Revision pegRevision,
-                     RevisionRange[] ranges, boolean stopOnCopy,
+                     List<RevisionRange> ranges, boolean stopOnCopy,
                      boolean discoverPath, boolean includeMergedRevisions,
                      Set<String> revProps, long limit,
                      LogMessageCallback callback)
@@ -479,7 +479,7 @@
      * @throws ClientException
      * @since 1.5
      */
-    void merge(String path, Revision pegRevision, RevisionRange[] revisions,
+    void merge(String path, Revision pegRevision, List<RevisionRange> revisions,
                String localPath, boolean force, int depth,
                boolean ignoreAncestry, boolean dryRun, boolean recordOnly)
              throws ClientException;

Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java?rev=917569&r1=917568&r2=917569&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
Mon Mar  1 16:10:06 2010
@@ -166,7 +166,7 @@
      */
     public void logMessages(String path,
                             Revision pegRevision,
-                            RevisionRange[] revisionRanges,
+                            List<RevisionRange> revisionRanges,
                             boolean stopOnCopy,
                             boolean discoverPath,
                             boolean includeMergedRevisions,
@@ -175,8 +175,11 @@
                             LogMessageCallback callback)
             throws ClientException
     {
-        this.logMessages(path, pegRevision, revisionRanges, stopOnCopy,
-                         discoverPath, includeMergedRevisions,
+        this.logMessages(path, pegRevision,
+                         revisionRanges == null ? null
+                            : revisionRanges.toArray(new RevisionRange[
+                                                        revisionRanges.size()]),
+                         stopOnCopy, discoverPath, includeMergedRevisions,
                          revProps == null ? null
                             : revProps.toArray(new String[revProps.size()]),
                          limit, callback);
@@ -382,10 +385,22 @@
     /**
      * @since 1.5
      */
-    public native void merge(String path, Revision pegRevision,
-                             RevisionRange[] revisions, String localPath,
-                             boolean force, int depth, boolean ignoreAncestry,
-                             boolean dryRun, boolean recordOnly)
+    public void merge(String path, Revision pegRevision,
+                      List<RevisionRange> revisions, String localPath,
+                      boolean force, int depth, boolean ignoreAncestry,
+                      boolean dryRun, boolean recordOnly)
+            throws ClientException
+    {
+        this.merge(path, pegRevision,
+                   revisions == null ? null
+                    : revisions.toArray(new RevisionRange[revisions.size()]),
+                   localPath, force, depth, ignoreAncestry, dryRun, recordOnly);
+    }
+
+    private native void merge(String path, Revision pegRevision,
+                              RevisionRange[] revisions, String localPath,
+                              boolean force, int depth, boolean ignoreAncestry,
+                              boolean dryRun, boolean recordOnly)
             throws ClientException;
 
     /**

Modified: subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java?rev=917569&r1=917568&r2=917569&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
Mon Mar  1 16:10:06 2010
@@ -529,12 +529,12 @@
 
         try
         {
-            org.apache.subversion.javahl.RevisionRange[] aRevisions = 
-              new org.apache.subversion.javahl.RevisionRange[revisionRanges.length];
+            List<org.apache.subversion.javahl.RevisionRange> aRevisions = 
+              new ArrayList<org.apache.subversion.javahl.RevisionRange>(revisionRanges.length);
 
-            for (int i = 0; i < revisionRanges.length; i++)
+            for (RevisionRange range : revisionRanges)
             {
-                aRevisions[i] = revisionRanges[i].toApache();
+                aRevisions.add(range.toApache());
             }
 
             aSVNClient.logMessages(path,
@@ -1328,12 +1328,12 @@
     {
         try
         {
-            org.apache.subversion.javahl.RevisionRange[] aRevisions = 
-              new org.apache.subversion.javahl.RevisionRange[revisions.length];
+            List<org.apache.subversion.javahl.RevisionRange> aRevisions = 
+              new ArrayList<org.apache.subversion.javahl.RevisionRange>(revisions.length);
 
-            for (int i = 0; i < revisions.length; i++)
+            for (RevisionRange range : revisions )
             {
-                aRevisions[i] = revisions[i].toApache();
+                aRevisions.add(range.toApache());
             }
 
             aSVNClient.merge(path,

Modified: subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=917569&r1=917568&r2=917569&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
Mon Mar  1 16:10:06 2010
@@ -2102,9 +2102,10 @@
         OneTest thisTest = new OneTest();
 
         // get the commit message of the initial import and test it
+        List<RevisionRange> ranges = new ArrayList<RevisionRange>(1);
+        ranges.add(new RevisionRange(null, null));
         LogMessage lm[] = collectLogMessages(thisTest.getWCPath(), null,
-                        new RevisionRange[] { new RevisionRange(null, null) },
-                        false, true, false, 0);
+                                             ranges, false, true, false, 0);
         assertEquals("wrong number of objects", 1, lm.length);
         assertEquals("wrong message", "Log Message", lm[0].getMessage());
         assertEquals("wrong revision", 1, lm[0].getRevisionNumber());
@@ -2528,8 +2529,9 @@
         String branchPath = thisTest.getWCPath() + "/branches/A";
         String modUrl = thisTest.getUrl() + "/A";
         Revision unspec = new Revision(RevisionKind.unspecified);
-        client.merge(modUrl, Revision.HEAD,
-                     new RevisionRange[] { new RevisionRange(unspec, unspec) },
+        List<RevisionRange> ranges = new ArrayList<RevisionRange>(1);
+        ranges.add(new RevisionRange(unspec, unspec));
+        client.merge(modUrl, Revision.HEAD, ranges,
                      branchPath, true, Depth.infinity, false, false, false);
 
         // commit the changes so that we can verify merge
@@ -2581,8 +2583,9 @@
         String branchPath = thisTest.getWCPath() + "/branches/A";
         String modUrl = thisTest.getUrl() + "/A";
         Revision unspec = new Revision(RevisionKind.unspecified);
-        client.merge(modUrl, Revision.HEAD,
-                     new RevisionRange[] { new RevisionRange(unspec, unspec) },
+        List<RevisionRange> ranges = new ArrayList<RevisionRange>(1);
+        ranges.add(new RevisionRange(unspec, unspec));
+        client.merge(modUrl, Revision.HEAD, ranges,
                      branchPath, true, Depth.infinity, false, false, false);
 
         // commit the changes so that we can verify merge
@@ -2665,9 +2668,9 @@
         mu = appendText(thisTest, "A/mu", "yyy", 1);
 
         // Merge in the previous changes to A/mu (from r2).
-        RevisionRange[] ranges = new RevisionRange[1];
-        ranges[0] = new RevisionRange(new Revision.Number(1),
-                                      new Revision.Number(2));
+        List<RevisionRange> ranges = new ArrayList<RevisionRange>(1);
+        ranges.add(new RevisionRange(new Revision.Number(1),
+                                     new Revision.Number(2)));
         client.merge(thisTest.getUrl(), Revision.HEAD, ranges,
                      thisTest.getWCPath(), false, Depth.infinity, false,
                      false, false);
@@ -2709,9 +2712,9 @@
         String branchPath = thisTest.getWCPath() + "/branches/A";
         String modUrl = thisTest.getUrl() + "/A";
 
-        RevisionRange[] ranges = new RevisionRange[1];
-        ranges[0] = new RevisionRange(new Revision.Number(2),
-                                      new Revision.Number(4));
+        List<RevisionRange> ranges = new ArrayList<RevisionRange>(1);
+        ranges.add(new RevisionRange(new Revision.Number(2),
+                                     new Revision.Number(4)));
         client.merge(modUrl, Revision.HEAD, ranges,
                      branchPath, true, Depth.infinity, false, false, true);
 
@@ -3533,10 +3536,10 @@
         }
     }
 
-    private RevisionRange[] toRevisionRange(Revision rev1, Revision rev2)
+    private List<RevisionRange> toRevisionRange(Revision rev1, Revision rev2)
     {
-        RevisionRange[] ranges = new RevisionRange[1];
-        ranges[0] = new RevisionRange(rev1, rev2);
+        List<RevisionRange> ranges = new ArrayList<RevisionRange>(1);
+        ranges.add(new RevisionRange(rev1, rev2));
         return ranges;
     }
 
@@ -3743,7 +3746,7 @@
     }
 
     private LogMessage[] collectLogMessages(String path, Revision pegRevision,
-                                            RevisionRange[] revisionRanges,
+                                            List<RevisionRange> revisionRanges,
                                             boolean stopOnCopy,
                                             boolean discoverPath,
                                             boolean includeMergedRevisions,



Mime
View raw message