You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/09/07 15:59:43 UTC

svn commit: r993368 [1/4] - in /subversion/branches/javahl-ra: ./ notes/wc-ng/ subversion/bindings/javahl/tests/org/apache/subversion/javahl/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_diff/ subversion/l...

Author: hwright
Date: Tue Sep  7 13:59:41 2010
New Revision: 993368

URL: http://svn.apache.org/viewvc?rev=993368&view=rev
Log:
On the javahl-ra branch:
Bring up-to-date with trunk.

Added:
    subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java
      - copied unchanged from r993364, subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java
Removed:
    subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNAdminTests.java
Modified:
    subversion/branches/javahl-ra/   (props changed)
    subversion/branches/javahl-ra/notes/wc-ng/conflict-storage
    subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
    subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java
    subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRATests.java
    subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
    subversion/branches/javahl-ra/subversion/include/private/svn_dep_compat.h
    subversion/branches/javahl-ra/subversion/include/private/svn_sqlite.h
    subversion/branches/javahl-ra/subversion/include/svn_string.h
    subversion/branches/javahl-ra/subversion/libsvn_client/merge.c
    subversion/branches/javahl-ra/subversion/libsvn_diff/parse-diff.c
    subversion/branches/javahl-ra/subversion/libsvn_ra_serf/serf.c
    subversion/branches/javahl-ra/subversion/libsvn_subr/hash.c
    subversion/branches/javahl-ra/subversion/libsvn_subr/io.c
    subversion/branches/javahl-ra/subversion/libsvn_subr/sqlite.c
    subversion/branches/javahl-ra/subversion/libsvn_subr/svn_string.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/adm_crawler.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/adm_files.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/adm_ops.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/copy.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/crop.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/diff.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/entries.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/lock.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/node.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/props.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/relocate.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/revision_status.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/status.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/tree_conflicts.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/upgrade.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/wc-metadata.sql
    subversion/branches/javahl-ra/subversion/libsvn_wc/wc-queries.sql
    subversion/branches/javahl-ra/subversion/libsvn_wc/wc.h
    subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.c
    subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.h
    subversion/branches/javahl-ra/subversion/libsvn_wc/workqueue.c
    subversion/branches/javahl-ra/subversion/mod_dav_svn/reports/log.c
    subversion/branches/javahl-ra/subversion/mod_dav_svn/reports/replay.c
    subversion/branches/javahl-ra/subversion/svnrdump/svnrdump.c
    subversion/branches/javahl-ra/subversion/tests/cmdline/diff_tests.py
    subversion/branches/javahl-ra/subversion/tests/cmdline/externals_tests.py
    subversion/branches/javahl-ra/subversion/tests/cmdline/merge_authz_tests.py
    subversion/branches/javahl-ra/subversion/tests/cmdline/merge_tests.py
    subversion/branches/javahl-ra/subversion/tests/cmdline/merge_tree_conflict_tests.py
    subversion/branches/javahl-ra/subversion/tests/cmdline/revert_tests.py
    subversion/branches/javahl-ra/subversion/tests/cmdline/svntest/actions.py
    subversion/branches/javahl-ra/subversion/tests/cmdline/update_tests.py
    subversion/branches/javahl-ra/subversion/tests/libsvn_wc/db-test.c
    subversion/branches/javahl-ra/tools/dev/unix-build/Makefile.svn

Propchange: subversion/branches/javahl-ra/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep  7 13:59:41 2010
@@ -37,3 +37,4 @@
 /subversion/branches/tc_url_rev:874351-874483
 /subversion/branches/tree-conflicts:868291-873154
 /subversion/branches/tree-conflicts-notify:873926-874008
+/subversion/trunk:991978-993364

Modified: subversion/branches/javahl-ra/notes/wc-ng/conflict-storage
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/notes/wc-ng/conflict-storage?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/notes/wc-ng/conflict-storage (original)
+++ subversion/branches/javahl-ra/notes/wc-ng/conflict-storage Tue Sep  7 13:59:41 2010
@@ -48,6 +48,16 @@ equivalent in wc-ng conflict storage (su
 but this information can be deduced from the information stored
 (e.g. conflict-old and friends; foo.r42 is now 'foo' + '.r' + left_rev)
 
+### BH: We have to store the exact name of the conflict marker files. If we
+### just 'guess' how conflict markers are named by using their revision
+### numbers, we can't handle situations where there are existing files with
+### these names. The WC-1.0 code uses a unique name function to generate a
+### unique marker file name which happens to match this pattern if there are
+### no conflicts, but sometimes explicitly preserves the existing file
+### extension to help diff tools. (See 'preserved-conflict-file-exts' in our
+### config). I think we can move the names of the markers into the skel and/or
+### keep them in their own columns. (These names are needed on filling a
+### svn_wc_entry_t)
 
 Operation skel
 --------------

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Tue Sep  7 13:59:41 2010
@@ -231,8 +231,8 @@ public class BasicTests extends SVNTests
         pw.print("modification to rho");
         pw.close();
         addExpectedCommitItem(thisTest.getWCPath(),
-                              thisTest.getUrl(), "A/D/G/rho", NodeKind.file,
-                              CommitItemStateFlags.TextMods);
+                              thisTest.getUrl().toString(), "A/D/G/rho",
+                              NodeKind.file, CommitItemStateFlags.TextMods);
         client.commit(thisTest.getWCPathSet(), Depth.infinity,
                       false, false, null, null, new ConstMsg("log msg"),
                       commitCallback);
@@ -254,7 +254,7 @@ public class BasicTests extends SVNTests
         // ----- r3: delete file A/D/G/pi ---------------------------
         client.remove(thisTest.getWCPathSet("/A/D/G/pi"),
                       false, false, null, null, null);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "A/D/G/pi", NodeKind.file,
                               CommitItemStateFlags.Delete);
         client.commit(thisTest.getWCPathSet(), Depth.infinity,
@@ -276,7 +276,7 @@ public class BasicTests extends SVNTests
         pw = new PrintWriter(new FileOutputStream(file, true));
         pw.print("modification to tau");
         pw.close();
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "A/D/G/tau",NodeKind.file,
                               CommitItemStateFlags.TextMods);
         client.commit(thisTest.getWCPathSet(), Depth.infinity,
@@ -299,7 +299,7 @@ public class BasicTests extends SVNTests
         // ----- r5: delete dir with no children  A/C ---------------
         client.remove(thisTest.getWCPathSet("/A/C"),
                       false, false, null, null, null);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "A/C", NodeKind.dir,
                               CommitItemStateFlags.Delete);
         client.commit(thisTest.getWCPathSet(), Depth.infinity,
@@ -315,7 +315,7 @@ public class BasicTests extends SVNTests
         dir.mkdir();
 
         client.add(dir.getAbsolutePath(), Depth.infinity, false, false, false);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "A/B/I", NodeKind.dir, CommitItemStateFlags.Add);
         client.commit(thisTest.getWCPathSet(), Depth.infinity,
                       false, false, null, null, new ConstMsg("log msg"),
@@ -340,8 +340,8 @@ public class BasicTests extends SVNTests
         client.propertySet(thisTest.getWCPath(), "propname", "propval",
                 Depth.empty, null, false, null, null);
         thisTest.getWc().setItemPropStatus("", Status.Kind.modified);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(), null,
-                              NodeKind.dir, CommitItemStateFlags.PropMods);
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
+                             null, NodeKind.dir, CommitItemStateFlags.PropMods);
         client.commit(thisTest.getWCPathSet(), Depth.infinity,
                       false, false, null, null, new ConstMsg("log msg"),
                       commitCallback);
@@ -356,7 +356,7 @@ public class BasicTests extends SVNTests
         pw.print("This is the file 'nu'.");
         pw.close();
         client.add(file.getAbsolutePath(), Depth.empty, false, false, false);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "A/D/H/nu", NodeKind.file,
                               CommitItemStateFlags.TextMods +
                               CommitItemStateFlags.Add);
@@ -377,7 +377,7 @@ public class BasicTests extends SVNTests
         // ----- r9: Prop change on A/B/F ---------------------------
         client.propertySet(thisTest.getWCPath() + "/A/B/F", "propname",
                            "propval", Depth.empty, null, false, null, null);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "A/B/F", NodeKind.dir,
                               CommitItemStateFlags.PropMods);
         client.commit(thisTest.getWCPathSet(), Depth.infinity,
@@ -398,7 +398,7 @@ public class BasicTests extends SVNTests
         // ----- r10-11: Replace file A/D/H/chi with file -----------
         client.remove(thisTest.getWCPathSet("/A/D/H/chi"),
                       false, false, null, null, null);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "A/D/H/chi", NodeKind.file,
                               CommitItemStateFlags.Delete);
         client.commit(thisTest.getWCPathSet(), Depth.infinity,
@@ -413,7 +413,7 @@ public class BasicTests extends SVNTests
         pw.print("This is the replacement file 'chi'.");
         pw.close();
         client.add(file.getAbsolutePath(), Depth.empty, false, false, false);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "A/D/H/chi", NodeKind.file,
                               CommitItemStateFlags.TextMods +
                               CommitItemStateFlags.Add);
