You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2012/08/07 20:20:28 UTC

svn commit: r1370418 [1/2] - in /subversion/branches/1.7.x-commit-performance: ./ build/generator/ build/generator/templates/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/javahl/tes...

Author: julianfoad
Date: Tue Aug  7 18:20:26 2012
New Revision: 1370418

URL: http://svn.apache.org/viewvc?rev=1370418&view=rev
Log:
On the 1.7.x-commit-performance branch: sync with 1.7.x@1370416.

Modified:
    subversion/branches/1.7.x-commit-performance/   (props changed)
    subversion/branches/1.7.x-commit-performance/STATUS
    subversion/branches/1.7.x-commit-performance/build.conf
    subversion/branches/1.7.x-commit-performance/build/generator/gen_make.py
    subversion/branches/1.7.x-commit-performance/build/generator/templates/makefile.ezt
    subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/native/Targets.cpp
    subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java
    subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
    subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/deprecated.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/externals.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/info.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/status.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_diff/diff_file.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_fs_fs/lock.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_ra_serf/update.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_ra_serf/xml.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_repos/replay.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/auth.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/dirent_uri.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/opt.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/sqlite.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/adm_ops.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/lock.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/merge.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/node.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/props.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/status.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/tree_conflicts.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/upgrade.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc-queries.sql
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db_util.c
    subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db_wcroot.c
    subversion/branches/1.7.x-commit-performance/subversion/svn/main.c
    subversion/branches/1.7.x-commit-performance/subversion/svn/propget-cmd.c
    subversion/branches/1.7.x-commit-performance/subversion/svn/props.c
    subversion/branches/1.7.x-commit-performance/subversion/svnlook/main.c
    subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/README
    subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/depth_tests.py
    subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/stat_tests.py
    subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/svnsync_tests.py
    subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/svntest/sandbox.py
    subversion/branches/1.7.x-commit-performance/subversion/tests/libsvn_wc/op-depth-test.c

Propchange: subversion/branches/1.7.x-commit-performance/
------------------------------------------------------------------------------
  Merged /subversion/branches/1.7.x-r1365554:r1365558-1367850
  Merged /subversion/branches/1.7.x:r1340559-1370416
  Merged /subversion/branches/1.7.x-r1341012:r1341013-1355629
  Merged /subversion/branches/1.7.x-r1361007:r1361110-1367853
  Merged /subversion/trunk:r1293945,1293972,1293976,1293998,1294134,1294136,1294147,1294236,1294586,1307177,1337441,1338810,1339164,1340556,1341012,1341031,1341034,1341076,1342984,1345482,1346765,1348822,1349215,1349367,1349371,1349380,1349778,1351772,1352068,1353572,1354626,1354652,1354876,1354907,1355340,1361007,1361019,1361341,1362508,1365549,1365554,1365556,1367498,1368065,1368128,1368197-1368198
  Merged /subversion/branches/1.7.x-r1352068:r1352087-1364232
  Merged /subversion/branches/1.7.x-r1348822:r1348878-1355700
  Merged /subversion/branches/1.7.x-r1361341:r1361342-1367855

Modified: subversion/branches/1.7.x-commit-performance/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/STATUS?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/STATUS (original)
+++ subversion/branches/1.7.x-commit-performance/STATUS Tue Aug  7 18:20:26 2012
@@ -15,53 +15,6 @@ Status of 1.7.6:
 Candidate changes:
 ==================
 
- * r1293945, r1293972, r1293976, r1293998, r1294136, r1294236;
-   r1294134, r1294147, r1294586
-   Two interdependent changes:
-   Fix issue #4121: copy followed by delete of unreadable child.
-   Fix svn:// authz in Python tests.
-   Justification:
-     User resorted to patching the commit editor to work around this.
-     Tests are broken.
-   Notes:
-     r1293945,r1293972,r1293976 are cosmetics.
-     r1293998 is the fix.
-     r1294136 is a test.
-     r1294236 fixes an uninitialized variable.
-   Notes:
-     r1294134 extends a test to demonstrate its brokenness.
-     r1294147 fixes said brokenness.
-     r1294586 fixes r1294147 for Windows.
-   Votes:
-     +1: danielsh, stsp
-
- * r1307177
-   Move mod_dontdothat to install-tools.
-   Justification:
-     Undo compatibility break of 'make install' in 1.7.3.
-   Votes:
-     +1: danielsh, gstein
-
- * r1337441
-   Fix XML namespace expansion in ra_serf
-   Justification:
-     Avoids segfaults caused by a malicious server sending unknown prefixes
-     to ra_serf. (and corrects the semantics for a bonus win)
-   Votes:
-     +1: gstein, rhuijben
-
- * r1338810, r1339164
-   Fix issue #4184 ("partial svnsync drops properties when converting
-   copies to adds").
-   Justification:
-     Syncs that don't aren't synced at all.
-   Notes:
-     r1338810 taught the code to send properties for demoted copies.
-     r1339164 fixed a theoretical use of uninitialized memory.
-   Votes:
-     +1: cmpilato
-     +1: rhuijben (r1338810 only)
-
  * r1306275, and too many other revisions to list here
    New diff support code for added/deleted files and directories.
    Fixes issue #4153, "svn log --diff" on moved file gives "not found",
@@ -76,10 +29,43 @@ Candidate changes:
      Please read the branch and related trunk log messages for detailed notes
      about these changes.
    Branch:
-     ^/subversion/branches/1.7.x-issue4153  
+     ^/subversion/branches/1.7.x-issue4153
    Votes:
      +1: stsp
-   
+
+ * ^/subversion/branches/1.7.x-commit-performance
+   Use the working copy status walker as a first filter to find committable
+   nodes.
+   Justification:
+     Huge performance boost. Especially on NFS.
+   Notes:
+     Backports the status walker framework. Many other parts are backportable
+     too, but this branch delivers the plumbing.
+   Votes:
+     +0: rhuijben (I would like to see some test results before backporting)
+
+ * r1341060
+   Sort output of 'svn import'
+   Notes: Needs a backport branch, noted here for completeness.
+   Votes:
+     +0: stsp (pending a proper conflict-free backport)
+     -0: julianfoad (Nice behaviour enhancement but what's the justification
+            for back-porting this on its own without similar for other
+            commands?  The log msg says it was done to maintain stable output
+            with APR 1.4.6 random hash order, but it wasn't stable before
+            that because the order the directory entries were read into the
+            hash, and so the order of multiple keys in one bucket, was not
+            controlled.)
+
+ * r1368662
+   Add information about the build system to 'svn --version' output.
+   Justification:
+      Makes solving user problems a little bit easier since the
+      default 'svn --version' output contains the config.guess
+      identification of the build system.
+   Votes:
+     +1: brane, steveking
+
 Veto-blocked changes:
 =====================
 

Modified: subversion/branches/1.7.x-commit-performance/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/build.conf?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/build.conf (original)
+++ subversion/branches/1.7.x-commit-performance/build.conf Tue Aug  7 18:20:26 2012
@@ -367,7 +367,7 @@ type = apache-mod
 path = tools/server-side/mod_dontdothat
 nonlibs = mod_dav_svn apr aprutil
 libs = libsvn_subr xml
-install = apache-mod
+install = tools
 msvc-libs = libhttpd.lib
 
 # ----------------------------------------------------------------------------

Modified: subversion/branches/1.7.x-commit-performance/build/generator/gen_make.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/build/generator/gen_make.py?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/build/generator/gen_make.py (original)
+++ subversion/branches/1.7.x-commit-performance/build/generator/gen_make.py Tue Aug  7 18:20:26 2012
@@ -369,18 +369,21 @@ class Generator(gen_base.GeneratorBase):
       # get the output files for these targets, sorted in dependency order
       files = gen_base._sorted_files(self.graph, area)
 
-      ezt_area = _eztdata(type=area, files=[ ], extra_install=None)
+      ezt_area = _eztdata(type=area, files=[ ], apache_files=[ ],
+                          extra_install=None)
 
-      if area == 'apache-mod':
-        data.areas.append(ezt_area)
-
-        for file in files:
+      def apache_file_to_eztdata(file):
           # cd to dirname before install to work around libtool 1.4.2 bug.
           dirname, fname = build_path_splitfile(file)
           base, ext = os.path.splitext(fname)
           name = base.replace('mod_', '')
-          ezt_area.files.append(_eztdata(fullname=file, dirname=dirname,
-                                         name=name, filename=fname))
+          return _eztdata(fullname=file, dirname=dirname,
+                          name=name, filename=fname)
+      if area == 'apache-mod':
+        data.areas.append(ezt_area)
+
+        for file in files:
+          ezt_area.files.append(apache_file_to_eztdata(file))
 
       elif area != 'test' and area != 'bdb-test':
         data.areas.append(ezt_area)
@@ -390,6 +393,14 @@ class Generator(gen_base.GeneratorBase):
         ezt_area.varname = area_var
         ezt_area.uppervar = upper_var
 