@@ -435,7 +435,7 @@ public class BasicTests extends SVNTests
         // ----- r12: Delete dir A/B/E with children ----------------
         client.remove(thisTest.getWCPathSet("/A/B/E"),
                       false, false, null, null, null);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "A/B/E", NodeKind.dir,
                               CommitItemStateFlags.Delete);
         client.commit(thisTest.getWCPathSet(), Depth.infinity,
@@ -462,7 +462,7 @@ public class BasicTests extends SVNTests
         // ----- r13-14: Replace file A/D/H/psi with dir ------------
         client.remove(thisTest.getWCPathSet("/A/D/H/psi"),
                       false, false, null, null, null);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "A/D/H/psi", NodeKind.file,
                               CommitItemStateFlags.Delete);
         client.commit(thisTest.getWCPathSet(), Depth.infinity,
@@ -479,7 +479,7 @@ public class BasicTests extends SVNTests
         dir = new File(thisTest.getWorkingCopy(), "A/D/H/psi");
         dir.mkdir();
         client.add(dir.getAbsolutePath(), Depth.infinity, false, false, false);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "A/D/H/psi", NodeKind.dir,
                               CommitItemStateFlags.Add);
         client.commit(thisTest.getWCPathSet(), Depth.infinity,
@@ -622,8 +622,8 @@ public class BasicTests extends SVNTests
         thisTest.checkStatus();
 
         // recheckout the working copy
-        client.checkout(thisTest.getUrl(), thisTest.getWCPath(), null, null,
-                    Depth.infinity, false, false);
+        client.checkout(thisTest.getUrl().toString(), thisTest.getWCPath(),
+                   null, null, Depth.infinity, false, false);
 
         // deleted file should reapear
         thisTest.getWc().setItemTextStatus("A/B/lambda", Status.Kind.normal);
@@ -650,7 +650,7 @@ public class BasicTests extends SVNTests
         thisTest.getWc().setItemContent("A/mu",
                 thisTest.getWc().getItemContent("A/mu") + "appended mu text");
         addExpectedCommitItem(thisTest.getWCPath(),
-                thisTest.getUrl(), "A/mu",NodeKind.file,
+                thisTest.getUrl().toString(), "A/mu",NodeKind.file,
                 CommitItemStateFlags.TextMods);
 
         // modify file A/D/G/rho
@@ -664,7 +664,7 @@ public class BasicTests extends SVNTests
                 thisTest.getWc().getItemContent("A/D/G/rho")
                 + "new appended text for rho");
         addExpectedCommitItem(thisTest.getWCPath(),
-                thisTest.getUrl(), "A/D/G/rho",NodeKind.file,
+                thisTest.getUrl().toString(), "A/D/G/rho",NodeKind.file,
                 CommitItemStateFlags.TextMods);
 
         // commit the changes
@@ -746,7 +746,7 @@ public class BasicTests extends SVNTests
         thisTest.getWc().setItemContent("A/mu",
                 thisTest.getWc().getItemContent("A/mu") + "appended mu text");
         addExpectedCommitItem(thisTest.getWCPath(),
-                thisTest.getUrl(), "A/mu",NodeKind.file,
+                thisTest.getUrl().toString(), "A/mu",NodeKind.file,
                 CommitItemStateFlags.TextMods);
 
         // modify A/D/G/rho
@@ -760,7 +760,7 @@ public class BasicTests extends SVNTests
                 thisTest.getWc().getItemContent("A/D/G/rho")
                 + "new appended text for rho");
         addExpectedCommitItem(thisTest.getWCPath(),
-                thisTest.getUrl(), "A/D/G/rho",NodeKind.file,
+                thisTest.getUrl().toString(), "A/D/G/rho",NodeKind.file,
                 CommitItemStateFlags.TextMods);
 
         // commit the changes
@@ -800,9 +800,9 @@ public class BasicTests extends SVNTests
         OneTest thisTest = new OneTest();
 
         // create Y and Y/Z directories in the repository
-        addExpectedCommitItem(null, thisTest.getUrl(), "Y", NodeKind.none,
+        addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y", NodeKind.none,
                               CommitItemStateFlags.Add);
-        addExpectedCommitItem(null, thisTest.getUrl(), "Y/Z", NodeKind.none,
+        addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y/Z", NodeKind.none,
                               CommitItemStateFlags.Add);
         Set<String> urls = new HashSet<String>(2);
         urls.add(thisTest.getUrl() + "/Y");
@@ -850,7 +850,8 @@ public class BasicTests extends SVNTests
             wc.addItem("A/B/F/" + fileName,
                        wc.getItemContent("A/B/E/" + fileName));
             wc.setItemWorkingCopyRevision("A/B/F/" + fileName, 2);
-            addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+            addExpectedCommitItem(thisTest.getWCPath(),
+                                 thisTest.getUrl().toString(),
                                   "A/B/F/" + fileName, NodeKind.file,
                                   CommitItemStateFlags.Add |
                                   CommitItemStateFlags.IsCopy);
@@ -907,13 +908,13 @@ public class BasicTests extends SVNTests
             wc.addItem("A/B/F/" + fileName,
                        wc.getItemContent("A/B/E/" + fileName));
             wc.setItemWorkingCopyRevision("A/B/F/" + fileName, 2);
-            addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+            addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                                   "A/B/F/" + fileName, NodeKind.file,
                                   CommitItemStateFlags.Add |
                                   CommitItemStateFlags.IsCopy);
 
             wc.removeItem("A/B/E/" + fileName);
-            addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+            addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                                   "A/B/E/" + fileName, NodeKind.file,
                                   CommitItemStateFlags.Delete);
         }
@@ -1011,7 +1012,7 @@ public class BasicTests extends SVNTests
         thisTest.getWc().setItemWorkingCopyRevision("A/mu", 2);
         thisTest.getWc().setItemContent("A/mu", muContent);
         addExpectedCommitItem(thisTest.getWorkingCopy().getAbsolutePath(),
-                              thisTest.getUrl(), "A/mu", NodeKind.file,
+                              thisTest.getUrl().toString(), "A/mu", NodeKind.file,
                               CommitItemStateFlags.TextMods);
 
         // append 10 line to A/D/G/rho
@@ -1028,8 +1029,8 @@ public class BasicTests extends SVNTests
         thisTest.getWc().setItemWorkingCopyRevision("A/D/G/rho", 2);
         thisTest.getWc().setItemContent("A/D/G/rho", rhoContent);
         addExpectedCommitItem(thisTest.getWCPath(),
-                              thisTest.getUrl(), "A/D/G/rho", NodeKind.file,
-                              CommitItemStateFlags.TextMods);
+                              thisTest.getUrl().toString(), "A/D/G/rho",
+                              NodeKind.file, CommitItemStateFlags.TextMods);
 
         // commit the changes
         checkCommitRevision(thisTest, "wrong revision number from commit", 2,
@@ -1051,7 +1052,7 @@ public class BasicTests extends SVNTests
         thisTest.getWc().setItemWorkingCopyRevision("A/mu", 3);
         thisTest.getWc().setItemContent("A/mu", muContent);
         addExpectedCommitItem(thisTest.getWCPath(),
-                              thisTest.getUrl(), "A/mu", NodeKind.file,
+                              thisTest.getUrl().toString(), "A/mu", NodeKind.file,
                               CommitItemStateFlags.TextMods);
 
         // change the last line of A/mu in the first working copy
@@ -1063,7 +1064,8 @@ public class BasicTests extends SVNTests
         thisTest.getWc().setItemWorkingCopyRevision("A/D/G/rho", 3);
         thisTest.getWc().setItemContent("A/D/G/rho", rhoContent);
         addExpectedCommitItem(thisTest.getWCPath(),
-                              thisTest.getUrl(), "A/D/G/rho", NodeKind.file,
+                              thisTest.getUrl().toString(), "A/D/G/rho",
+                              NodeKind.file,
                               CommitItemStateFlags.TextMods);
 
         // commit these changes to the repository
@@ -1140,7 +1142,7 @@ public class BasicTests extends SVNTests
         thisTest.getWc().setItemWorkingCopyRevision("A/mu", 2);
         thisTest.getWc().setItemContent("A/mu", muContent);
         addExpectedCommitItem(thisTest.getWCPath(),
-                              thisTest.getUrl(), "A/mu", NodeKind.file,
+                              thisTest.getUrl().toString(), "A/mu", NodeKind.file,
                               CommitItemStateFlags.TextMods);
 
         // append a line to A/D/G/rho in the first working copy
@@ -1154,7 +1156,7 @@ public class BasicTests extends SVNTests
         thisTest.getWc().setItemWorkingCopyRevision("A/D/G/rho", 2);
         thisTest.getWc().setItemContent("A/D/G/rho", rhoContent);
         addExpectedCommitItem(thisTest.getWCPath(),
-                              thisTest.getUrl(), "A/D/G/rho", NodeKind.file,
+                              thisTest.getUrl().toString(), "A/D/G/rho", NodeKind.file,
                               CommitItemStateFlags.TextMods);
 
         // commit the changes in the first working copy
@@ -1689,8 +1691,8 @@ public class BasicTests extends SVNTests
         }
 
         // delete file iota in the repository
-        addExpectedCommitItem(null, thisTest.getUrl(), "iota", NodeKind.none,
-                CommitItemStateFlags.Delete);
+        addExpectedCommitItem(null, thisTest.getUrl().toString(), "iota",
+                             NodeKind.none, CommitItemStateFlags.Delete);
         client.remove(thisTest.getUrlSet("/iota"), false, false, null,
                       new ConstMsg("delete iota URL"), null);
     }