+        # ### TODO: This is a hack.  See discussion here:
+        # ### http://mid.gmane.org/20120316191639.GA28451@daniel3.local
+        apache_files = [t.filename for t in inst_targets
+                        if isinstance(t, gen_base.TargetApacheMod)]
+
+        files = [f for f in files if f not in apache_files]
+        for file in apache_files:
+          ezt_area.apache_files.append(apache_file_to_eztdata(file))
         for file in files:
           # cd to dirname before install to work around libtool 1.4.2 bug.
           dirname, fname = build_path_splitfile(file)

Modified: subversion/branches/1.7.x-commit-performance/build/generator/templates/makefile.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/build/generator/templates/makefile.ezt?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/build/generator/templates/makefile.ezt (original)
+++ subversion/branches/1.7.x-commit-performance/build/generator/templates/makefile.ezt Tue Aug  7 18:20:26 2012
@@ -126,11 +126,12 @@ $([target.varname]_OBJECTS): $([target.v
 [for areas]
 [is areas.type "apache-mod"]install-mods-shared:[for areas.files] [areas.files.fullname][end][for areas.files]
 	cd [areas.files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.files.name] [areas.files.filename][end]
-[else]install-[areas.type]: [for areas.files][if-index areas.files first][else] [end][areas.files.fullname][end]
+[else]install-[areas.type]: [for areas.files][if-index areas.files first][else] [end][areas.files.fullname][end] [for areas.apache_files] [areas.apache_files.fullname][end]
 	$(MKDIR) $(DESTDIR)$([areas.varname]dir)[for areas.files][is areas.type "locale"]
 	$(MKDIR) [areas.files.installdir]
 	cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] [areas.files.installdir]/$(PACKAGE_NAME)[areas.files.objext][else]
-	cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] $(DESTDIR)[areas.files.install_fname][end][end]
+	cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] $(DESTDIR)[areas.files.install_fname][end][end][for areas.apache_files]
+	cd [areas.apache_files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.apache_files.name] [areas.apache_files.filename][end]
 [if-any areas.extra_install]	$(INSTALL_EXTRA_[areas.uppervar])
 [end][end][end]
 

Modified: subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/native/Targets.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/native/Targets.cpp?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/native/Targets.cpp (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/native/Targets.cpp Tue Aug  7 18:20:26 2012
@@ -86,7 +86,7 @@ const apr_array_header_t *Targets::array
             m_error_occured = err;
             break;
         }
-      APR_ARRAY_PUSH(apr_targets, const char *) = *it;
+      APR_ARRAY_PUSH(apr_targets, const char *) = target;
     }
 
   return apr_targets;

Modified: subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java Tue Aug  7 18:20:26 2012
@@ -204,7 +204,12 @@ public class ConflictDescriptor
         /**
          * Attempting to delete object.
          */
-        delete;
+        delete,
+
+        /**
+         * Attempting to replace object.
+         */
+        replace;
     }
 
     /**
@@ -240,7 +245,12 @@ public class ConflictDescriptor
         /**
          * Object is already added or schedule-add.
          */
-        added;
+        added,
+
+        /**
+         * Object is already replaced.
+         */
+        replaced;
     }
 
     public enum Operation

Modified: subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Tue Aug  7 18:20:26 2012
@@ -1982,6 +1982,11 @@ public class BasicTests extends SVNTests
         assertEquals("wrong date with getTimeMillis()",
                      lm[0].getDate(),
                      new java.util.Date(lm[0].getTimeMillis()));
+
+        // Ensure that targets get canonicalized
+        String non_canonical = thisTest.getUrl().toString() + "/";
+        LogMessage lm2[] = collectLogMessages(non_canonical, null,
+                                              ranges, false, true, false, 0);
     }
 
     /**

Modified: subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java Tue Aug  7 18:20:26 2012
@@ -1963,6 +1963,11 @@ public class BasicTests extends SVNTests
         assertEquals("wrong date with getTimeMillis()",
                      lm[0].getDate(),
                      new java.util.Date(lm[0].getTimeMillis()));
+
+        // Ensure that targets get canonicalized
+        String non_canonical = thisTest.getUrl().toString() + "/";
+        LogMessage lm2[] = client.logMessages(non_canonical, null,
+                                              null, false, true);
     }
 
     /**

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/deprecated.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/deprecated.c Tue Aug  7 18:20:26 2012
@@ -1551,7 +1551,9 @@ svn_client_propset3(svn_commit_info_t **
 {
   if (svn_path_is_url(target))
     {
-      struct capture_baton_t cb = { commit_info_p, pool };
+      struct capture_baton_t cb;
+      cb.info = commit_info_p;
+      cb.pool = pool;
 
       SVN_ERR(svn_client_propset_remote(propname, propval, target, skip_checks,
                                         base_revision_for_url, revprop_table,
@@ -1864,8 +1866,10 @@ svn_client_status4(svn_revnum_t *result_
                    svn_client_ctx_t *ctx,
                    apr_pool_t *pool)
 {
-  struct status4_wrapper_baton swb = { ctx->wc_ctx, status_func,
-                                       status_baton };
+  struct status4_wrapper_baton swb;
+  swb.wc_ctx = ctx->wc_ctx;
+  swb.old_func = status_func;
+  swb.old_baton = status_baton;
 
   return svn_client_status5(result_rev, ctx, path, revision, depth, get_all,
                             update, no_ignore, ignore_externals, TRUE,

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/externals.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/externals.c Tue Aug  7 18:20:26 2012
@@ -180,31 +180,45 @@ switch_dir_external(const char *local_ab
               return SVN_NO_ERROR;
             }
 
+          /* We'd really prefer not to have to do a brute-force
+             relegation -- blowing away the current external working
+             copy and checking it out anew -- so we'll first see if we
+             can get away with a generally cheaper relocation (if
+             required) and switch-style update.
+
+             To do so, we need to know the repository root URL of the
+             external working copy as it currently sits. */
           SVN_ERR(svn_wc__node_get_repos_info(&repos_root_url, &repos_uuid,
                                               ctx->wc_ctx, local_abspath,
                                               pool, subpool));
           if (repos_root_url)
             {
-              /* URLs don't match.  Try to relocate (if necessary) and then
-                 switch. */
+              /* If the new external target URL is not obviously a
+                 child of the external working copy's current
+                 repository root URL... */
               if (! svn_uri__is_ancestor(repos_root_url, url))
                 {
                   const char *repos_root;
                   svn_ra_session_t *ra_session;
 
-                  /* Get the repos root of the new URL. */
-                  SVN_ERR(svn_client__open_ra_session_internal
-                          (&ra_session, NULL, url, NULL, NULL,
-                           FALSE, TRUE, ctx, subpool));
+                  /* ... then figure out precisely which repository
+                      root URL that target URL *is* a child of ... */
+                  SVN_ERR(svn_client__open_ra_session_internal(&ra_session,
+                                                               NULL, url, NULL,
+                                                               NULL, FALSE,
+                                                               TRUE, ctx,
+                                                               subpool));
                   SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root,
                                                  subpool));
 