@@ -1719,7 +1721,7 @@ public class BasicTests extends SVNTests
 
         // commit the change
         addExpectedCommitItem(thisTest.getWCPath(),
-                thisTest.getUrl(), "A/D", NodeKind.dir,
+                thisTest.getUrl().toString(), "A/D", NodeKind.dir,
                 CommitItemStateFlags.Delete);
         checkCommitRevision(thisTest, "wrong revision from commit", 2,
                             thisTest.getWCPathSet(), "log message",
@@ -2040,7 +2042,7 @@ public class BasicTests extends SVNTests
                            null, false, null, null);
 
         addExpectedCommitItem(thisTest.getWCPath(),
-                              thisTest.getUrl(), "A/mu",NodeKind.file,
+                              thisTest.getUrl().toString(), "A/mu",NodeKind.file,
                               CommitItemStateFlags.PropMods);
         checkCommitRevision(thisTest, "bad revision number on commit", 2,
                             thisTest.getWCPathSet(), "message", Depth.infinity,
@@ -2054,8 +2056,8 @@ public class BasicTests extends SVNTests
         client.lock(muPathSet, "comment", false);
         assertEquals("file should be read write now", true, f.canWrite());
         addExpectedCommitItem(thisTest.getWCPath(),
-                              thisTest.getUrl(), "A/mu",NodeKind.file,
-                              0);
+                              thisTest.getUrl().toString(), "A/mu",
+                              NodeKind.file, 0);
         checkCommitRevision(thisTest, "rev number from commit", -1,
                             thisTest.getWCPathSet(), "message", Depth.infinity,
                             false, false, null, null);
@@ -2112,8 +2114,8 @@ public class BasicTests extends SVNTests
         String secondWC = thisTest.getWCPath() + ".empty";
         removeDirOrFile(new File(secondWC));
 
-        client.checkout(thisTest.getUrl(), secondWC, null, null, Depth.empty,
-                        false, true);
+        client.checkout(thisTest.getUrl().toString(), secondWC, null, null,
+                       Depth.empty, false, true);
 
         infos = collectInfos(secondWC, null, null, Depth.empty, null);
 
@@ -2272,7 +2274,8 @@ public class BasicTests extends SVNTests
             wc.setItemWorkingCopyRevision(path, rev);
             wc.setItemContent(path, wc.getItemContent(path) + toAppend);
         }
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(), path,
+        addExpectedCommitItem(thisTest.getWCPath(),
+                             thisTest.getUrl().toString(), path,
                               NodeKind.file, CommitItemStateFlags.TextMods);
         return f;
     }
@@ -2340,13 +2343,13 @@ public class BasicTests extends SVNTests
                      "end revision", new Revision.Number(4), actualRange[1]);
 
         // commit the changes so that we can verify merge
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "branches/A", NodeKind.dir,
                               CommitItemStateFlags.PropMods);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "branches/A/mu", NodeKind.file,
                               CommitItemStateFlags.TextMods);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "branches/A/D/G/rho", NodeKind.file,
                               CommitItemStateFlags.TextMods);
         checkCommitRevision(thisTest, "wrong revision number from commit", 5,
@@ -2400,10 +2403,10 @@ public class BasicTests extends SVNTests
                      branchPath, true, Depth.infinity, false, false, false);
 
         // commit the changes so that we can verify merge
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "branches/A", NodeKind.dir,
                               CommitItemStateFlags.PropMods);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "branches/A/mu", NodeKind.file,
                               CommitItemStateFlags.TextMods);
         checkCommitRevision(thisTest, "wrong revision number from commit", 5,
@@ -2451,10 +2454,10 @@ public class BasicTests extends SVNTests
                      branchPath, true, Depth.infinity, false, false, false);
 
         // commit the changes so that we can verify merge
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "branches/A", NodeKind.dir,
                               CommitItemStateFlags.PropMods);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "branches/A/mu", NodeKind.file,
                               CommitItemStateFlags.TextMods);
         checkCommitRevision(thisTest, "wrong revision number from commit", 6,
@@ -2478,12 +2481,12 @@ public class BasicTests extends SVNTests
                                     thisTest.getWCPath() + "/A", false);
         }
         // commit the changes so that we can verify merge
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
-                              "A", NodeKind.dir,
+        addExpectedCommitItem(thisTest.getWCPath(),
+                             thisTest.getUrl().toString(), "A", NodeKind.dir,
                               CommitItemStateFlags.PropMods);
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
-                              "A/D/G/rho", NodeKind.file,
-                              CommitItemStateFlags.TextMods);
+        addExpectedCommitItem(thisTest.getWCPath(),
+                             thisTest.getUrl().toString(), "A/D/G/rho",
+                             NodeKind.file, CommitItemStateFlags.TextMods);
         checkCommitRevision(thisTest, "wrong revision number from commit", 7,
                             thisTest.getWCPathSet(), "log msg", Depth.infinity,
                             false, false, null, null);
@@ -2530,7 +2533,7 @@ public class BasicTests extends SVNTests
         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,
+        client.merge(thisTest.getUrl().toString(), Revision.HEAD, ranges,
                      thisTest.getWCPath(), false, Depth.infinity, false,
                      false, false);
 
@@ -2576,7 +2579,7 @@ public class BasicTests extends SVNTests
                      branchPath, true, Depth.infinity, false, false, true);
 
         // commit the changes so that we can verify merge