+                  /* ... and use that to try to relocate the external
+                     working copy to the target location.  */
                   err = svn_client_relocate2(local_abspath, repos_root_url,
-                                             repos_root,
-                                             FALSE, ctx, subpool);
-                  /* If the relocation failed because the new URL points
-                     to another repository, then we need to relegate and
-                     check out a new WC. */
+                                             repos_root, FALSE, ctx, subpool);
+
+                  /* If the relocation failed because the new URL
+                     points to a totally different repository, we've
+                     no choice but to relegate and check out a new WC. */
                   if (err
                       && (err->apr_err == SVN_ERR_WC_INVALID_RELOCATION
                           || (err->apr_err
@@ -215,6 +229,10 @@ switch_dir_external(const char *local_ab
                     }
                   else if (err)
                     return svn_error_trace(err);
+
+                  /* If the relocation went without a hitch, we should
+                     have a new repository root URL. */
+                  repos_root_url = repos_root;
                 }
 
               SVN_ERR(svn_client__switch_internal(NULL, local_abspath, url,

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/info.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/info.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/info.c Tue Aug  7 18:20:26 2012
@@ -293,7 +293,9 @@ svn_client_info3(const char *abspath_or_
           || peg_revision->kind == svn_opt_revision_unspecified))
     {
       /* Do all digging in the working copy. */
-      wc_info_receiver_baton_t b = { receiver, receiver_baton };
+      wc_info_receiver_baton_t b;
+      b.client_receiver_func = receiver;
+      b.client_receiver_baton = receiver_baton;
       return svn_error_trace(
         svn_wc__get_info(ctx->wc_ctx, abspath_or_url, depth,
                         fetch_excluded, fetch_actual_only, changelists,

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/status.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/status.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_client/status.c Tue Aug  7 18:20:26 2012
@@ -299,7 +299,12 @@ svn_client_status5(svn_revnum_t *result_
         target_basename = svn_dirent_basename(target_abspath, NULL);
         dir = svn_dirent_dirname(path, pool);
 
-        if (kind != svn_node_file)
+        if (kind == svn_node_file)
+          {
+            if (depth == svn_depth_empty)
+              depth = svn_depth_files;
+          }
+        else
           {
             err = svn_wc_read_kind(&kind, ctx->wc_ctx, dir_abspath, FALSE,
                                    pool);

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_diff/diff_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_diff/diff_file.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_diff/diff_file.c Tue Aug  7 18:20:26 2012
@@ -1168,10 +1168,13 @@ svn_diff_file_options_parse(svn_diff_fil
                             apr_pool_t *pool)
 {
   apr_getopt_t *os;
-  struct opt_parsing_error_baton_t opt_parsing_error_baton = { NULL, pool };
+  struct opt_parsing_error_baton_t opt_parsing_error_baton;
   /* Make room for each option (starting at index 1) plus trailing NULL. */
   const char **argv = apr_palloc(pool, sizeof(char*) * (args->nelts + 2));
 
+  opt_parsing_error_baton.err = NULL;
+  opt_parsing_error_baton.pool = pool;
+
   argv[0] = "";
   memcpy((void *) (argv + 1), args->elts, sizeof(char*) * args->nelts);
   argv[args->nelts + 1] = NULL;

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_fs_fs/fs_fs.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_fs_fs/fs_fs.c Tue Aug  7 18:20:26 2012
@@ -3382,7 +3382,9 @@ set_cached_window(svn_txdelta_window_t *
   if (rs->window_cache)
     {
       /* store the window and the first offset _past_ it */
-      svn_fs_fs__txdelta_cached_window_t cached_window = { window, rs->off };
+      svn_fs_fs__txdelta_cached_window_t cached_window;
+      cached_window.window = window;
+      cached_window.end_offset = rs->off;
 
       /* but key it with the start offset because that is the known state
        * when we will look it up */
@@ -5254,7 +5256,9 @@ svn_fs_fs__set_entry(svn_fs_t *fs,
       /* build parameters: (name, new entry) pair */
       const char *key =
           svn_fs_fs__id_unparse(parent_noderev->id, subpool)->data;
-      replace_baton_t baton = {name, NULL};
+      replace_baton_t baton;
+      baton.name = name;
+      baton.new_entry = NULL;
 
       if (id)
         {
@@ -5988,16 +5992,23 @@ write_final_rev(const svn_fs_id_t **new_
     {
       apr_pool_t *subpool;
       apr_hash_t *entries, *str_entries;
-      apr_hash_index_t *hi;
+      apr_array_header_t *sorted_entries;
+      int i;
 
       /* This is a directory.  Write out all the children first. */
       subpool = svn_pool_create(pool);
 
       SVN_ERR(svn_fs_fs__rep_contents_dir(&entries, fs, noderev, pool));
-
-      for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
+      /* For the sake of the repository administrator sort the entries
+         so that the final file is deterministic and repeatable,
+         however the rest of the FSFS code doesn't require any
+         particular order here. */
+      sorted_entries = svn_sort__hash(entries, svn_sort_compare_items_lexically,
+                                      pool);
+      for (i = 0; i < sorted_entries->nelts; ++i)
         {
-          svn_fs_dirent_t *dirent = svn__apr_hash_index_val(hi);
+          svn_fs_dirent_t *dirent = APR_ARRAY_IDX(sorted_entries, i,
+                                                  svn_sort__item_t).value;
 
           svn_pool_clear(subpool);
           SVN_ERR(write_final_rev(&new_id, file, rev, fs, dirent->id,
@@ -6136,19 +6147,25 @@ write_final_changed_path_info(apr_off_t 
 {
   apr_hash_t *changed_paths;
   apr_off_t offset;
-  apr_hash_index_t *hi;
   apr_pool_t *iterpool = svn_pool_create(pool);
   fs_fs_data_t *ffd = fs->fsap_data;
   svn_boolean_t include_node_kinds =
       ffd->format >= SVN_FS_FS__MIN_KIND_IN_CHANGED_FORMAT;
+  apr_array_header_t *sorted_changed_paths;
+  int i;
 
   SVN_ERR(get_file_offset(&offset, file, pool));
 
   SVN_ERR(svn_fs_fs__txn_changes_fetch(&changed_paths, fs, txn_id, pool));
+  /* For the sake of the repository administrator sort the changes so
+     that the final file is deterministic and repeatable, however the
+     rest of the FSFS code doesn't require any particular order here. */
+  sorted_changed_paths = svn_sort__hash(changed_paths,
+                                        svn_sort_compare_items_lexically, pool);
 
   /* Iterate through the changed paths one at a time, and convert the
      temporary node-id into a permanent one for each change entry. */
-  for (hi = apr_hash_first(pool, changed_paths); hi; hi = apr_hash_next(hi))
+  for (i = 0; i < sorted_changed_paths->nelts; ++i)
     {
       node_revision_t *noderev;
       const svn_fs_id_t *id;
@@ -6157,8 +6174,8 @@ write_final_changed_path_info(apr_off_t 
 
       svn_pool_clear(iterpool);
 
-      change = svn__apr_hash_index_val(hi);
-      path = svn__apr_hash_index_key(hi);
+      change = APR_ARRAY_IDX(sorted_changed_paths, i, svn_sort__item_t).value;
+      path = APR_ARRAY_IDX(sorted_changed_paths, i, svn_sort__item_t).key;
 
       id = change->node_rev_id;
 

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_fs_fs/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_fs_fs/lock.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_fs_fs/lock.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_fs_fs/lock.c Tue Aug  7 18:20:26 2012
@@ -648,7 +648,11 @@ walk_locks(svn_fs_t *fs,
            svn_boolean_t have_write_lock,
            apr_pool_t *pool)
 {
-  struct walk_locks_baton wlb = { get_locks_func, get_locks_baton, fs };
+  struct walk_locks_baton wlb;
+
+  wlb.get_locks_func = get_locks_func;
+  wlb.get_locks_baton = get_locks_baton;
+  wlb.fs = fs;
   SVN_ERR(walk_digest_files(fs->path, digest_path, locks_walker, &wlb,
                             have_write_lock, pool));
   return SVN_NO_ERROR;

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_ra_serf/update.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_ra_serf/update.c Tue Aug  7 18:20:26 2012
@@ -1772,6 +1772,14 @@ start_report(svn_ra_serf__xml_parser_t *
           info->prop_val = NULL;
           info->prop_val_len = 0;
         }
+      else if (strcmp(name.name, "txdelta") == 0)
+        {
+          /* Pre 1.2, mod_dav_svn was using <txdelta> tags (in
+             addition to <fetch-file>s and such) when *not* in
+             "send-all" mode.  As a client, we're smart enough to know
+             that's wrong, so we'll just ignore these tags. */
+          ;
+        }
       else
         {
           return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_ra_serf/xml.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_ra_serf/xml.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_ra_serf/xml.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_ra_serf/xml.c Tue Aug  7 18:20:26 2012
@@ -91,37 +91,27 @@ svn_ra_serf__expand_ns(svn_ra_serf__dav_
                        const char *name)
 {
   const char *colon;
-  svn_ra_serf__dav_props_t prop_name;
 
   colon = strchr(name, ':');
   if (colon)
     {
       svn_ra_serf__ns_t *ns;
 
-      prop_name.namespace = NULL;
-
       for (ns = ns_list; ns; ns = ns->next)
         {
           if (strncmp(ns->namespace, name, colon - name) == 0)
             {
-              prop_name.namespace = ns->url;
-              break;
+              returned_prop_name->namespace = ns->url;
+              returned_prop_name->name = colon + 1;
+              return;
             }
         }
-
-      SVN_ERR_ASSERT_NO_RETURN(prop_name.namespace);
-
-      prop_name.name = colon + 1;
-    }
-  else
-    {
-      /* use default namespace for now */
-      prop_name.namespace = "";
-      prop_name.name = name;
     }
 
-  *returned_prop_name = prop_name;
-  return;
+  /* If there is no prefix, or if the prefix is not found, then the
+     name is NOT within a namespace.  */
+  returned_prop_name->namespace = "";
+  returned_prop_name->name = name;
 }
 
 void

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_repos/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_repos/replay.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_repos/replay.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_repos/replay.c Tue Aug  7 18:20:26 2012
@@ -352,6 +352,116 @@ is_within_base_path(const char *path, co
   return FALSE;
 }
 
+/* Given PATH deleted under ROOT, return in READABLE whether the path was
+   readable prior to the deletion.  Consult COPIES (a stack of 'struct
+   copy_info') and AUTHZ_READ_FUNC. */
+static svn_error_t *
+was_readable(svn_boolean_t *readable,
+             svn_fs_root_t *root,
+             const char *path,
+             apr_array_header_t *copies,
+             svn_repos_authz_func_t authz_read_func,
+             void *authz_read_baton,
+             apr_pool_t *result_pool,
+             apr_pool_t *scratch_pool)
+{
+  svn_fs_root_t *inquire_root;
+  const char *inquire_path;
+  struct copy_info *info = NULL;
+  const char *relpath;
+
+  /* Short circuit. */
+  if (! authz_read_func)
+    {
+      *readable = TRUE;
+      return SVN_NO_ERROR;
+    }
+
+  if (copies->nelts != 0)
+    info = &APR_ARRAY_IDX(copies, copies->nelts - 1, struct copy_info);
+
+  /* Are we under a copy? */
+  if (info && (relpath = svn_relpath_skip_ancestor(info->path, path)))
+    {
+      SVN_ERR(svn_fs_revision_root(&inquire_root, svn_fs_root_fs(root),
+                                   info->copyfrom_rev, scratch_pool));
+      inquire_path = svn_fspath__join(info->copyfrom_path, relpath,
+                                      scratch_pool);
+    }
+  else
+    {
+      /* Compute the revision that ROOT is based on.  (Note that ROOT is not
+         r0's root, since this function is only called for deletions.)
+         ### Need a more succinct way to express this */
+      svn_revnum_t inquire_rev = SVN_INVALID_REVNUM;
+      if (svn_fs_is_txn_root(root))
+        inquire_rev = svn_fs_txn_root_base_revision(root);
+      if (svn_fs_is_revision_root(root))
+        inquire_rev =  svn_fs_revision_root_revision(root)-1;
+      SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(inquire_rev));
+
+      SVN_ERR(svn_fs_revision_root(&inquire_root, svn_fs_root_fs(root),
+                                   inquire_rev, scratch_pool));
+      inquire_path = path;
+    }
+
+  SVN_ERR(authz_read_func(readable, inquire_root, inquire_path,
+                          authz_read_baton, result_pool));
+
+  return SVN_NO_ERROR;
+}
+
+/* Initialize COPYFROM_ROOT, COPYFROM_PATH, and COPYFROM_REV with the
+   revision root, fspath, and revnum of the copyfrom of CHANGE, which
+   corresponds to PATH under ROOT.  If the copyfrom info is valid
+   (i.e., is not (NULL, SVN_INVALID_REVNUM)), then initialize SRC_READABLE
+   too, consulting AUTHZ_READ_FUNC and AUTHZ_READ_BATON if provided. */
+static svn_error_t *
+fill_copyfrom(svn_fs_root_t **copyfrom_root,
+              const char **copyfrom_path,
+              svn_revnum_t *copyfrom_rev,
+              svn_boolean_t *src_readable,
+              svn_fs_root_t *root,
+              svn_fs_path_change2_t *change,
+              svn_repos_authz_func_t authz_read_func,
+              void *authz_read_baton,
+              const char *path,
+              apr_pool_t *result_pool,
+              apr_pool_t *scratch_pool)
+{
+  if (! change->copyfrom_known)
+    {
+      SVN_ERR(svn_fs_copied_from(&(change->copyfrom_rev),
+                                 &(change->copyfrom_path),
+                                 root, path, result_pool));
+      change->copyfrom_known = TRUE;
+    }
+  *copyfrom_rev = change->copyfrom_rev;
+  *copyfrom_path = change->copyfrom_path;
+
+  if (*copyfrom_path && SVN_IS_VALID_REVNUM(*copyfrom_rev))
+    {
+      SVN_ERR(svn_fs_revision_root(copyfrom_root,
+                                   svn_fs_root_fs(root),
+                                   *copyfrom_rev, result_pool));
+
+      if (authz_read_func)
+        {
+          SVN_ERR(authz_read_func(src_readable, *copyfrom_root,
+                                  *copyfrom_path,
+                                  authz_read_baton, result_pool));
+        }
+      else
+        *src_readable = TRUE;
+    }
+  else
+    {
+      *copyfrom_root = NULL;
+      /* SRC_READABLE left uninitialized */
+    }
+  return SVN_NO_ERROR;
+}
+
 static svn_error_t *
 path_driver_cb_func(void **dir_baton,
                     void *parent_baton,
@@ -368,7 +478,6 @@ path_driver_cb_func(void **dir_baton,
   void *file_baton = NULL;
   svn_revnum_t copyfrom_rev;
   const char *copyfrom_path;
-  svn_boolean_t src_readable = TRUE;
   svn_fs_root_t *source_root = cb->compare_root;
   const char *source_fspath = NULL;
   const char *base_path = cb->base_path;
@@ -419,8 +528,18 @@ path_driver_cb_func(void **dir_baton,
 
   /* Handle any deletions. */
   if (do_delete)
-    SVN_ERR(editor->delete_entry(edit_path, SVN_INVALID_REVNUM,
-                                 parent_baton, pool));
+    {
+      svn_boolean_t readable;
+
+      /* Issue #4121: delete under under a copy, of a path that was unreadable
+         at its pre-copy location. */
+      SVN_ERR(was_readable(&readable, root, edit_path, cb->copies,
+                            cb->authz_read_func, cb->authz_read_baton,
+                            pool, pool));
+      if (readable)
+        SVN_ERR(editor->delete_entry(edit_path, SVN_INVALID_REVNUM,
+                                     parent_baton, pool));
+    }
 
   /* Fetch the node kind if it makes sense to do so. */
   if (! do_delete || do_add)
@@ -437,31 +556,14 @@ path_driver_cb_func(void **dir_baton,
   /* Handle any adds/opens. */
   if (do_add)
     {
-      svn_fs_root_t *copyfrom_root = NULL;
-      /* Was this node copied? */
-      if (! change->copyfrom_known)
-        {
-          SVN_ERR(svn_fs_copied_from(&(change->copyfrom_rev),
-                                     &(change->copyfrom_path),
-                                     root, edit_path, pool));
-          change->copyfrom_known = TRUE;
-        }
-      copyfrom_rev = change->copyfrom_rev;
-      copyfrom_path = change->copyfrom_path;
+      svn_boolean_t src_readable;
+      svn_fs_root_t *copyfrom_root;
 
-      if (copyfrom_path && SVN_IS_VALID_REVNUM(copyfrom_rev))
-        {
-          SVN_ERR(svn_fs_revision_root(&copyfrom_root,
-                                       svn_fs_root_fs(root),
-                                       copyfrom_rev, pool));
-
-          if (cb->authz_read_func)
-            {
-              SVN_ERR(cb->authz_read_func(&src_readable, copyfrom_root,
-                                          copyfrom_path,
-                                          cb->authz_read_baton, pool));
-            }
-        }
+      /* Was this node copied? */
+      SVN_ERR(fill_copyfrom(&copyfrom_root, &copyfrom_path, &copyfrom_rev,
+                            &src_readable, root, change,
+                            cb->authz_read_func, cb->authz_read_baton,
+                            edit_path, pool, pool));
 
       /* If we have a copyfrom path, and we can't read it or we're just
          ignoring it, or the copyfrom rev is prior to the low water mark
@@ -591,10 +693,18 @@ path_driver_cb_func(void **dir_baton,
         }
     }
 
-  /* Handle property modifications. */
   if (! do_delete || do_add)
     {
-      if (change->prop_mod)
+      /* Is this a copy that was downgraded to a raw add?  (If so,
+         we'll need to transmit properties and file contents and such
+         for it regardless of what the CHANGE structure's text_mod
+         and prop_mod flags say.)  */
+      svn_boolean_t downgraded_copy = (change->copyfrom_known
+                                       && change->copyfrom_path
+                                       && (! copyfrom_path));
+
+      /* Handle property modifications. */
+      if (change->prop_mod || downgraded_copy)
         {
           if (cb->compare_root)
             {
@@ -638,14 +748,9 @@ path_driver_cb_func(void **dir_baton,
             }
         }
 
-      /* Handle textual modifications.
-
-         Note that this needs to happen in the "copy from a file we
-         aren't allowed to see" case since otherwise the caller will
-         have no way to actually get the new file's contents, which
-         they are apparently allowed to see. */
+      /* Handle textual modifications. */
       if (change->node_kind == svn_node_file
-          && (change->text_mod || (change->copyfrom_path && ! copyfrom_path)))
+          && (change->text_mod || downgraded_copy))
         {
           svn_txdelta_window_handler_t delta_handler;
           void *delta_handler_baton;

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/auth.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/auth.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/auth.c Tue Aug  7 18:20:26 2012
@@ -418,11 +418,12 @@ svn_auth_get_platform_specific_provider
             {
               svn_version_func_t version_function
                 = version_function_symbol;
-              const svn_version_checklist_t check_list[] =
-                {
-                  { library_label, version_function },
-                  { NULL, NULL }
-                };
+              svn_version_checklist_t check_list[2];
+
+              check_list[0].label = library_label;
+              check_list[0].version_query = version_function;
+              check_list[1].label = NULL;
+              check_list[1].version_query = NULL;
               SVN_ERR(svn_ver_check_list(svn_subr_version(), check_list));
             }
           if (apr_dso_sym(&provider_function_symbol,

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/dirent_uri.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/dirent_uri.c Tue Aug  7 18:20:26 2012
@@ -1604,10 +1604,32 @@ svn_dirent_get_absolute(const char **pab
                                APR_FILEPATH_NOTRELATIVE,
                                pool);
   if (apr_err)
-    return svn_error_createf(SVN_ERR_BAD_FILENAME,
-                             svn_error_create(apr_err, NULL, NULL),
-                             _("Couldn't determine absolute path of '%s'"),
-                             svn_dirent_local_style(relative, pool));
+    {
+      /* In some cases when the passed path or its ancestor(s) do not exist
+         or no longer exist apr returns an error.
+
+         In many of these cases we would like to return a path anyway, when the
+         passed path was already a safe absolute path. So check for that now to
+         avoid an error.
+
+         svn_dirent_is_absolute() doesn't perform the necessary checks to see
+         if the path doesn't need post processing to be in the canonical absolute
+         format.
+         */
+
+      if (svn_dirent_is_absolute(relative)
+          && svn_dirent_is_canonical(relative, pool)
+          && !svn_path_is_backpath_present(relative))
+        {
+          *pabsolute = apr_pstrdup(pool, relative);
+          return SVN_NO_ERROR;
+        }
+
+      return svn_error_createf(SVN_ERR_BAD_FILENAME,
+                               svn_error_create(apr_err, NULL, NULL),
+                               _("Couldn't determine absolute path of '%s'"),
+                               svn_dirent_local_style(relative, pool));
+    }
 
   SVN_ERR(svn_path_cstring_to_utf8(pabsolute, buffer, pool));
   *pabsolute = svn_dirent_canonicalize(*pabsolute, pool);

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/opt.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/opt.c Tue Aug  7 18:20:26 2012
@@ -1015,6 +1015,20 @@ svn_opt__arg_canonicalize_url(const char
   /* Auto-escape some ASCII characters. */
   target = svn_path_uri_autoescape(target, pool);
 
+#if '/' != SVN_PATH_LOCAL_SEPARATOR
+  /* Allow using file:///C:\users\me/repos on Windows, like we did in 1.6 */
+  if (strchr(target, SVN_PATH_LOCAL_SEPARATOR))
+    {
+      char *p = apr_pstrdup(pool, target);
+      target = p;
+
+      /* Convert all local-style separators to the canonical ones. */
+      for (; *p != '\0'; ++p)
+        if (*p == SVN_PATH_LOCAL_SEPARATOR)
+          *p = '/';
+    }
+#endif
+
   /* Verify that no backpaths are present in the URL. */
   if (svn_path_is_backpath_present(target))
     return svn_error_createf(SVN_ERR_BAD_URL, 0,

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/sqlite.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_subr/sqlite.c Tue Aug  7 18:20:26 2012
@@ -1205,13 +1205,15 @@ wrapped_func(sqlite3_context *context,
              sqlite3_value *values[])
 {
   struct function_wrapper_baton_t *fwb = sqlite3_user_data(context);
-  svn_sqlite__context_t sctx = { context };
+  svn_sqlite__context_t sctx;
   svn_sqlite__value_t **local_vals =
                             apr_palloc(fwb->scratch_pool,
                                        sizeof(svn_sqlite__value_t *) * argc);
   svn_error_t *err;
   int i;
 
+  sctx.context = context;
+
   for (i = 0; i < argc; i++)
     {
       local_vals[i] = apr_palloc(fwb->scratch_pool, sizeof(*local_vals[i]));

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/adm_ops.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/adm_ops.c Tue Aug  7 18:20:26 2012
@@ -1935,7 +1935,7 @@ new_revert_partial(svn_wc__db_t *db,
         {
           svn_wc__db_kind_t kind;
 
-          SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, TRUE,
+          SVN_ERR(svn_wc__db_read_kind(&kind, db, child_abspath, TRUE,
                                        iterpool));
           if (kind != svn_wc__db_kind_file)
             continue;
@@ -2447,8 +2447,11 @@ svn_wc_get_changelists(svn_wc_context_t 
                        void *cancel_baton,
                        apr_pool_t *scratch_pool)
 {
-  struct get_cl_fn_baton gnb = { wc_ctx->db, NULL,
-                                 callback_func, callback_baton };
+  struct get_cl_fn_baton gnb;
+  gnb.db = wc_ctx->db;
+  gnb.clhash = NULL;
+  gnb.callback_func = callback_func;
+  gnb.callback_baton = callback_baton;
 
   if (changelist_filter)
     SVN_ERR(svn_hash_from_cstring_keys(&gnb.clhash, changelist_filter,

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/lock.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/lock.c Tue Aug  7 18:20:26 2012
@@ -1524,6 +1524,21 @@ svn_wc__acquire_write_lock(const char **
                              svn_dirent_local_style(local_abspath,
                                                     scratch_pool));
 
+  if (lock_anchor && kind == svn_wc__db_kind_dir)
+    {
+      svn_boolean_t is_wcroot;
+
+      SVN_ERR_ASSERT(lock_root_abspath != NULL);
+
+      /* Perform a cheap check to avoid looking for a parent working copy,
+         which might be very expensive in some specific scenarios */
+      SVN_ERR(svn_wc__db_is_wcroot(&is_wcroot, db, local_abspath,
+                                   scratch_pool));
+
+      if (is_wcroot)
+        lock_anchor = FALSE;
+    }
+
   if (lock_anchor)
     {
       const char *parent_abspath;

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/merge.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/merge.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/merge.c Tue Aug  7 18:20:26 2012
@@ -940,6 +940,8 @@ merge_file_trivial(svn_skel_t **work_ite
                    const char *target_abspath,
                    svn_boolean_t dry_run,
                    svn_wc__db_t *db,
+                   svn_cancel_func_t cancel_func,
+                   void *cancel_baton,
                    apr_pool_t *result_pool,
                    apr_pool_t *scratch_pool)
 {
@@ -977,6 +979,41 @@ merge_file_trivial(svn_skel_t **work_ite
           *merge_outcome = svn_wc_merge_merged;
           if (!dry_run)
             {
+              const char *wcroot_abspath;
+              svn_boolean_t delete_src = FALSE;
+
+              /* The right_abspath might be outside our working copy. In that
+                 case we should copy the file to a safe location before
+                 installing to avoid breaking the workqueue */
+
+              SVN_ERR(svn_wc__db_get_wcroot(&wcroot_abspath,
+                                            db, target_abspath,
+                                            scratch_pool, scratch_pool));
+
+              if (!svn_dirent_is_child(wcroot_abspath, right_abspath, NULL))
+                {
+                  svn_stream_t *tmp_src;
+                  svn_stream_t *tmp_dst;
+
+                  SVN_ERR(svn_stream_open_readonly(&tmp_src, right_abspath,
+                                                   scratch_pool,
+                                                   scratch_pool));
+
+                  SVN_ERR(svn_wc__open_writable_base(&tmp_dst, &right_abspath,
+                                                     NULL, NULL,
+                                                     db, target_abspath,
+                                                     scratch_pool,
+                                                     scratch_pool));
+
+                  SVN_ERR(svn_stream_copy3(tmp_src, tmp_dst,
+                                           cancel_func, cancel_baton,
+                                           scratch_pool));
+
+                  /* no need to strdup right_abspath, as the wq_build_()
+                     call already does that for us */
+                  delete_src = TRUE;
+                }
+
               SVN_ERR(svn_wc__wq_build_file_install(
                         &work_item, db, target_abspath, right_abspath,
                         FALSE /* use_commit_times */,
@@ -984,6 +1021,15 @@ merge_file_trivial(svn_skel_t **work_ite
                         result_pool, scratch_pool));
               *work_items = svn_wc__wq_merge(*work_items, work_item,
                                              result_pool);
+
+              if (delete_src)
+                {
+                  SVN_ERR(svn_wc__wq_build_file_remove(
+                                    &work_item, db, right_abspath,
+                                    result_pool, scratch_pool));
+                  *work_items = svn_wc__wq_merge(*work_items, work_item,
+                                                 result_pool);
+                }
             }
         }
 
@@ -1418,6 +1464,7 @@ svn_wc__internal_merge(svn_skel_t **work
   SVN_ERR(merge_file_trivial(work_items, merge_outcome,
                              left_abspath, right_abspath,
                              target_abspath, dry_run, db,
+                             cancel_func, cancel_baton,
                              result_pool, scratch_pool));
   if (*merge_outcome == svn_wc_merge_no_merge)
     {

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/node.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/node.c Tue Aug  7 18:20:26 2012
@@ -1407,6 +1407,15 @@ svn_wc__internal_get_origin(svn_boolean_
             return SVN_NO_ERROR; /* Local addition */
           }
 
+        /* We don't know how the following error condition can be fulfilled
+         * but we have seen that happening in the wild.  Better to create
+         * an error than a SEGFAULT. */
+        if (status == svn_wc__db_status_incomplete && !original_repos_relpath)
+          return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
+                               _("Incomplete copy information on path '%s'."),
+                                   svn_dirent_local_style(local_abspath,
+                                                          scratch_pool));
+
         *repos_relpath = svn_relpath_join(
                                 original_repos_relpath,
                                 svn_dirent_skip_ancestor(op_root_abspath,

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/props.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/props.c Tue Aug  7 18:20:26 2012
@@ -1846,8 +1846,10 @@ svn_wc__prop_list_recursive(svn_wc_conte
 {
   svn_wc__proplist_receiver_t receiver = receiver_func;
   void *baton = receiver_baton;
-  struct propname_filter_baton_t pfb = { receiver_func, receiver_baton,
-                                         propname };
+  struct propname_filter_baton_t pfb;
+  pfb.receiver_func = receiver_func;
+  pfb.receiver_baton = receiver_baton;
+  pfb.propname = propname;
 
   SVN_ERR_ASSERT(receiver_func);
 
@@ -2311,7 +2313,7 @@ do_propset(svn_wc__db_t *db,
     }
   else if (kind == svn_node_file && strcmp(name, SVN_PROP_EOL_STYLE) == 0)
     {
-      svn_string_t *old_value = apr_hash_get(prophash, SVN_PROP_KEYWORDS,
+      svn_string_t *old_value = apr_hash_get(prophash, SVN_PROP_EOL_STYLE,
                                              APR_HASH_KEY_STRING);
 
       if (((value == NULL) != (old_value == NULL))
@@ -2473,8 +2475,13 @@ svn_wc_prop_set4(svn_wc_context_t *wc_ct
     }
   else
     {
-      struct propset_walk_baton wb = { name, value, wc_ctx->db, skip_checks,
-                                       notify_func, notify_baton };
+      struct propset_walk_baton wb;
+      wb.propname = name;
+      wb.propval = value;
+      wb.db = wc_ctx->db;
+      wb.force = skip_checks;
+      wb.notify_func = notify_func;
+      wb.notify_baton = notify_baton;
 
       SVN_ERR(svn_wc__internal_walk_children(wc_ctx->db, local_abspath,
                                              FALSE, changelist_filter,

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/status.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/status.c Tue Aug  7 18:20:26 2012
@@ -41,6 +41,7 @@
 #include "svn_config.h"
 #include "svn_time.h"
 #include "svn_hash.h"
+#include "svn_sorts.h"
 
 #include "svn_private_config.h"
 
@@ -1019,14 +1020,15 @@ get_dir_status(const struct walk_status_
                void *cancel_baton,
                apr_pool_t *scratch_pool)
 {
-  apr_hash_index_t *hi;
   const char *dir_repos_root_url;
   const char *dir_repos_relpath;
   const char *dir_repos_uuid;
   apr_hash_t *dirents, *nodes, *conflicts, *all_children;
   apr_array_header_t *patterns = NULL;
+  apr_array_header_t *sorted_children;
   apr_pool_t *iterpool, *subpool = svn_pool_create(scratch_pool);
   svn_error_t *err;
+  int i;
 
   if (cancel_func)
     SVN_ERR(cancel_func(cancel_baton));
@@ -1125,20 +1127,25 @@ get_dir_status(const struct walk_status_
     }
 
   /* Walk all the children of this directory. */
-  for (hi = apr_hash_first(subpool, all_children); hi; hi = apr_hash_next(hi))
+  sorted_children = svn_sort__hash(all_children,
+                                   svn_sort_compare_items_lexically,
+                                   subpool);
+  for (i = 0; i < sorted_children->nelts; i++)
     {
       const void *key;
       apr_ssize_t klen;
       const char *node_abspath;
       svn_io_dirent2_t *dirent_p;
       const struct svn_wc__db_info_t *info;
+      svn_sort__item_t item;
 
       svn_pool_clear(iterpool);
 
-      apr_hash_this(hi, &key, &klen, NULL);
+      item = APR_ARRAY_IDX(sorted_children, i, svn_sort__item_t);
+      key = item.key;
+      klen = item.klen;
 
       node_abspath = svn_dirent_join(local_abspath, key, iterpool);
-
       dirent_p = apr_hash_get(dirents, key, klen);
 
       info = apr_hash_get(nodes, key, klen);

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/tree_conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/tree_conflicts.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/tree_conflicts.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/tree_conflicts.c Tue Aug  7 18:20:26 2012
@@ -155,15 +155,18 @@ read_node_version_info(const svn_wc_conf
                             _("Invalid version info in tree conflict "
                               "description"));
 
-  repos_root = apr_pstrmemdup(result_pool,
-                                           skel->children->next->data,
-                                           skel->children->next->len);
+  repos_root = apr_pstrmemdup(scratch_pool,
+                              skel->children->next->data,
+                              skel->children->next->len);
   if (*repos_root == '\0')
     {
       *version_info = NULL;
       return SVN_NO_ERROR;
     }
 
+  /* Apply the Subversion 1.7+ url canonicalization rules to a pre 1.7 url */
+  repos_root = svn_uri_canonicalize(repos_root, result_pool);
+
   peg_rev = SVN_STR_TO_REV(apr_pstrmemdup(scratch_pool,
                                           skel->children->next->next->data,
                                           skel->children->next->next->len));

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/upgrade.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/upgrade.c Tue Aug  7 18:20:26 2012
@@ -1545,7 +1545,8 @@ svn_wc__upgrade_sdb(int *result_format,
                     int start_format,
                     apr_pool_t *scratch_pool)
 {
-  struct bump_baton bb = { wcroot_abspath };
+  struct bump_baton bb;
+  bb.wcroot_abspath = wcroot_abspath;
 
   if (start_format < SVN_WC__WC_NG_VERSION /* 12 */)
     return svn_error_createf(SVN_ERR_WC_UPGRADE_REQUIRED, NULL,

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc-queries.sql?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc-queries.sql Tue Aug  7 18:20:26 2012
@@ -1025,7 +1025,7 @@ WHERE tree_conflict_data IS NOT NULL
 UPDATE actual_node SET tree_conflict_data = NULL
 
 -- STMT_SELECT_ALL_FILES
-SELECT DISTINCT local_relpath FROM nodes
+SELECT local_relpath FROM nodes_current
 WHERE wc_id = ?1 AND parent_relpath = ?2 AND kind = 'file'
 
 -- STMT_UPDATE_NODE_PROPS

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db.c Tue Aug  7 18:20:26 2012
@@ -4994,8 +4994,10 @@ svn_wc__db_op_set_changelist(svn_wc__db_
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
-  struct set_changelist_baton_t scb = { new_changelist, changelist_filter,
-                                        depth };
+  struct set_changelist_baton_t scb;
+  scb.new_changelist = new_changelist;
+  scb.changelist_filter = changelist_filter;
+  scb.depth = depth;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
@@ -5514,9 +5516,15 @@ svn_wc__db_revert_list_read(svn_boolean_
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
-  struct revert_list_read_baton b = {reverted, conflict_old, conflict_new,
-                                     conflict_working, prop_reject,
-                                     copied_here, kind, result_pool};
+  struct revert_list_read_baton b;
+  b.reverted = reverted;
+  b.conflict_old = conflict_old;
+  b.conflict_new = conflict_new;
+  b.conflict_working = conflict_working;
+  b.prop_reject = prop_reject;
+  b.copied_here = copied_here;
+  b.kind = kind;
+  b.result_pool = result_pool;
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                               db, local_abspath, scratch_pool, scratch_pool));
@@ -5588,7 +5596,9 @@ svn_wc__db_revert_list_read_copied_child
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
-  struct revert_list_read_copied_children_baton b = {children, result_pool};
+  struct revert_list_read_copied_children_baton b;
+  b.children = children;
+  b.result_pool = result_pool;
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                               db, local_abspath, scratch_pool, scratch_pool));
@@ -7410,8 +7420,15 @@ read_url_txn(void *baton,
           else
             {
               /* The parent of the WORKING delete, must be an addition */
-              const char *work_relpath = svn_relpath_dirname(work_del_relpath,
-                                                             scratch_pool);
+              const char *work_relpath = NULL;
+
+              /* work_del_relpath should not be NULL. However, we have
+               * observed instances where that assumption was not met.
+               * Bail out in that case instead of crashing with a segfault.
+               */
+              SVN_ERR_ASSERT(work_del_relpath != NULL);
+              work_relpath = svn_relpath_dirname(work_del_relpath,
+                                                 scratch_pool);
 
               SVN_ERR(scan_addition(NULL, NULL, &repos_relpath, &repos_id,
                                     NULL, NULL, NULL,
@@ -7473,7 +7490,9 @@ read_url(const char **url,
          apr_pool_t *result_pool,
          apr_pool_t *scratch_pool)
 {
-  struct read_url_baton_t rub = { url, result_pool };
+  struct read_url_baton_t rub;
+  rub.url = url;
+  rub.result_pool = result_pool;
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, read_url_txn, &rub,
                               scratch_pool));
 
@@ -12187,9 +12206,17 @@ svn_wc__db_revision_status(svn_revnum_t 
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
-  struct revision_status_baton_t rsb = { min_revision, max_revision,
-        is_sparse_checkout, is_modified, is_switched, trail_url, committed,
-        cancel_func, cancel_baton, db };
+  struct revision_status_baton_t rsb;
+  rsb.min_revision = min_revision;
+  rsb.max_revision = max_revision;
+  rsb.is_sparse_checkout = is_sparse_checkout;
+  rsb.is_modified = is_modified;
+  rsb.is_switched = is_switched;
+  rsb.trail_url = trail_url;
+  rsb.committed = committed;
+  rsb.cancel_func = cancel_func;
+  rsb.cancel_baton = cancel_baton;
+  rsb.db = db;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db_util.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db_util.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db_util.c Tue Aug  7 18:20:26 2012
@@ -196,7 +196,11 @@ svn_wc__db_with_txn(svn_wc__db_wcroot_t 
                     void *cb_baton,
                     apr_pool_t *scratch_pool)
 {
-  struct txn_baton_t tb = { wcroot, local_relpath, cb_func, cb_baton };
+  struct txn_baton_t tb;
+  tb.wcroot = wcroot;
+  tb.local_relpath = local_relpath;
+  tb.cb_func = cb_func;
+  tb.cb_baton = cb_baton;
 
   return svn_error_trace(
     svn_sqlite__with_lock(wcroot->sdb, run_txn, &tb, scratch_pool));

Modified: subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db_wcroot.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db_wcroot.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/libsvn_wc/wc_db_wcroot.c Tue Aug  7 18:20:26 2012
@@ -374,6 +374,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv
   svn_boolean_t always_check = FALSE;
   svn_boolean_t is_symlink;
   int wc_format = 0;
+  const char *adm_relpath;
 
   /* ### we need more logic for finding the database (if it is located
      ### outside of the wcroot) and then managing all of that within DB.
@@ -461,48 +462,60 @@ svn_wc__db_wcroot_parse_local_abspath(sv
      database in the right place. If we find it... great! If not, then
      peel off some components, and try again. */
 
+  adm_relpath = svn_wc_get_adm_dir(scratch_pool);
   while (TRUE)
     {
       svn_error_t *err;
+      svn_node_kind_t adm_subdir_kind;
 
-      /* We always open the database in read/write mode.  If the database
-         isn't writable in the filesystem, SQLite will internally open
-         it as read-only, and we'll get an error if we try to do a write
-         operation.
-
-         We could decide what to do on a per-operation basis, but since
-         we're caching database handles, it make sense to be as permissive
-         as the filesystem allows. */
-      err = svn_wc__db_util_open_db(&sdb, local_abspath, SDB_FILE,
-                                    svn_sqlite__mode_readwrite, NULL,
-                                    db->state_pool, scratch_pool);
-      if (err == NULL)
+      const char *adm_subdir = svn_dirent_join(local_abspath, adm_relpath,
+                                               scratch_pool);
+
+      SVN_ERR(svn_io_check_path(adm_subdir, &adm_subdir_kind, scratch_pool));
+
+      if (adm_subdir_kind == svn_node_dir)
         {
+          /* We always open the database in read/write mode.  If the database
+             isn't writable in the filesystem, SQLite will internally open
+             it as read-only, and we'll get an error if we try to do a write
+             operation.
+
+             We could decide what to do on a per-operation basis, but since
+             we're caching database handles, it make sense to be as permissive
+             as the filesystem allows. */
+          err = svn_wc__db_util_open_db(&sdb, local_abspath, SDB_FILE,
+                                        svn_sqlite__mode_readwrite, NULL,
+                                        db->state_pool, scratch_pool);
+          if (err == NULL)
+            {
 #ifdef SVN_DEBUG
-          /* Install self-verification trigger statements. */
-          SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_VERIFICATION_TRIGGERS));
+              /* Install self-verification trigger statements. */
+              SVN_ERR(svn_sqlite__exec_statements(sdb,
+                                                  STMT_VERIFICATION_TRIGGERS));
 #endif
-          break;
-        }
-      if (err->apr_err != SVN_ERR_SQLITE_ERROR
-          && !APR_STATUS_IS_ENOENT(err->apr_err))
-        return svn_error_trace(err);
-      svn_error_clear(err);
-
-      /* If we have not moved upwards, then check for a wc-1 working copy.
-         Since wc-1 has a .svn in every directory, and we didn't find one
-         in the original directory, then we aren't looking at a wc-1.
-
-         If the original path is not present, then we have to check on every
-         iteration. The content may be the immediate parent, or possibly
-         five ancetors higher. We don't test for directory presence (just
-         for the presence of subdirs/files), so we don't know when we can
-         stop checking ... so just check always.  */
-      if (!moved_upwards || always_check)
-        {
-          SVN_ERR(get_old_version(&wc_format, local_abspath, scratch_pool));
-          if (wc_format != 0)
-            break;
+              break;
+            }
+          if (err->apr_err != SVN_ERR_SQLITE_ERROR
+              && !APR_STATUS_IS_ENOENT(err->apr_err))
+            return svn_error_trace(err);
+          svn_error_clear(err);
+
+          /* If we have not moved upwards, then check for a wc-1 working copy.
+             Since wc-1 has a .svn in every directory, and we didn't find one
+             in the original directory, then we aren't looking at a wc-1.
+
+             If the original path is not present, then we have to check on every
+             iteration. The content may be the immediate parent, or possibly
+             five ancetors higher. We don't test for directory presence (just
+             for the presence of subdirs/files), so we don't know when we can
+             stop checking ... so just check always.  */
+          if (!moved_upwards || always_check)
+            {
+              SVN_ERR(get_old_version(&wc_format, local_abspath,
+                                      scratch_pool));
+              if (wc_format != 0)
+                break;
+            }
         }
 
       /* We couldn't open the SDB within the specified directory, so

Modified: subversion/branches/1.7.x-commit-performance/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/svn/main.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/svn/main.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/svn/main.c Tue Aug  7 18:20:26 2012
@@ -1329,20 +1329,20 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "\n"
      "  Example output:\n"
      "    svn status wc\n"
-     "     M     wc/bar.c\n"
-     "    A  +   wc/qax.c\n"
+     "     M      wc/bar.c\n"
+     "    A  +    wc/qax.c\n"
      "\n"
      "    svn status -u wc\n"
-     "     M           965    wc/bar.c\n"
-     "           *     965    wc/foo.c\n"
-     "    A  +           -    wc/qax.c\n"
+     "     M             965   wc/bar.c\n"
+     "            *      965   wc/foo.c\n"
+     "    A  +             -   wc/qax.c\n"
      "    Status against revision:   981\n"
      "\n"
      "    svn status --show-updates --verbose wc\n"
-     "     M           965       938 kfogel       wc/bar.c\n"
-     "           *     965       922 sussman      wc/foo.c\n"
-     "    A  +           -       687 joe          wc/qax.c\n"
-     "                 965       687 joe          wc/zig.c\n"
+     "     M             965      938 kfogel       wc/bar.c\n"
+     "            *      965      922 sussman      wc/foo.c\n"
+     "    A  +             -      687 joe          wc/qax.c\n"
+     "                   965      687 joe          wc/zig.c\n"
      "    Status against revision:   981\n"
      "\n"
      "    svn status\n"

Modified: subversion/branches/1.7.x-commit-performance/subversion/svn/propget-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/svn/propget-cmd.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/svn/propget-cmd.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/svn/propget-cmd.c Tue Aug  7 18:20:26 2012
@@ -34,6 +34,7 @@
 #include "svn_error_codes.h"
 #include "svn_error.h"
 #include "svn_utf.h"
+#include "svn_sorts.h"
 #include "svn_subst.h"
 #include "svn_dirent_uri.h"
 #include "svn_path.h"
@@ -71,13 +72,16 @@ print_properties_xml(const char *pname,
                      apr_hash_t *props,
                      apr_pool_t *pool)
 {
-  apr_hash_index_t *hi;
+  apr_array_header_t *sorted_props;
+  int i;
   apr_pool_t *iterpool = svn_pool_create(pool);
 
-  for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
+  sorted_props = svn_sort__hash(props, svn_sort_compare_items_as_paths, pool);
+  for (i = 0; i < sorted_props->nelts; i++)
     {
-      const char *filename = svn__apr_hash_index_key(hi);
-      svn_string_t *propval = svn__apr_hash_index_val(hi);
+      svn_sort__item_t item = APR_ARRAY_IDX(sorted_props, i, svn_sort__item_t);
+      const char *filename = item.key;
+      svn_string_t *propval = item.value;
       svn_stringbuf_t *sb = NULL;
 
       svn_pool_clear(iterpool);
@@ -115,16 +119,19 @@ print_properties(svn_stream_t *out,
                  svn_boolean_t like_proplist,
                  apr_pool_t *pool)
 {
-  apr_hash_index_t *hi;
+  apr_array_header_t *sorted_props;
+  int i;
   apr_pool_t *iterpool = svn_pool_create(pool);
   const char *path_prefix;
 
   SVN_ERR(svn_dirent_get_absolute(&path_prefix, "", pool));
 
-  for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
+  sorted_props = svn_sort__hash(props, svn_sort_compare_items_as_paths, pool);
+  for (i = 0; i < sorted_props->nelts; i++)
     {
-      const char *filename = svn__apr_hash_index_key(hi);
-      svn_string_t *propval = svn__apr_hash_index_val(hi);
+      svn_sort__item_t item = APR_ARRAY_IDX(sorted_props, i, svn_sort__item_t);
+      const char *filename = item.key;
+      svn_string_t *propval = item.value;
 
       svn_pool_clear(iterpool);
 

Modified: subversion/branches/1.7.x-commit-performance/subversion/svn/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/svn/props.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/svn/props.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/svn/props.c Tue Aug  7 18:20:26 2012
@@ -31,6 +31,7 @@
 #include "svn_cmdline.h"
 #include "svn_string.h"
 #include "svn_error.h"
+#include "svn_sorts.h"
 #include "svn_subst.h"
 #include "svn_props.h"
 #include "svn_string.h"
@@ -87,12 +88,16 @@ svn_cl__print_prop_hash(svn_stream_t *ou
                         svn_boolean_t names_only,
                         apr_pool_t *pool)
 {
-  apr_hash_index_t *hi;
+  apr_array_header_t *sorted_props;
+  int i;
 
-  for (hi = apr_hash_first(pool, prop_hash); hi; hi = apr_hash_next(hi))
+  sorted_props = svn_sort__hash(prop_hash, svn_sort_compare_items_lexically,
+                                pool);
+  for (i = 0; i < sorted_props->nelts; i++)
     {
-      const char *pname = svn__apr_hash_index_key(hi);
-      svn_string_t *propval = svn__apr_hash_index_val(hi);
+      svn_sort__item_t item = APR_ARRAY_IDX(sorted_props, i, svn_sort__item_t);
+      const char *pname = item.key;
+      svn_string_t *propval = item.value;
       const char *pname_stdout;
       apr_size_t len;
 
@@ -153,15 +158,19 @@ svn_cl__print_xml_prop_hash(svn_stringbu
                             svn_boolean_t names_only,
                             apr_pool_t *pool)
 {
-  apr_hash_index_t *hi;
+  apr_array_header_t *sorted_props;
+  int i;
 
   if (*outstr == NULL)
     *outstr = svn_stringbuf_create("", pool);
 
-  for (hi = apr_hash_first(pool, prop_hash); hi; hi = apr_hash_next(hi))
+  sorted_props = svn_sort__hash(prop_hash, svn_sort_compare_items_lexically,
+                                pool);
+  for (i = 0; i < sorted_props->nelts; i++)
     {
-      const char *pname = svn__apr_hash_index_key(hi);
-      svn_string_t *propval = svn__apr_hash_index_val(hi);
+      svn_sort__item_t item = APR_ARRAY_IDX(sorted_props, i, svn_sort__item_t);
+      const char *pname = item.key;
+      svn_string_t *propval = item.value;
 
       if (names_only)
         {

Modified: subversion/branches/1.7.x-commit-performance/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/svnlook/main.c?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/svnlook/main.c (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/svnlook/main.c Tue Aug  7 18:20:26 2012
@@ -1284,6 +1284,30 @@ print_tree(svn_fs_root_t *root,
 }
 
 
+/* Set *BASE_REV to the revision on which the target root specified in
+   C is based, or to SVN_INVALID_REVNUM when C represents "revision
+   0" (because that revision isn't based on another revision). */
+static svn_error_t *
+get_base_rev(svn_revnum_t *base_rev, svnlook_ctxt_t *c, apr_pool_t *pool)
+{
+  if (c->is_revision)
+    {
+      *base_rev = c->rev_id - 1;
+    }
+  else
+    {
+      *base_rev = svn_fs_txn_base_revision(c->txn);
+
+      if (! SVN_IS_VALID_REVNUM(*base_rev))
+        return svn_error_createf
+          (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
+           _("Transaction '%s' is not based on a revision; how odd"),
+           c->txn_name);
+    }
+  return SVN_NO_ERROR;
+}
+
+
 
 /*** Subcommand handlers. ***/
 
@@ -1390,16 +1414,9 @@ do_dirs_changed(svnlook_ctxt_t *c, apr_p
   svn_repos_node_t *tree;
 
   SVN_ERR(get_root(&root, c, pool));
-  if (c->is_revision)
-    base_rev_id = c->rev_id - 1;
-  else
-    base_rev_id = svn_fs_txn_base_revision(c->txn);
-
-  if (! SVN_IS_VALID_REVNUM(base_rev_id))
-    return svn_error_createf
-      (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
-       _("Transaction '%s' is not based on a revision; how odd"),
-       c->txn_name);
+  SVN_ERR(get_base_rev(&base_rev_id, c, pool));
+  if (base_rev_id == SVN_INVALID_REVNUM)
+    return SVN_NO_ERROR;
 
   SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id,
                               TRUE, pool));
@@ -1496,16 +1513,9 @@ do_changed(svnlook_ctxt_t *c, apr_pool_t
   svn_repos_node_t *tree;
 
   SVN_ERR(get_root(&root, c, pool));
-  if (c->is_revision)
-    base_rev_id = c->rev_id - 1;
-  else
-    base_rev_id = svn_fs_txn_base_revision(c->txn);
-
-  if (! SVN_IS_VALID_REVNUM(base_rev_id))
-    return svn_error_createf
-      (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
-       _("Transaction '%s' is not based on a revision; how odd"),
-       c->txn_name);
+  SVN_ERR(get_base_rev(&base_rev_id, c, pool));
+  if (base_rev_id == SVN_INVALID_REVNUM)
+    return SVN_NO_ERROR;
 
   SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id,
                               TRUE, pool));
@@ -1525,16 +1535,9 @@ do_diff(svnlook_ctxt_t *c, apr_pool_t *p
   svn_repos_node_t *tree;
 
   SVN_ERR(get_root(&root, c, pool));
-  if (c->is_revision)
-    base_rev_id = c->rev_id - 1;
-  else
-    base_rev_id = svn_fs_txn_base_revision(c->txn);
-
-  if (! SVN_IS_VALID_REVNUM(base_rev_id))
-    return svn_error_createf
-      (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
-       _("Transaction '%s' is not based on a revision; how odd"),
-       c->txn_name);
+  SVN_ERR(get_base_rev(&base_rev_id, c, pool));
+  if (base_rev_id == SVN_INVALID_REVNUM)
+    return SVN_NO_ERROR;
 
   SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id,
                               TRUE, pool));

Modified: subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/README
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/README?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/README (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/README Tue Aug  7 18:20:26 2012
@@ -333,7 +333,8 @@ svntest/tree.py.  It will explain the ge
 
 Finally, try copying-and-pasting a simple test and then edit from
 there.  Don't forget to add your test to the 'test_list' variable at
-the bottom of the file.
+the bottom of the file. To avoid renumbering of existing tests, you
+should add new tests to the end of the list.
 
 
 Testing Compatability With Previous Release

Modified: subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/depth_tests.py?rev=1370418&r1=1370417&r2=1370418&view=diff
==============================================================================
--- subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/depth_tests.py Tue Aug  7 18:20:26 2012
@@ -2881,7 +2881,29 @@ def commit_then_immediates_update(sbox):
                                         expected_status,
                                         None, None, None, None, None, False,
                                         "--depth=immediates", wc_dir)
+
+def revert_depth_files(sbox):
+  "depth immediate+files should revert deleted files"
+
+  sbox.build(read_only = True)
+  
+  expected_output = "Reverted '" + re.escape(sbox.ospath('A/mu')) + "'"
   
+  # Apply an unrelated delete one level to deep
+  sbox.simple_rm('A/D/gamma')
+
+  sbox.simple_rm('A/mu')
+  # Expect reversion of just 'mu'
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'revert', '--depth=immediates', sbox.ospath('A'))
+
+  # Apply an unrelated directory delete
+  sbox.simple_rm('A/D')
+
+  sbox.simple_rm('A/mu')
+  # Expect reversion of just 'mu'
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'revert', '--depth=files', sbox.ospath('A'))
 
 
 #----------------------------------------------------------------------
@@ -2932,6 +2954,7 @@ test_list = [ None,
               sparse_update_with_dash_dash_parents,
               update_below_depth_empty,
               commit_then_immediates_update,
+              revert_depth_files,
               ]
 
 if __name__ == "__main__":