-        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+        addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                               "branches/A", NodeKind.dir,
                               CommitItemStateFlags.PropMods);
         checkCommitRevision(thisTest, "wrong revision number from commit", 5,
@@ -2609,14 +2612,14 @@ public class BasicTests extends SVNTests
         assertEquals(0, suggestedSrcs.size());
 
         // create branches directory in the repository (r2)
-        addExpectedCommitItem(null, thisTest.getUrl(), "branches",
+        addExpectedCommitItem(null, thisTest.getUrl().toString(), "branches",
                               NodeKind.none, CommitItemStateFlags.Add);
         Set<String> paths = new HashSet<String>(1);
         paths.add(thisTest.getUrl() + "/branches");
         client.mkdir(paths, false, null, new ConstMsg("log_msg"), null);
 
         // copy A to branches (r3)
-        addExpectedCommitItem(null, thisTest.getUrl(), "branches/A",
+        addExpectedCommitItem(null, thisTest.getUrl().toString(), "branches/A",
                               NodeKind.none, CommitItemStateFlags.Add);
         List<CopySource> srcs = new ArrayList<CopySource>(1);
         srcs.add(new CopySource(thisTest.getUrl() + "/A", Revision.HEAD,
@@ -2721,9 +2724,9 @@ public class BasicTests extends SVNTests
         // Test relativeToDir fails with urls. */
         try
         {
-            client.diff(thisTest.getUrl() + "/iota", Revision.HEAD,
-                        thisTest.getUrl() + "/A/mu", Revision.HEAD,
-                        thisTest.getUrl(), diffOutput.getPath(),
+            client.diff(thisTest.getUrl().toString() + "/iota", Revision.HEAD,
+                        thisTest.getUrl().toString() + "/A/mu", Revision.HEAD,
+                        thisTest.getUrl().toString(), diffOutput.getPath(),
                         Depth.infinity, null, true, true, false, false);
 
             fail("This test should fail becaus the relativeToDir parameter " +
@@ -2814,7 +2817,7 @@ public class BasicTests extends SVNTests
                     Set<String> paths = new HashSet<String>(1);
                     paths.add(iotaPath);
                     addExpectedCommitItem(thisTest.getWCPath(),
-                            thisTest.getUrl(), "iota",NodeKind.file,
+                            thisTest.getUrl().toString(), "iota",NodeKind.file,
                             CommitItemStateFlags.PropMods);
                     client.commit(paths, Depth.empty, false, false, null, null,
                                   new ConstMsg("Set svn:eol-style to native"),
@@ -2931,15 +2934,15 @@ public class BasicTests extends SVNTests
         OneTest thisTest = new OneTest(false);
         DiffSummaries summaries = new DiffSummaries();
         // Perform a recursive diff summary, ignoring ancestry.
-        client.diffSummarize(thisTest.getUrl(), new Revision.Number(0),
-                             thisTest.getUrl(), Revision.HEAD, Depth.infinity,
+        client.diffSummarize(thisTest.getUrl().toString(), new Revision.Number(0),
+                             thisTest.getUrl().toString(), Revision.HEAD, Depth.infinity,
                              null, false, summaries);
         assertExpectedDiffSummaries(summaries);
 
         summaries.clear();
         // Perform a recursive diff summary with a peg revision,
         // ignoring ancestry.
-        client.diffSummarize(thisTest.getUrl(), Revision.HEAD,
+        client.diffSummarize(thisTest.getUrl().toString(), Revision.HEAD,
                              new Revision.Number(0), Revision.HEAD,
                              Depth.infinity, null, false, summaries);
         assertExpectedDiffSummaries(summaries);
@@ -3076,13 +3079,13 @@ public class BasicTests extends SVNTests
             wc.addItem("A/B/F/" + fileName,
                        wc.getItemContent("A/B/E/" + fileName));
             wc.setItemWorkingCopyRevision("A/B/F/" + fileName, 2);
-            addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+            addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                                   "A/B/F/" + fileName, NodeKind.file,
                                   CommitItemStateFlags.Add |
                                   CommitItemStateFlags.IsCopy);
 
             wc.removeItem("A/B/E/" + fileName);
-            addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
+            addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
                                   "A/B/E/" + fileName, NodeKind.file,
                                   CommitItemStateFlags.Delete);
         }
@@ -3137,7 +3140,7 @@ public class BasicTests extends SVNTests
         assertEquals(conflict.getSrcLeftVersion().getPegRevision(), 1L);
 
         assertEquals(conflict.getSrcRightVersion().getNodeKind(), NodeKind.none);
-        assertEquals(conflict.getSrcRightVersion().getReposURL(), tcTest.getUrl());
+        assertEquals(conflict.getSrcRightVersion().getReposURL(), tcTest.getUrl().toString());
         assertEquals(conflict.getSrcRightVersion().getPegRevision(), 2L);
 
     }
@@ -3364,7 +3367,7 @@ public class BasicTests extends SVNTests
         thisTest.getWc().setItemContent("A/mu",
                 thisTest.getWc().getItemContent("A/mu") + "appended mu text");
         addExpectedCommitItem(thisTest.getWCPath(),
-                thisTest.getUrl(), "A/mu",NodeKind.file,
+                thisTest.getUrl().toString(), "A/mu",NodeKind.file,
                 CommitItemStateFlags.TextMods);
 
         // commit the changes, with some extra revprops

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java (original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java Tue Sep  7 13:59:41 2010
@@ -70,14 +70,14 @@ public class RunTests
                     String className = methodName.substring(0, i);
                     try
                     {
-                        Class clazz = Class.forName(className);
-                        final Class[] argTypes = new Class[] { String.class };
-                        Constructor ctor =
+                        Class<?> clazz = Class.forName(className);
+                        final Class<?>[] argTypes = new Class[] { String.class };
+                        Constructor<?> ctor =
                             clazz.getDeclaredConstructor(argTypes);
                         methodName = methodName.substring(i + 1);
                         String[] args = { methodName };
                         testCases[testCaseIndex++] =
-                            (TestCase) ctor.newInstance(args);
+                            (TestCase) ctor.newInstance((Object[]) args);
                     }
                     catch (Exception e)
                     {
@@ -91,7 +91,7 @@ public class RunTests
             if (testCases == null || testCases.length == 0)
             {
                 // Add default test suites.
-                suite.addTestSuite(SVNAdminTests.class);
+                suite.addTestSuite(SVNReposTests.class);
                 suite.addTestSuite(SVNRATests.class);
                 suite.addTestSuite(BasicTests.class);
             }

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRATests.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRATests.java?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRATests.java (original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRATests.java Tue Sep  7 13:59:41 2010
@@ -52,7 +52,7 @@ public class SVNRATests extends SVNTests
         super.setUp();
 
         thisTest = new OneTest(false);
-        ra = new SVNReposAccess(new URI(thisTest.getUrl()));
+        ra = new SVNReposAccess(thisTest.getUrl());
     }
 
     /**

Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java (original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java Tue Sep  7 13:59:41 2010
@@ -27,8 +27,9 @@ import org.apache.subversion.javahl.call
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
-import java.io.OutputStream;
 import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.Set;
 import java.util.HashSet;
 import java.util.HashMap;
@@ -236,7 +237,8 @@ class SVNTests extends TestCase
         admin.create(greekRepos, true,false, null, this.fsType);
         addExpectedCommitItem(greekFiles.getAbsolutePath(), null, null,
                               NodeKind.none, CommitItemStateFlags.Add);
-        client.doImport(greekFiles.getAbsolutePath(), makeReposUrl(greekRepos),
+        client.doImport(greekFiles.getAbsolutePath(),
+                       makeReposUrl(greekRepos).toString(),
                         Depth.infinity, false, false, null, 
                         new MyCommitMessage(), null);
         admin.dump(greekRepos, new FileOutputStream(greekDump),
@@ -418,14 +420,22 @@ class SVNTests extends TestCase
      * Create the url for the repository to be used for the tests.
      * @param file  the directory of the repository
      * @return the URL for the repository
+     * @throws SubversionException 
      */
-    protected String makeReposUrl(File file)
+    protected URI makeReposUrl(File file) throws SubversionException
     {
-        // split the common part of the root directory
-        String path = file.getAbsolutePath()
-            .substring(this.rootDir.getAbsolutePath().length() + 1);
-        // append to the root url
-        return rootUrl + path.replace(File.separatorChar, '/');
+       try
+       {
+            // split the common part of the root directory
+            String path = file.getAbsolutePath()
+                 .substring(this.rootDir.getAbsolutePath().length() + 1);
+            // append to the root url
+            return new URI(rootUrl + path.replace(File.separatorChar, '/'));
+       }
+       catch (URISyntaxException ex)
+       {
+           throw new SubversionException(ex.getMessage());
+       }
     }
 
     /**
@@ -507,7 +517,7 @@ class SVNTests extends TestCase
         /**
          * the url of the repository (used by SVNClient)
          */
-        protected String url;
+        protected URI url;
 
         /**
          * the expected layout of the working copy after the next subversion
@@ -660,7 +670,7 @@ class SVNTests extends TestCase
          * Returns the url of repository
          * @return  the url
          */
-        public String getUrl()
+        public URI getUrl()
         {
             return url;
         }
@@ -719,12 +729,12 @@ class SVNTests extends TestCase
             throws SubversionException, IOException
         {
             // build a clean working directory
-            String uri = makeReposUrl(repos);
+            URI uri = makeReposUrl(repos);
             workingCopy = new File(workingCopies, this.testName);
             removeDirOrFile(workingCopy);
             // checkout the repository
-            client.checkout(uri, workingCopy.getAbsolutePath(), null, null,
-                    Depth.infinity, false, false);
+            client.checkout(uri.toString(), workingCopy.getAbsolutePath(),
+                   null, null, Depth.infinity, false, false);
             // sanity check the working with its expected status
             checkStatus();
             return workingCopy;

Modified: subversion/branches/javahl-ra/subversion/include/private/svn_dep_compat.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/private/svn_dep_compat.h?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/private/svn_dep_compat.h (original)
+++ subversion/branches/javahl-ra/subversion/include/private/svn_dep_compat.h Tue Sep  7 13:59:41 2010
@@ -62,6 +62,15 @@ extern "C" {
 #define apr_array_clear(arr)         (arr)->nelts = 0
 #endif
 
+#if !APR_VERSION_AT_LEAST(1,3,0)
+#define APR_UINT32_MAX 0xFFFFFFFFU
+#define APR_INT32_MAX  0x7FFFFFFF
+#define APR_INT32_MIN (-APR_INT32_MAX-1)
+#define APR_UINT64_MAX APR_UINT64_C(0xFFFFFFFFFFFFFFFF)
+#define APR_INT64_MAX   APR_INT64_C(0x7FFFFFFFFFFFFFFF)
+#define APR_INT64_MIN (-APR_INT64_MAX-1)
+#endif
+
 /**
  * Check at compile time if the Serf version is at least a certain
  * level.

Modified: subversion/branches/javahl-ra/subversion/include/private/svn_sqlite.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/private/svn_sqlite.h?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/private/svn_sqlite.h (original)
+++ subversion/branches/javahl-ra/subversion/include/private/svn_sqlite.h Tue Sep  7 13:59:41 2010
@@ -148,14 +148,16 @@ svn_sqlite__prepare(svn_sqlite__stmt_t *
 
 /* Bind values to SQL parameters in STMT, according to FMT.  FMT may contain:
 
-   Spec  Argument type       Item type
-   ----  -----------------   ---------
-   i     apr_int64_t         Number
-   s     const char *        String
-   b     const void *        Blob data
-         apr_size_t          Blob length
-   t     const svn_token_t * Token mapping table
-         int value           Token value
+   Spec  Argument type             Item type
+   ----  -----------------         ---------
+   n     <none, absent>            Column assignment skip
+   i     apr_int64_t               Number
+   s     const char *              String
+   b     const void *              Blob data
+         apr_size_t                Blob length
+   r     svn_revnum_t              Revision number
+   t     const svn_token_t *       Token mapping table
+         int value                 Token value
 
   Each character in FMT maps to one SQL parameter, and one or two function
   parameters, in the order they appear.
@@ -192,8 +194,14 @@ svn_sqlite__bind_token(svn_sqlite__stmt_
                        const svn_token_map_t *map,
                        int value);
 
+/* Bind the value to SLOT, unless SVN_IS_VALID_REVNUM(value) is false,
+   in which case it binds NULL.  */
+svn_error_t *
+svn_sqlite__bind_revnum(svn_sqlite__stmt_t *stmt, int slot,
+                        svn_revnum_t value);
+
 /* Bind a set of properties to the given slot. If PROPS is NULL, then no
-   binding will occur. PROPS will be stored as a serialized skel. */
+/   binding will occur. PROPS will be stored as a serialized skel. */
 svn_error_t *
 svn_sqlite__bind_properties(svn_sqlite__stmt_t *stmt,
                             int slot,
@@ -310,6 +318,34 @@ svn_sqlite__with_transaction(svn_sqlite_
                              void *cb_baton, apr_pool_t *scratch_pool);
 
 
+/* Helper function to handle several SQLite operations inside a shared lock.
+   This callback is similar to svn_sqlite__with_transaction(), but can be
+   nested (even with a transaction) and changes in the callback are always
+   committed when this function returns.
+
+   Behavior on an application crash while this function is running is
+   UNDEFINED: Either everything is committed (for < 3.6.8) or is not (for
+   >= 3.6.8 where this function uses a SAVEPOINT), so this should only be used
+   for operations that are safe under these conditions or just for reading.
+
+   Use a transaction when you need explicit behavior.
+
+   For SQLite 3.6.8 and later using this function as a wrapper around a group
+   of operations can give a *huge* performance boost as the shared-read lock
+   will be shared over multiple statements, instead of being reobtained
+   everytime, which requires disk and/or network io.
+
+   ### It might be possible to implement the same lock behavior for < 3.6.8
+       by keeping a read SQLite statement open, but this wouldn't replicate
+       the rollback behavior on crashing. Maybe we should just require 3.6.8?
+ */
+svn_error_t *
+svn_sqlite__with_lock(svn_sqlite__db_t *db,
+                      svn_sqlite__transaction_callback_t cb_func,
+                      void *cb_baton,
+                      apr_pool_t *scratch_pool);
+
+
 /* Hotcopy an SQLite database from SRC_PATH to DST_PATH. */
 svn_error_t *
 svn_sqlite__hotcopy(const char *src_path,

Modified: subversion/branches/javahl-ra/subversion/include/svn_string.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/svn_string.h?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/svn_string.h (original)
+++ subversion/branches/javahl-ra/subversion/include/svn_string.h Tue Sep  7 13:59:41 2010
@@ -388,6 +388,71 @@ svn_cstring_join(const apr_array_header_
 int
 svn_cstring_casecmp(const char *str1, const char *str2);
 
+/**
+ * Parse the C string @a str into a 64 bit number, and return it in @a *n.
+ * Assume that the number is represented in base @a base.
+ * Raise an error if conversion fails (e.g. due to overflow), or if the
+ * converted number is smaller than @a minval or larger than @a maxval. 
+ *
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_cstring_strtoi64(apr_int64_t *n, const char *str,
+                     apr_int64_t minval, apr_int64_t maxval,
+                     int base);
+
+/**
+ * Parse the C string @a str into a 64 bit number, and return it in @a *n.
+ * Assume that the number is represented in base 10.
+ * Raise an error if conversion fails (e.g. due to overflow).
+ *
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_cstring_atoi64(apr_int64_t *n, const char *str);
+
+/**
+ * Parse the C string @a str into a 32 bit number, and return it in @a *n.
+ * Assume that the number is represented in base 10.
+ * Raise an error if conversion fails (e.g. due to overflow).
+ *
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_cstring_atoi(int *n, const char *str);
+
+/**
+ * Parse the C string @a str into an unsigned 64 bit number, and return
+ * it in @a *n. Assume that the number is represented in base @a base.
+ * Raise an error if conversion fails (e.g. due to overflow), or if the
+ * converted number is smaller than @a minval or larger than @a maxval. 
+ *
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_cstring_strtoui64(apr_uint64_t *n, const char *str,
+                      apr_uint64_t minval, apr_uint64_t maxval,
+                      int base);
+
+/**
+ * Parse the C string @a str into an unsigned 64 bit number, and return
+ * it in @a *n. Assume that the number is represented in base 10.
+ * Raise an error if conversion fails (e.g. due to overflow).
+ *
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_cstring_atoui64(apr_uint64_t *n, const char *str);
+
+/**
+ * Parse the C string @a str into an unsigned 32 bit number, and return
+ * it in @a *n. Assume that the number is represented in base 10.
+ * Raise an error if conversion fails (e.g. due to overflow).
+ *
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_cstring_atoui(unsigned int *n, const char *str);
 
 /** @} */
 

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/merge.c?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/merge.c Tue Sep  7 13:59:41 2010
@@ -5304,6 +5304,17 @@ struct get_mergeinfo_walk_baton
 {
   /* Array of paths that have explicit mergeinfo and/or are switched. */
   apr_array_header_t *children_with_mergeinfo;
+
+  /* A hash of MERGE_TARGET_ABSPATH's subdirectories' dirents.  Maps
+     const char * absolute working copy paths to dirent hashes as obtained
+     by svn_io_get_dirents3().  Contents are allocated in CB_POOL. */
+  apr_hash_t *subtree_dirents;
+
+  /* A hash to keep track of any subtrees in the merge target which are
+     unexpectedly missing from disk.  Maps const char * absolute working
+     copy paths to the same.  Contents are allocated in CB_POOL. */
+  apr_hash_t *missing_subtrees;
+
   /* Merge source canonical path. */
   const char* merge_src_canon_path;
 
@@ -5324,8 +5335,111 @@ struct get_mergeinfo_walk_baton
 
   /* Pool from which to allocate new elements of CHILDREN_WITH_MERGEINFO. */
   apr_pool_t *pool;
+
+  /* Pool with a lifetime guaranteed over all the get_mergeinfo_walk_cb
+     callbacks. */
+  apr_pool_t *cb_pool;
 };
 
+/* Helper for the svn_wc__node_found_func_t callback get_mergeinfo_walk_cb().
+
+   Checks for issue #2915 subtrees, i.e. those that the WC thinks are on disk
+   but have been removed due to an OS-level deletion.
+
+   If the supposed working path LOCAL_ABSPATH, of kind KIND, is the root
+   of a missing subtree, then add a (const char *) WC absolute path to
+   (const char *) WC absolute path mapping to MISSING_SUBTREES, where the
+   paths are both a copy of LOCAL_ABSPATH, allocated in RESULT_POOL.
+
+   If LOCAL_ABSPATH is a directory and is not missing from disk, then add
+   a (const char *) WC absolute path to (svn_io_dirent2_t *) dirent mapping
+   to SUBTREE_DIRENTS, again allocated in RESULT_POOL (see
+   svn_io_get_dirents3).
+
+   SCRATCH_POOL is used for temporary allocations.
+
+   Note: Since this is effetively a svn_wc__node_found_func_t callback, it
+   must be called in depth-first order. */
+static svn_error_t *
+record_missing_subtree_roots(const char *local_abspath,
+                             svn_node_kind_t kind,
+                             apr_hash_t *subtree_dirents,
+                             apr_hash_t *missing_subtrees,
+                             apr_pool_t *result_pool,
+                             apr_pool_t *scratch_pool)
+{
+  svn_boolean_t missing_subtree_root = FALSE;
+
+  /* Store the dirents for each directory in SUBTREE_DIRENTS. */
+  if (kind == svn_node_dir)
+    {
+      /* If SUBTREE_DIRENTS is empty LOCAL_ABSPATH is merge target. */
+      if (apr_hash_count(subtree_dirents) == 0 
+          || apr_hash_get(subtree_dirents,
+                          svn_dirent_dirname(local_abspath,
+                                             scratch_pool),
+                                             APR_HASH_KEY_STRING))
+        {
+          apr_hash_t *dirents;
+          svn_error_t *err = svn_io_get_dirents3(&dirents, local_abspath,
+                                                 TRUE, result_pool,
+                                                 scratch_pool);
+          if (err)
+            {
+              if (APR_STATUS_IS_ENOENT(err->apr_err)
+                  || SVN__APR_STATUS_IS_ENOTDIR(err->apr_err))
+                {
+                  /* We can't get this directory's dirents, it's missing
+                     from disk. */
+                  svn_error_clear(err);
+                  missing_subtree_root = TRUE;
+                }
+              else
+                {
+                  return err;
+                }
+            }
+          else
+            {
+              apr_hash_set(subtree_dirents,
+                           apr_pstrdup(result_pool, local_abspath),
+                           APR_HASH_KEY_STRING, dirents);
+            }      
+        }
+    }
+  else /* kind != svn_node_dir */
+    {
+      /* Is this non-directory missing from disk?  Check LOCAL_ABSPATH's
+         parent's dirents. */
+      apr_hash_t *parent_dirents = apr_hash_get(subtree_dirents,
+                                                svn_dirent_dirname(local_abspath,
+                                                                   scratch_pool),
+                                                APR_HASH_KEY_STRING);
+
+      /* If the parent_dirents is NULL, then LOCAL_ABSPATH is the
+         subtree of a missing subtree.  Since we only report the roots
+         of missing subtrees there is nothing more to do in that case. */
+      if (parent_dirents)
+        {
+          svn_io_dirent2_t *dirent =
+            apr_hash_get(parent_dirents,
+                         svn_dirent_basename(local_abspath, scratch_pool),
+                         APR_HASH_KEY_STRING);
+          if (!dirent)
+            missing_subtree_root = TRUE;
+        }
+    }
+
+  if (missing_subtree_root)
+    {
+      const char *path = apr_pstrdup(result_pool, local_abspath);
+
+      apr_hash_set(missing_subtrees, path,
+                   APR_HASH_KEY_STRING, path);
+    }
+
+  return SVN_NO_ERROR;
+}
 
 /* svn_wc__node_found_func_t callback for get_mergeinfo_paths().
 
@@ -5410,6 +5524,17 @@ get_mergeinfo_walk_cb(const char *local_
                          &&(kind == svn_node_dir)
                          && (strcmp(abs_parent_path,
                                     wb->merge_target_abspath) == 0));
+  /* Make sure what the WC thinks is present on disk really is. */
+#ifndef SVN_WC__SINGLE_DB
+   if (!absent && !deleted && !obstructed)
+#else
+   if (!absent && !deleted)
+#endif
+    SVN_ERR(record_missing_subtree_roots(local_abspath, kind,
+                                         wb->subtree_dirents,
+                                         wb->missing_subtrees,
+                                         wb->cb_pool,
+                                         scratch_pool));
 
   /* Store PATHs with explict mergeinfo, which are switched, are missing
      children due to a sparse checkout, are scheduled for deletion are absent
@@ -5628,7 +5753,7 @@ insert_parent_and_sibs_of_sw_absent_del_
 /* Helper for do_directory_merge()
 
    If HONOR_MERGEINFO is TRUE, then perform a depth first walk of the working
-   copy tree rooted at MERGE_CMD_BATON->TARGET_ABSPATH.
+   copy tree rooted at MERGE_CMD_BATON->TARGET_ABSPATH to depth DEPTH.
    Create an svn_client__merge_path_t * for any path which meets one or more
    of the following criteria:
 
@@ -5656,6 +5781,9 @@ insert_parent_and_sibs_of_sw_absent_del_
    If HONOR_MERGEINFO is FALSE, then create an svn_client__merge_path_t * only
    for MERGE_CMD_BATON->TARGET_ABSPATH (i.e. only criteria 7 is applied).
 
+   If subtrees within the requested DEPTH are unexpectedly missing disk,
+   then raise SVN_ERR_CLIENT_NOT_READY_TO_MERGE.
+
    Store the svn_client__merge_path_t *'s in *CHILDREN_WITH_MERGEINFO in
    depth-first order based on the svn_client__merge_path_t *s path member as
    sorted by svn_path_compare_paths().  Set the remaining_ranges field of each
@@ -5695,6 +5823,9 @@ get_mergeinfo_paths(apr_array_header_t *
   struct get_mergeinfo_walk_baton wb = { 0 };
 
   wb.children_with_mergeinfo = children_with_mergeinfo;
+  wb.cb_pool = svn_pool_create(scratch_pool);
+  wb.subtree_dirents = apr_hash_make(wb.cb_pool);
+  wb.missing_subtrees = apr_hash_make(wb.cb_pool);
   wb.merge_src_canon_path = merge_src_canon_path;
   wb.merge_target_abspath = merge_cmd_baton->target_abspath;
   wb.source_root_url = source_root_url;
@@ -5718,6 +5849,35 @@ get_mergeinfo_paths(apr_array_header_t *
                                      merge_cmd_baton->ctx->cancel_baton,
                                      scratch_pool));
 
+  if (apr_hash_count(wb.missing_subtrees))
+    {
+      apr_hash_index_t *hi;
+      svn_stringbuf_t *missing_subtree_err_buf =
+        svn_stringbuf_create(_("Merge tracking not allowed with missing "
+                               "subtrees; try restoring these items "
+                               "first:\n"), scratch_pool);
+
+      iterpool = svn_pool_create(scratch_pool);
+
+      for (hi = apr_hash_first(scratch_pool, wb.missing_subtrees);
+           hi;
+           hi = apr_hash_next(hi))
+        {
+          svn_pool_clear(iterpool);
+          svn_stringbuf_appendcstr(missing_subtree_err_buf,
+                                   svn_dirent_local_style(
+                                     svn__apr_hash_index_key(hi), iterpool));
+          svn_stringbuf_appendcstr(missing_subtree_err_buf, "\n");
+        }
+
+    return svn_error_create(SVN_ERR_CLIENT_NOT_READY_TO_MERGE,
+                            NULL, missing_subtree_err_buf->data);
+  }
+
+  /* This pool is only needed across all the callbacks to detect
+     missing subtrees. */
+  svn_pool_destroy(wb.cb_pool);
+
   /* CHILDREN_WITH_MERGEINFO must be in depth first order, but the node
      walk code returns nodes in a non particular order.  Also, we may need
      to add elements to the array to cover case 3) through 5) from the

Modified: subversion/branches/javahl-ra/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_diff/parse-diff.c?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_diff/parse-diff.c Tue Sep  7 13:59:41 2010
@@ -28,6 +28,7 @@
 #include "svn_error.h"
 #include "svn_io.h"
 #include "svn_pools.h"
+#include "svn_string.h"
 #include "svn_utf.h"
 #include "svn_dirent_uri.h"
 #include "svn_diff.h"
@@ -119,20 +120,18 @@ svn_diff_hunk_get_trailing_context(const
 static svn_boolean_t
 parse_offset(svn_linenum_t *offset, const char *number)
 {
-  apr_int64_t parsed_offset;
+  svn_error_t *err;
+  apr_uint64_t val;
 
-  errno = 0; /* apr_atoi64() in APR-0.9 does not always set errno */
-  parsed_offset = apr_atoi64(number);
-  if (errno == ERANGE || parsed_offset < 0)
-    return FALSE;
+  err = svn_cstring_strtoui64(&val, number, 0, SVN_LINENUM_MAX_VALUE, 10);
+  if (err)
+    {
+      svn_error_clear(err);
+      return FALSE;
+    }
 
-  /* In case we cannot fit 64 bits into an svn_linenum_t,
-   * check for overflow. */
-  if (sizeof(svn_linenum_t) < sizeof(parsed_offset) &&
-      parsed_offset > SVN_LINENUM_MAX_VALUE)
-    return FALSE;
+  *offset = (svn_linenum_t)val;
 
-  *offset = parsed_offset;
   return TRUE;
 }
 

Modified: subversion/branches/javahl-ra/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_ra_serf/serf.c?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_ra_serf/serf.c Tue Sep  7 13:59:41 2010
@@ -721,7 +721,7 @@ dirent_walker(void *baton,
         }
       else if (strcmp(name, "getcontentlength") == 0)
         {
-          entry->size = apr_atoi64(val->data);
+          SVN_ERR(svn_cstring_atoi64(&entry->size, val->data));
         }
       else if (strcmp(name, "resourcetype") == 0)
         {

Modified: subversion/branches/javahl-ra/subversion/libsvn_subr/hash.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_subr/hash.c?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_subr/hash.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_subr/hash.c Tue Sep  7 13:59:41 2010
@@ -344,11 +344,16 @@ svn_hash_read(apr_hash_t *hash,
         }
       else if ((buf[0] == 'K') && (buf[1] == ' '))
         {
+          size_t keylen;
+          int parsed_len;
+          void *keybuf;
+          
           /* Get the length of the key */
-          size_t keylen = (size_t) atoi(buf + 2);
+          SVN_ERR(svn_cstring_atoi(&parsed_len, buf + 2));
+          keylen = parsed_len;
 
           /* Now read that much into a buffer, + 1 byte for null terminator */
-          void *keybuf = apr_palloc(pool, keylen + 1);
+          keybuf = apr_palloc(pool, keylen + 1);
           SVN_ERR(svn_io_file_read_full(srcfile,
                                         keybuf, keylen, &num_read, pool));
           ((char *) keybuf)[keylen] = '\0';
@@ -365,12 +370,15 @@ svn_hash_read(apr_hash_t *hash,
           if ((buf[0] == 'V') && (buf[1] == ' '))
             {
               svn_string_t *value = apr_palloc(pool, sizeof(*value));
+              apr_size_t vallen;
+              void *valbuf;
 
               /* Get the length of the value */
-              apr_size_t vallen = atoi(buf + 2);
+              SVN_ERR(svn_cstring_atoi(&parsed_len, buf + 2));
+              vallen = parsed_len;
 
               /* Again, 1 extra byte for the null termination. */
-              void *valbuf = apr_palloc(pool, vallen + 1);
+              valbuf = apr_palloc(pool, vallen + 1);
               SVN_ERR(svn_io_file_read_full(srcfile,
                                             valbuf, vallen,
                                             &num_read, pool));
@@ -458,13 +466,7 @@ svn_hash_keys(apr_array_header_t **array
 
   for (hi = apr_hash_first(pool, hash); hi; hi = apr_hash_next(hi))
     {
-      const void *key;
-      const char *path;
-
-      apr_hash_this(hi, &key, NULL, NULL);
-      path = key;
-
-      APR_ARRAY_PUSH(*array, const char *) = path;
+      APR_ARRAY_PUSH(*array, const char *) = svn__apr_hash_index_key(hi);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/javahl-ra/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_subr/io.c?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_subr/io.c Tue Sep  7 13:59:41 2010
@@ -1025,14 +1025,19 @@ svn_error_t *svn_io_file_create(const ch
 {
   apr_file_t *f;
   apr_size_t written;
+  svn_error_t *err;
 
   SVN_ERR(svn_io_file_open(&f, file,
                            (APR_WRITE | APR_CREATE | APR_EXCL),
                            APR_OS_DEFAULT,
                            pool));
-  SVN_ERR(svn_io_file_write_full(f, contents, strlen(contents),
-                                 &written, pool));
-  return svn_io_file_close(f, pool);
+  err= svn_io_file_write_full(f, contents, strlen(contents),
+                              &written, pool);
+
+
+  return svn_error_return(
+                        svn_error_compose_create(err,
+                                                 svn_io_file_close(f, pool)));
 }
 
 svn_error_t *svn_io_dir_file_copy(const char *src_path,
@@ -2868,12 +2873,19 @@ svn_io_write_unique(const char **tmp_pat
                     apr_pool_t *pool)
 {
   apr_file_t *new_file;
+  svn_error_t *err;
 
   SVN_ERR(svn_io_open_unique_file3(&new_file, tmp_path, dirpath,
                                    delete_when, pool, pool));
-  SVN_ERR(svn_io_file_write_full(new_file, buf, nbytes, NULL, pool));
-  SVN_ERR(svn_io_file_flush_to_disk(new_file, pool));
-  return svn_io_file_close(new_file, pool);
+
+  err = svn_io_file_write_full(new_file, buf, nbytes, NULL, pool);
+
+  if (!err)
+    err = svn_io_file_flush_to_disk(new_file, pool);
+
+  return svn_error_return(
+                  svn_error_compose_create(err,
+                                           svn_io_file_close(new_file, pool)));
 }
 
 
@@ -3437,15 +3449,17 @@ svn_io_read_version_file(int *version,
   apr_file_t *format_file;
   char buf[80];
   apr_size_t len;
+  svn_error_t *err;
 
   /* Read a chunk of data from PATH */
   SVN_ERR(svn_io_file_open(&format_file, path, APR_READ,
                            APR_OS_DEFAULT, pool));
   len = sizeof(buf);
-  SVN_ERR(svn_io_file_read(format_file, buf, &len, pool));
+  err = svn_io_file_read(format_file, buf, &len, pool);
 
   /* Close the file. */
-  SVN_ERR(svn_io_file_close(format_file, pool));
+  SVN_ERR(svn_error_compose_create(err,
+                                   svn_io_file_close(format_file, pool)));
 
   /* If there was no data in PATH, return an error. */
   if (len == 0)
@@ -3472,7 +3486,7 @@ svn_io_read_version_file(int *version,
   }
 
   /* Convert to integer. */
-  *version = atoi(buf);
+  SVN_ERR(svn_cstring_atoi(version, buf));
 
   return SVN_NO_ERROR;
 }
@@ -3486,48 +3500,65 @@ contents_identical_p(svn_boolean_t *iden
                      const char *file2,
                      apr_pool_t *pool)
 {
-  svn_error_t *err1;
-  svn_error_t *err2;
+  svn_error_t *err;
   apr_size_t bytes_read1, bytes_read2;
   char *buf1 = apr_palloc(pool, SVN__STREAM_CHUNK_SIZE);
   char *buf2 = apr_palloc(pool, SVN__STREAM_CHUNK_SIZE);
   apr_file_t *file1_h = NULL;
   apr_file_t *file2_h = NULL;
+  svn_boolean_t done1 = FALSE;
+  svn_boolean_t done2 = FALSE;
 
   SVN_ERR(svn_io_file_open(&file1_h, file1, APR_READ, APR_OS_DEFAULT,
                            pool));
-  SVN_ERR(svn_io_file_open(&file2_h, file2, APR_READ, APR_OS_DEFAULT,
-                           pool));
+
+  err = svn_io_file_open(&file2_h, file2, APR_READ, APR_OS_DEFAULT,
+                         pool);
+
+  if (err)
+    return svn_error_return(
+               svn_error_compose_create(err,
+                                        svn_io_file_close(file1_h, pool)));
 
   *identical_p = TRUE;  /* assume TRUE, until disproved below */
-  do
+  while (! (done1 || done2))
     {
-      err1 = svn_io_file_read_full(file1_h, buf1,
-                                   SVN__STREAM_CHUNK_SIZE, &bytes_read1, pool);
-      if (err1 && !APR_STATUS_IS_EOF(err1->apr_err))
-        return err1;
-
-      err2 = svn_io_file_read_full(file2_h, buf2,
-                                   SVN__STREAM_CHUNK_SIZE, &bytes_read2, pool);
-      if (err2 && !APR_STATUS_IS_EOF(err2->apr_err))
+      err = svn_io_file_read_full(file1_h, buf1,
+                                  SVN__STREAM_CHUNK_SIZE, &bytes_read1, pool);
+      if (err && APR_STATUS_IS_EOF(err->apr_err))
         {
-          svn_error_clear(err1);
-          return err2;
+          svn_error_clear(err);
+          err = NULL;
+          done1 = TRUE;
         }
+      else if (err)
+        break;
+
+      err = svn_io_file_read_full(file2_h, buf2,
+                                  SVN__STREAM_CHUNK_SIZE, &bytes_read2, pool);
+      if (err && APR_STATUS_IS_EOF(err->apr_err))
+        {
+          svn_error_clear(err);
+          err = NULL;
+          done2 = TRUE;
+        }
+      else if (err)
+        break;
 
       if ((bytes_read1 != bytes_read2)
+          || (done1 != done2)
           || (memcmp(buf1, buf2, bytes_read1)))
         {
           *identical_p = FALSE;
           break;
         }
-    } while (! err1 && ! err2);
-
-  svn_error_clear(err1);
-  svn_error_clear(err2);
+    }
 
-  SVN_ERR(svn_io_file_close(file1_h, pool));
-  return svn_io_file_close(file2_h, pool);
+  return svn_error_return(
+           svn_error_compose_create(
+                err,
+                svn_error_compose_create(svn_io_file_close(file1_h, pool),
+                                         svn_io_file_close(file2_h, pool))));
 }
 
 

Modified: subversion/branches/javahl-ra/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_subr/sqlite.c?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_subr/sqlite.c Tue Sep  7 13:59:41 2010
@@ -71,6 +71,7 @@ struct svn_sqlite__db_t
   int nbr_statements;
   svn_sqlite__stmt_t **prepared_stmts;
   apr_pool_t *state_pool;
+  unsigned savepoint_nr;
 };
 
 struct svn_sqlite__stmt_t
@@ -273,11 +274,20 @@ vbindf(svn_sqlite__stmt_t *stmt, const c
             SVN_ERR(svn_sqlite__bind_blob(stmt, count, blob, blob_size));
             break;
 
+          case 'r':
+            SVN_ERR(svn_sqlite__bind_revnum(stmt, count,
+                                            va_arg(ap, svn_revnum_t)));
+            break;
+
           case 't':
             map = va_arg(ap, const svn_token_map_t *);
             SVN_ERR(svn_sqlite__bind_token(stmt, count, map, va_arg(ap, int)));
             break;
 
+          case 'n':
+            /* Skip this column: no binding */
+            break;
+
           default:
             SVN_ERR_MALFUNCTION();
         }
@@ -352,6 +362,20 @@ svn_sqlite__bind_token(svn_sqlite__stmt_
 }
 
 svn_error_t *
+svn_sqlite__bind_revnum(svn_sqlite__stmt_t *stmt,
+                        int slot,
+                        svn_revnum_t value)
+{
+  if (SVN_IS_VALID_REVNUM(value))
+    SQLITE_ERR(sqlite3_bind_int64(stmt->s3stmt, slot,
+                                  (sqlite_int64)value), stmt->db);
+  else
+    SQLITE_ERR(sqlite3_bind_null(stmt->s3stmt, slot), stmt->db);
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_sqlite__bind_properties(svn_sqlite__stmt_t *stmt,
                             int slot,
                             const apr_hash_t *props,
@@ -1018,6 +1042,60 @@ svn_sqlite__with_transaction(svn_sqlite_
 }
 
 svn_error_t *
+svn_sqlite__with_lock(svn_sqlite__db_t *db,
+                      svn_sqlite__transaction_callback_t cb_func,
+                      void *cb_baton,
+                      apr_pool_t *scratch_pool)
+{
+  svn_error_t *err;
+
+#if SQLITE_VERSION_AT_LEAST(3,6,8)
+  svn_error_t *err2;
+  int savepoint = db->savepoint_nr++;
+  const char *release_stmt;
+
+  SVN_ERR(exec_sql(db,
+                   apr_psprintf(scratch_pool, "SAVEPOINT s%u;", savepoint)));
+#endif
+
+  err = cb_func(cb_baton, db, scratch_pool);
+
+#if SQLITE_VERSION_AT_LEAST(3,6,8)
+  release_stmt = apr_psprintf(scratch_pool, "RELEASE s%u;", savepoint);
+  err2 = exec_sql(db, release_stmt);
+
+  if (err2 && err2->apr_err == SVN_ERR_SQLITE_BUSY)
+    {
+      /* Ok, we have a major problem. Some statement is still open, which
+         makes it impossible to release this savepoint.
+
+         ### See huge comment in svn_sqlite__with_transaction for
+             further details */
+
+      int i;
+
+      err2 = svn_error_compose_create(err2,
+                   svn_error_create(SVN_ERR_SQLITE_RESETTING_FOR_ROLLBACK,
+                                    NULL, NULL));
+
+      for (i = 0; i < db->nbr_statements; i++)
+        if (db->prepared_stmts[i] && db->prepared_stmts[i]->needs_reset)
+          err2 = svn_error_compose_create(
+                     err2,
+                     svn_sqlite__reset(db->prepared_stmts[i]));
+
+          err2 = svn_error_compose_create(
+                      exec_sql(db, release_stmt),
+                      err2);
+    }
+
+  err = svn_error_compose_create(err, err2);
+#endif
+
+  return svn_error_return(err);
+}
+
+svn_error_t *
 svn_sqlite__hotcopy(const char *src_path,
                     const char *dst_path,
                     apr_pool_t *scratch_pool)

Modified: subversion/branches/javahl-ra/subversion/libsvn_subr/svn_string.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_subr/svn_string.c?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_subr/svn_string.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_subr/svn_string.c Tue Sep  7 13:59:41 2010
@@ -25,12 +25,16 @@
 
 
 
+#include <apr.h>
+
 #include <string.h>      /* for memcpy(), memcmp(), strlen() */
 #include <apr_lib.h>     /* for apr_isspace() */
 #include <apr_fnmatch.h>
 #include "svn_string.h"  /* loads "svn_types.h" and <apr_pools.h> */
 #include "svn_ctype.h"
+#include "private/svn_dep_compat.h"
 
+#include "svn_private_config.h"
 
 
 /* Our own realloc, since APR doesn't have one.  Note: this is a
@@ -605,3 +609,88 @@ svn_cstring_casecmp(const char *str1, co
         return cmp;
     }
 }
+
+svn_error_t *
+svn_cstring_strtoui64(apr_uint64_t *n, const char *str,
+                      apr_uint64_t minval, apr_uint64_t maxval,
+                      int base)
+{
+  apr_int64_t parsed;
+
+  /* We assume errno is thread-safe. */
+  errno = 0; /* APR-0.9 doesn't always set errno */
+
+  /* ### We're throwing away half the number range here.
+   * ### Maybe implement our own number parser? */
+  parsed = apr_strtoi64(str, NULL, base);
+  if (errno != 0)
+    return svn_error_return(
+             svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
+                               _("Could not convert '%s' into a number"),
+                               str));
+  if (parsed < 0 || parsed < minval || parsed > maxval)
+    return svn_error_return(
+             svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
+                               _("Number '%s' is out of range"), str));
+  *n = parsed;
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_cstring_atoui64(apr_uint64_t *n, const char *str)
+{
+  return svn_error_return(svn_cstring_strtoui64(n, str, 0,
+                                                APR_UINT64_MAX, 10));
+}
+
+svn_error_t *
+svn_cstring_atoui(unsigned int *n, const char *str)
+{
+  apr_uint64_t parsed;
+
+  SVN_ERR(svn_cstring_strtoui64(&parsed, str, 0, APR_UINT32_MAX, 10));
+  *n = (unsigned int)parsed;
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_cstring_strtoi64(apr_int64_t *n, const char *str,
+                     apr_int64_t minval, apr_int64_t maxval,
+                     int base)
+{
+  apr_int64_t parsed;
+
+  /* We assume errno is thread-safe. */
+  errno = 0; /* APR-0.9 doesn't always set errno */
+
+  parsed = apr_strtoi64(str, NULL, base);
+  if (errno != 0)
+    return svn_error_return(
+             svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
+                               _("Could not convert '%s' into a number"),
+                               str));
+  if (parsed < minval || parsed > maxval)
+    return svn_error_return(
+             svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
+                               _("Number '%s' is out of range"), str));
+  *n = parsed;
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_cstring_atoi64(apr_int64_t *n, const char *str)
+{
+  return svn_error_return(svn_cstring_strtoi64(n, str, APR_INT64_MIN,
+                                               APR_INT64_MAX, 10));
+}
+
+svn_error_t *
+svn_cstring_atoi(int *n, const char *str)
+{
+  apr_int64_t parsed;
+
+  SVN_ERR(svn_cstring_strtoi64(&parsed, str, APR_INT32_MIN,
+                               APR_INT32_MAX, 10));
+  *n = (int)parsed;
+  return SVN_NO_ERROR;
+}

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/adm_crawler.c?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/adm_crawler.c Tue Sep  7 13:59:41 2010
@@ -652,8 +652,10 @@ report_revisions_and_depths(svn_wc__db_t
              ### skip it right here. I guess with an obstruction, we
              ### can't really do anything with info the server might
              ### send, so maybe this is just fine.  */
+#ifdef SVN_WC__DB_SINGLE_DB
           if (this_status == svn_wc__db_status_obstructed)
             continue;
+#endif
 
           is_incomplete = (this_status == svn_wc__db_status_incomplete);
           start_empty = is_incomplete;

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/adm_files.c?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/adm_files.c Tue Sep  7 13:59:41 2010
@@ -357,13 +357,14 @@ svn_wc__get_pristine_contents(svn_stream
                                "because it has an unexpected status"),
                              svn_dirent_local_style(local_abspath,
                                                     scratch_pool));
+#ifndef SVN_WC__SINGLE_DB
   else
     /* We know that it is a file, so we can't hit the _obstructed stati.
        Also, we should never see _base_deleted here. */
     SVN_ERR_ASSERT(status != svn_wc__db_status_obstructed
                    && status != svn_wc__db_status_obstructed_add
-                   && status != svn_wc__db_status_obstructed_delete
-                   && status != svn_wc__db_status_base_deleted);
+                   && status != svn_wc__db_status_obstructed_delete);
+#endif
 
   if (sha1_checksum)
     SVN_ERR(svn_wc__db_pristine_read(contents, db, local_abspath,
@@ -638,8 +639,11 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
    * arbitrary revision and the URL may differ if the add is
    * being driven from a merge which will have a different URL. */
   if (status != svn_wc__db_status_deleted
+      && status != svn_wc__db_status_not_present
+#ifndef SVN_WC__SINGLE_DB
       && status != svn_wc__db_status_obstructed_delete
-      && status != svn_wc__db_status_not_present)
+#endif
+      )
     {
       /* ### Should we match copyfrom_revision? */
       if (db_revision != revision)

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/adm_ops.c?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/adm_ops.c Tue Sep  7 13:59:41 2010
@@ -151,7 +151,10 @@ process_committed_leaf(svn_wc__db_t *db,
   SVN_ERR(svn_wc__write_check(db, adm_abspath, scratch_pool));
 
   if (status == svn_wc__db_status_deleted
-      || status == svn_wc__db_status_obstructed_delete)
+#ifndef SVN_WC__SINGLE_DB
+      || status == svn_wc__db_status_obstructed_delete
+#endif
+      )
     {
       return svn_error_return(svn_wc__wq_add_deletion_postcommit(
                                 db, local_abspath, new_revnum, no_unlock,
@@ -309,7 +312,10 @@ svn_wc__process_committed_internal(svn_w
                  of running the log for the replaced directory that was
                  created at the start of this function). */
               if (status == svn_wc__db_status_deleted
-                  || status == svn_wc__db_status_obstructed_delete)
+#ifndef SVN_WC__SINGLE_DB
+                  || status == svn_wc__db_status_obstructed_delete
+#endif
+                  )
                 {
                   svn_boolean_t replaced;
 
@@ -963,7 +969,9 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
             node_exists = FALSE;
             break;
           case svn_wc__db_status_deleted:
+#ifndef SVN_WC__SINGLE_DB
           case svn_wc__db_status_obstructed_delete:
+#endif
             /* A working copy root should never have a WORKING_NODE */
             SVN_ERR_ASSERT(!is_wc_root);
             node_exists = FALSE;
@@ -1020,8 +1028,11 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
         || parent_status == svn_wc__db_status_not_present
         || parent_status == svn_wc__db_status_excluded
         || parent_status == svn_wc__db_status_absent
+#ifndef SVN_WC__SINGLE_DB
         || parent_status == svn_wc__db_status_obstructed
-        || parent_status == svn_wc__db_status_obstructed_add)
+        || parent_status == svn_wc__db_status_obstructed_add
+#endif
+        )
       {
         return
           svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, err,
@@ -1031,7 +1042,10 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
                                                    scratch_pool));
       }
     else if (parent_status == svn_wc__db_status_deleted
-             || parent_status == svn_wc__db_status_obstructed_delete)
+#ifndef SVN_WC__SINGLE_DB
+             || parent_status == svn_wc__db_status_obstructed_delete
+#endif
+             )
       {
         return
           svn_error_createf(SVN_ERR_WC_SCHEDULE_CONFLICT, NULL,

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/copy.c?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/copy.c Tue Sep  7 13:59:41 2010
@@ -642,7 +642,9 @@ svn_wc_copy3(svn_wc_context_t *wc_ctx,
                      svn_dirent_local_style(dst_abspath, scratch_pool));
 
           case svn_wc__db_status_deleted:
+#ifndef SVN_WC__SINGLE_DB
           case svn_wc__db_status_obstructed_delete:
+#endif
           case svn_wc__db_status_not_present:
             break; /* OK to add */
 

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/crop.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/crop.c?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/crop.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/crop.c Tue Sep  7 13:59:41 2010
@@ -251,7 +251,9 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
         SVN_ERR_MALFUNCTION();
 
       case svn_wc__db_status_added:
+#ifndef SVN_WC__SINGLE_DB
       case svn_wc__db_status_obstructed_add:
+#endif
         /* Would have to check parents if we want to allow this */
         return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
                                  _("Cannot exclude '%s': it is to be added "
@@ -259,7 +261,9 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
                                  svn_dirent_local_style(local_abspath,
                                                         scratch_pool));
       case svn_wc__db_status_deleted:
+#ifndef SVN_WC__SINGLE_DB
       case svn_wc__db_status_obstructed_delete:
+#endif
         /* Would have to check parents if we want to allow this */
         return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
                                  _("Cannot exclude '%s': it is to be deleted "
@@ -269,7 +273,9 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
 
       case svn_wc__db_status_normal:
       case svn_wc__db_status_incomplete:
+#ifndef SVN_WC__SINGLE_DB
       case svn_wc__db_status_obstructed:
+#endif
       default:
         break; /* Ok to exclude */
     }
@@ -357,16 +363,22 @@ svn_wc_crop_tree2(svn_wc_context_t *wc_c
                                svn_dirent_local_style(local_abspath,
                                                       scratch_pool));
 
-    if (status == svn_wc__db_status_deleted ||
-        status == svn_wc__db_status_obstructed_delete)
+    if (status == svn_wc__db_status_deleted
+#ifndef SVN_WC__SINGLE_DB
+        || status == svn_wc__db_status_obstructed_delete
+#endif
+        )
       return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
                                _("Cannot crop '%s': it is going to be removed "
                                  "from repository. Try commit instead"),
                                svn_dirent_local_style(local_abspath,
                                                       scratch_pool));
 
-    if (status == svn_wc__db_status_added ||
-        status == svn_wc__db_status_obstructed_add)
+    if (status == svn_wc__db_status_added
+#ifndef SVN_WC__SINGLE_DB
+        || status == svn_wc__db_status_obstructed_add
+#endif
+        )
       return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
                                _("Cannot crop '%s': it is to be added "
                                  "to the repository. Try commit instead"),

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/diff.c?rev=993368&r1=993367&r2=993368&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/diff.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/diff.c Tue Sep  7 13:59:41 2010
@@ -591,8 +591,7 @@ file_diff(struct dir_baton *db,
                                      NULL, NULL, NULL, NULL, NULL, NULL,
                                      eb->db, local_abspath, pool, pool));
 
-  replaced = ((status == svn_wc__db_status_added
-               || status == svn_wc__db_status_obstructed_add)
+  replaced = ((status == svn_wc__db_status_added)
               && have_base
               && base_status != svn_wc__db_status_not_present);