subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1405866 [2/4] - in /subversion/branches/wc-collate-path: ./ subversion/ subversion/bindings/javahl/native/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_delta/ subversion/libsvn_fs_fs/ subversi...
Date Mon, 05 Nov 2012 16:30:55 GMT
Modified: subversion/branches/wc-collate-path/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_fs_fs/fs_fs.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_fs_fs/fs_fs.c Mon Nov  5 16:30:51 2012
@@ -3160,6 +3160,16 @@ ensure_revprop_namespace(svn_fs_t *fs)
     : SVN_NO_ERROR;
 }
 
+/* Make sure the revprop_namespace member in FS is set. */
+static svn_error_t *
+cleanup_revprop_namespace(svn_fs_t *fs)
+{
+  const char *name = svn_dirent_join(fs->path,
+                                     ATOMIC_REVPROP_NAMESPACE,
+                                     fs->pool);
+  return svn_error_trace(svn_atomic_namespace__cleanup(name, fs->pool));
+}
+
 /* Make sure the revprop_generation member in FS is set and, if necessary,
  * initialized with the latest value stored on disk.
  */
@@ -3213,10 +3223,12 @@ ensure_revprop_timeout(svn_fs_t *fs)
 /* Create an error object with the given MESSAGE and pass it to the
    WARNING member of FS. */
 static void
-log_revprop_cache_init_warning(svn_fs_t *fs, const char *message)
+log_revprop_cache_init_warning(svn_fs_t *fs,
+                               svn_error_t *underlying_err,
+                               const char *message)
 {
   svn_error_t *err = svn_error_createf(SVN_ERR_FS_REPPROP_CACHE_INIT_FAILURE,
-                                       NULL,
+                                       underlying_err,
                                        message, fs->path);
 
   if (fs->warning)
@@ -3244,8 +3256,9 @@ has_revprop_cache(svn_fs_t *fs, apr_pool
        * -> disable the revprop cache for good
        */
       ffd->revprop_cache = NULL;
-      log_revprop_cache_init_warning(fs, "Revprop caching for '%s' disabled"
-                                         " because it would be inefficient.");
+      log_revprop_cache_init_warning(fs, NULL,
+                                     "Revprop caching for '%s' disabled"
+                                     " because it would be inefficient.");
       
       return FALSE;
     }
@@ -3256,12 +3269,11 @@ has_revprop_cache(svn_fs_t *fs, apr_pool
     {
       /* failure -> disable revprop cache for good */
 
-      svn_error_clear(error);
       ffd->revprop_cache = NULL;
-      log_revprop_cache_init_warning(fs, "Revprop caching for '%s' disabled "
-                                         "because SHM "
-                                         "infrastructure for revprop "
-                                         "caching failed to initialize.");
+      log_revprop_cache_init_warning(fs, error,
+                                     "Revprop caching for '%s' disabled "
+                                     "because SHM infrastructure for revprop "
+                                     "caching failed to initialize.");
 
       return FALSE;
     }
@@ -3655,7 +3667,7 @@ parse_packed_revprops(svn_fs_t *fs,
 
       /* read & check the serialized size */
       SVN_ERR(read_number_from_stream(&size, NULL, stream, iterpool));
-      if (size + offset > revprops->packed_revprops->len)
+      if (size + offset > (apr_int64_t)revprops->packed_revprops->len)
         return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
                         _("Packed revprop size exceeds pack file size"));
 
@@ -4958,7 +4970,6 @@ get_contents(struct rep_read_baton *rb,
              apr_size_t *len)
 {
   apr_size_t copy_len, remaining = *len;
-  apr_off_t offset;
   char *cur = buf;
   struct rep_state *rs;
 
@@ -4974,10 +4985,10 @@ get_contents(struct rep_read_baton *rb,
           /* We got the desired rep directly from the cache.
              This is where we need the pseudo rep_state created
              by build_rep_list(). */
-          offset = rs->off - rs->start;
+          apr_size_t offset = (apr_size_t)(rs->off - rs->start);
           if (copy_len + offset > rb->base_window->len)
             copy_len = offset < rb->base_window->len
-                     ? (apr_size_t)(rb->base_window->len - offset)
+                     ? rb->base_window->len - offset
                      : 0ul;
 
           memcpy (cur, rb->base_window->data + offset, copy_len);
@@ -7076,6 +7087,46 @@ choose_delta_base(representation_t **rep
   return SVN_NO_ERROR;
 }
 
+/* Something went wrong and the pool for the rep write is being
+   cleared before we've finished writing the rep.  So we need
+   to remove the rep from the protorevfile and we need to unlock
+   the protorevfile. */
+static apr_status_t
+rep_write_cleanup(void *data)
+{
+  struct rep_write_baton *b = data;
+  const char *txn_id = svn_fs_fs__id_txn_id(b->noderev->id);
+  svn_error_t *err;
+  
+  /* Truncate and close the protorevfile. */
+  err = svn_io_file_trunc(b->file, b->rep_offset, b->pool);
+  if (err)
+    {
+      apr_status_t rc = err->apr_err;
+      svn_error_clear(err);
+      return rc;
+    }
+  err = svn_io_file_close(b->file, b->pool);
+  if (err)
+    {
+      apr_status_t rc = err->apr_err;
+      svn_error_clear(err);
+      return rc;
+    }
+
+  /* Remove our lock */
+  err = unlock_proto_rev(b->fs, txn_id, b->lockcookie, b->pool);
+  if (err)
+    {
+      apr_status_t rc = err->apr_err;
+      svn_error_clear(err);
+      return rc;
+    }
+
+  return APR_SUCCESS;
+}
+
+
 /* Get a rep_write_baton and store it in *WB_P for the representation
    indicated by NODEREV in filesystem FS.  Perform allocations in
    POOL.  Only appropriate for file contents, not for props or
@@ -7139,6 +7190,10 @@ rep_write_get_baton(struct rep_write_bat
   /* Now determine the offset of the actual svndiff data. */
   SVN_ERR(get_file_offset(&b->delta_start, file, b->pool));
 
+  /* Cleanup in case something goes wrong. */
+  apr_pool_cleanup_register(b->pool, b, rep_write_cleanup,
+                            apr_pool_cleanup_null);
+
   /* Prepare to write the svndiff data. */
   svn_txdelta_to_svndiff3(&wh,
                           &whb,
@@ -7310,6 +7365,9 @@ rep_write_contents_close(void *baton)
       b->noderev->data_rep = rep;
     }
 
+  /* Remove cleanup callback. */
+  apr_pool_cleanup_kill(b->pool, b, rep_write_cleanup);
+
   /* Write out the new node-rev information. */
   SVN_ERR(svn_fs_fs__put_node_revision(b->fs, b->noderev->id, b->noderev, FALSE,
                                        b->pool));
@@ -7451,7 +7509,7 @@ get_next_revision_ids(const char **node_
 
   *node_id = apr_pstrdup(pool, str);
 
-  str = svn_cstring_tokenize(" ", &buf);
+  str = svn_cstring_tokenize(" \n", &buf);
   if (! str)
     return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
                             _("Corrupt 'current' file"));
@@ -8912,7 +8970,10 @@ recover_body(void *baton, apr_pool_t *po
   svn_revnum_t youngest_rev;
   svn_node_kind_t youngest_revprops_kind;
 
-  /* First, we need to know the largest revision in the filesystem. */
+  /* Lose potentially corrupted data in temp files */
+  SVN_ERR(cleanup_revprop_namespace(fs));
+
+  /* We need to know the largest revision in the filesystem. */
   SVN_ERR(recover_get_largest_revision(fs, &max_rev, pool));
 
   /* Get the expected youngest revision */
@@ -9005,7 +9066,7 @@ recover_body(void *baton, apr_pool_t *po
     {
       svn_boolean_t missing = TRUE;
       if (!packed_revprop_available(&missing, fs, max_rev, pool))
-	{
+        {
           if (missing)
             {
               return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
@@ -10153,17 +10214,17 @@ svn_fs_fs__verify(svn_fs_t *fs,
     svn_revnum_t i;
     for (i = start; i <= end; i++)
       {
-      	svn_fs_root_t *root;
+        svn_fs_root_t *root;
 
         svn_pool_clear(iterpool);
 
-      	/* ### TODO: Make sure caches are disabled.
+        /* ### TODO: Make sure caches are disabled.
 
-      	   When this code is called in the library, we want to ensure we
-      	   use the on-disk data --- rather than some data that was read
-      	   in the possibly-distance past and cached since. */
-      	SVN_ERR(svn_fs_fs__revision_root(&root, fs, i, iterpool));
-      	SVN_ERR(svn_fs_fs__verify_root(root, iterpool));
+           When this code is called in the library, we want to ensure we
+           use the on-disk data --- rather than some data that was read
+           in the possibly-distance past and cached since. */
+        SVN_ERR(svn_fs_fs__revision_root(&root, fs, i, iterpool));
+        SVN_ERR(svn_fs_fs__verify_root(root, iterpool));
       }
   }
 
@@ -10924,7 +10985,7 @@ hotcopy_body(void *baton, apr_pool_t *po
                                       iterpool));
 
       /* After completing a full shard, update 'current'. */
-      if (rev % max_files_per_dir == 0)
+      if (max_files_per_dir && rev % max_files_per_dir == 0)
         SVN_ERR(hotcopy_update_current(&dst_youngest, dst_fs, rev, iterpool));
     }
   svn_pool_destroy(iterpool);
@@ -10986,14 +11047,16 @@ hotcopy_body(void *baton, apr_pool_t *po
                                  PATH_TXN_CURRENT, pool));
 
   /* If a revprop generation file exists in the source filesystem,
-   * force a fresh revprop caching namespace for the destination by
-   * setting the generation to zero. We have no idea if the revprops
-   * we copied above really belong to the currently cached generation. */
+   * reset it to zero (since this is on a different path, it will not
+   * overlap with data already in cache).  Also, clean up stale files
+   * used for the named atomics implementation. */
   SVN_ERR(svn_io_check_path(path_revprop_generation(src_fs, pool),
                             &kind, pool));
   if (kind == svn_node_file)
     SVN_ERR(write_revprop_generation_file(dst_fs, 0, pool));
 
+  SVN_ERR(cleanup_revprop_namespace(dst_fs));
+
   /* Hotcopied FS is complete. Stamp it with a format file. */
   SVN_ERR(write_format(svn_dirent_join(dst_fs->path, PATH_FORMAT, pool),
                        dst_ffd->format, max_files_per_dir, TRUE, pool));

Modified: subversion/branches/wc-collate-path/subversion/libsvn_ra/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_ra/compat.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_ra/compat.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_ra/compat.c Mon Nov  5 16:30:51 2012
@@ -903,7 +903,7 @@ svn_ra__get_inherited_props_walk(svn_ra_
       svn_error_t *err;
 
       svn_pool_clear(iterpool);
-      parent_url = svn_uri_dirname(parent_url, iterpool);
+      parent_url = svn_uri_dirname(parent_url, scratch_pool);
       SVN_ERR(svn_ra_reparent(session, parent_url, iterpool));
       err = session->vtable->get_dir(session, NULL, NULL,
                                      &parent_props, "",

Modified: subversion/branches/wc-collate-path/subversion/libsvn_ra/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_ra/deprecated.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_ra/deprecated.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_ra/deprecated.c Mon Nov  5 16:30:51 2012
@@ -33,6 +33,7 @@
 #include "svn_pools.h"
 
 #include "ra_loader.h"
+#include "deprecated.h"
 
 #include "svn_private_config.h"
 
@@ -430,3 +431,27 @@ svn_error_t *svn_ra_get_dir(svn_ra_sessi
   return session->vtable->get_dir(session, dirents, fetched_rev, props,
                                   path, revision, SVN_DIRENT_ALL, pool);
 }
+
+svn_error_t *
+svn_ra_local__deprecated_init(int abi_version,
+                              apr_pool_t *pool,
+                              apr_hash_t *hash)
+{
+  return svn_error_trace(svn_ra_local_init(abi_version, pool, hash));
+}
+
+svn_error_t *
+svn_ra_svn__deprecated_init(int abi_version,
+                            apr_pool_t *pool,
+                            apr_hash_t *hash)
+{
+  return svn_error_trace(svn_ra_svn_init(abi_version, pool, hash));
+}
+
+svn_error_t *
+svn_ra_serf__deprecated_init(int abi_version,
+                             apr_pool_t *pool,
+                             apr_hash_t *hash)
+{
+  return svn_error_trace(svn_ra_serf_init(abi_version, pool, hash));
+}

Modified: subversion/branches/wc-collate-path/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_ra/ra_loader.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_ra/ra_loader.c Mon Nov  5 16:30:51 2012
@@ -48,6 +48,7 @@
 
 #include "svn_config.h"
 #include "ra_loader.h"
+#include "deprecated.h"
 
 #include "private/svn_ra_private.h"
 #include "svn_private_config.h"
@@ -78,7 +79,7 @@ static const struct ra_lib_defn {
     svn_schemes,
 #ifdef SVN_LIBSVN_CLIENT_LINKS_RA_SVN
     svn_ra_svn__init,
-    svn_ra_svn_init
+    svn_ra_svn__deprecated_init
 #endif
   },
 
@@ -87,7 +88,7 @@ static const struct ra_lib_defn {
     local_schemes,
 #ifdef SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL
     svn_ra_local__init,
-    svn_ra_local_init
+    svn_ra_local__deprecated_init
 #endif
   },
 
@@ -96,7 +97,7 @@ static const struct ra_lib_defn {
     dav_schemes,
 #ifdef SVN_LIBSVN_CLIENT_LINKS_RA_SERF
     svn_ra_serf__init,
-    svn_ra_serf_init
+    svn_ra_serf__deprecated_init
 #endif
   },
 

Modified: subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/commit.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/commit.c Mon Nov  5 16:30:51 2012
@@ -1983,7 +1983,8 @@ apply_textdelta(void *file_baton,
   ctx->stream = svn_stream_create(ctx, pool);
   svn_stream_set_write(ctx->stream, svndiff_stream_write);
 
-  svn_txdelta_to_svndiff2(handler, handler_baton, ctx->stream, 0, pool);
+  svn_txdelta_to_svndiff3(handler, handler_baton, ctx->stream, 0,
+                          SVN_DELTA_COMPRESSION_LEVEL_DEFAULT, pool);
 
   if (base_checksum)
     ctx->base_checksum = apr_pstrdup(ctx->pool, base_checksum);

Modified: subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/ra_serf.h?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/ra_serf.h Mon Nov  5 16:30:51 2012
@@ -57,7 +57,8 @@ extern "C" {
 #define UNUSED_CTX(x) ((void)(x))
 
 /** Our User-Agent string. */
-#define USER_AGENT "SVN/" SVN_VER_NUMBER " serf/" \
+#define USER_AGENT "SVN/" SVN_VER_NUMBER " (" SVN_BUILD_TARGET ")" \
+                   " serf/" \
                    APR_STRINGIFY(SERF_MAJOR_VERSION) "." \
                    APR_STRINGIFY(SERF_MINOR_VERSION) "." \
                    APR_STRINGIFY(SERF_PATCH_VERSION)

Modified: subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/serf.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/serf.c Mon Nov  5 16:30:51 2012
@@ -417,7 +417,7 @@ svn_ra_serf__open(svn_ra_session_t *sess
     callbacks->get_client_string(callback_baton, &client_string, pool);
 
   if (client_string)
-    serf_sess->useragent = apr_pstrcat(pool, USER_AGENT, "/",
+    serf_sess->useragent = apr_pstrcat(pool, USER_AGENT, " ",
                                        client_string, (char *)NULL);
   else
     serf_sess->useragent = USER_AGENT;

Modified: subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/util.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/util.c Mon Nov  5 16:30:51 2012
@@ -836,7 +836,12 @@ start_error(svn_ra_serf__xml_parser_t *p
           SVN_ERR(svn_cstring_atoi64(&val, err_code));
           ctx->error->apr_err = (apr_status_t)val;
         }
-      else
+
+      /* If there's no error code provided, or if the provided code is
+         0 (which can happen sometimes depending on how the error is
+         constructed on the server-side), just pick a generic error
+         code to run with. */
+      if (! ctx->error->apr_err)
         {
           ctx->error->apr_err = SVN_ERR_RA_DAV_REQUEST_FAILED;
         }

Modified: subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/util_error.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/util_error.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/util_error.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/util_error.c Mon Nov  5 16:30:51 2012
@@ -76,9 +76,16 @@ svn_ra_serf__wrap_err(apr_status_t statu
         }
 
       /* Append it to the formatted message. */
-      va_start(ap, fmt);
-      msg = apr_pvsprintf(err->pool, fmt, ap);
-      va_end(ap);
+      if (fmt)
+        {
+          va_start(ap, fmt);
+          msg = apr_pvsprintf(err->pool, fmt, ap);
+          va_end(ap);
+        }
+      else
+        {
+          msg = "ra_serf";
+        }
       if (err_msg)
         {
           err->message = apr_pstrcat(err->pool, msg, ": ", err_msg, NULL);

Modified: subversion/branches/wc-collate-path/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_ra_svn/client.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_ra_svn/client.c Mon Nov  5 16:30:51 2012
@@ -617,7 +617,7 @@ static svn_error_t *open_session(svn_ra_
     SVN_ERR(sess->callbacks->get_client_string(sess->callbacks_baton,
                                                &client_string, pool));
   if (client_string)
-    sess->useragent = apr_pstrcat(pool, SVN_RA_SVN__DEFAULT_USERAGENT "/",
+    sess->useragent = apr_pstrcat(pool, SVN_RA_SVN__DEFAULT_USERAGENT " ",
                                   client_string, (char *)NULL);
   else
     sess->useragent = SVN_RA_SVN__DEFAULT_USERAGENT;

Modified: subversion/branches/wc-collate-path/subversion/libsvn_ra_svn/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_ra_svn/cyrus_auth.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_ra_svn/cyrus_auth.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_ra_svn/cyrus_auth.c Mon Nov  5 16:30:51 2012
@@ -871,12 +871,12 @@ svn_ra_svn__do_cyrus_auth(svn_ra_svn__se
 
   /* The username callback. */
   callbacks[0].id = SASL_CB_AUTHNAME;
-  callbacks[0].proc = get_username_cb;
+  callbacks[0].proc = (void*)get_username_cb;
   callbacks[0].context = &cred_baton;
 
   /* The password callback. */
   callbacks[1].id = SASL_CB_PASS;
-  callbacks[1].proc = get_password_cb;
+  callbacks[1].proc = (void*)get_password_cb;
   callbacks[1].context = &cred_baton;
 
   /* Mark the end of the array. */

Modified: subversion/branches/wc-collate-path/subversion/libsvn_ra_svn/ra_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_ra_svn/ra_svn.h?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_ra_svn/ra_svn.h (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_ra_svn/ra_svn.h Mon Nov  5 16:30:51 2012
@@ -57,7 +57,8 @@ typedef svn_error_t *(*ra_svn_block_hand
                                                void *baton);
 
 /* The default "user agent". */
-#define SVN_RA_SVN__DEFAULT_USERAGENT  "SVN/" SVN_VER_NUMBER
+#define SVN_RA_SVN__DEFAULT_USERAGENT  "SVN/" SVN_VER_NUMBER\
+                                       " (" SVN_BUILD_TARGET ")"
 
 /* The size of our per-connection read and write buffers. */
 #define SVN_RA_SVN__PAGE_SIZE 4096

Modified: subversion/branches/wc-collate-path/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_repos/fs-wrap.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_repos/fs-wrap.c Mon Nov  5 16:30:51 2012
@@ -760,7 +760,7 @@ svn_repos_fs_get_inherited_props(apr_arr
       apr_hash_t *parent_properties;
 
       svn_pool_clear(iterpool);
-      parent_path = svn_fspath__dirname(parent_path, iterpool);
+      parent_path = svn_fspath__dirname(parent_path, scratch_pool);
 
       if (authz_read_func)
         SVN_ERR(authz_read_func(&allowed, root, parent_path,

Modified: subversion/branches/wc-collate-path/subversion/libsvn_repos/load.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_repos/load.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_repos/load.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_repos/load.c Mon Nov  5 16:30:51 2012
@@ -336,7 +336,7 @@ parse_text_block(svn_stream_t *stream,
      need to read it. */
   while (content_length)
     {
-      if (content_length >= buflen)
+      if (content_length >= (svn_filesize_t)buflen)
         rlen = buflen;
       else
         rlen = (apr_size_t) content_length;
@@ -659,7 +659,7 @@ svn_repos_parse_dumpstream3(svn_stream_t
           /* Consume remaining bytes in this content block */
           while (remaining > 0)
             {
-              if (remaining >= buflen)
+              if (remaining >= (svn_filesize_t)buflen)
                 rlen = buflen;
               else
                 rlen = (apr_size_t) remaining;

Modified: subversion/branches/wc-collate-path/subversion/libsvn_repos/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_repos/replay.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_repos/replay.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_repos/replay.c Mon Nov  5 16:30:51 2012
@@ -781,6 +781,7 @@ path_driver_cb_func(void **dir_baton,
   return SVN_NO_ERROR;
 }
 
+#ifdef USE_EV2_IMPL
 static svn_error_t *
 fetch_kind_func(svn_kind_t *kind,
                 void *baton,
@@ -823,6 +824,7 @@ fetch_props_func(apr_hash_t **props,
 
   return SVN_NO_ERROR;
 }
+#endif
 
 
 
@@ -946,9 +948,9 @@ svn_repos_replay2(svn_fs_root_t *root,
     }
 
   /* Call the path-based editor driver. */
-  return svn_delta_path_driver(editor, edit_baton,
-                               SVN_INVALID_REVNUM, paths,
-                               path_driver_cb_func, &cb_baton, pool);
+  return svn_delta_path_driver2(editor, edit_baton,
+                                paths, TRUE,
+                                path_driver_cb_func, &cb_baton, pool);
 #else
   svn_editor_t *editorv2;
   struct svn_delta__extra_baton *exb;

Modified: subversion/branches/wc-collate-path/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/cache-membuffer.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_subr/cache-membuffer.c Mon Nov  5 16:30:51 2012
@@ -108,7 +108,7 @@
  */
 #define GROUP_SIZE 16
 
-/* For more efficient copy operations, let'a align all data items properly.
+/* For more efficient copy operations, let's align all data items properly.
  * Must be a power of 2.
  */
 #define ITEM_ALIGNMENT 16
@@ -281,7 +281,7 @@ static svn_error_t* assert_equal_tags(co
   return SVN_NO_ERROR;
 }
 
-/* Reoccuring code snippets.
+/* Reoccurring code snippets.
  */
 
 #define DEBUG_CACHE_MEMBUFFER_TAG_ARG entry_tag_t *tag,
@@ -357,12 +357,12 @@ typedef struct entry_t
 #endif
 } entry_t;
 
-/* We group dictionary entries to make this GROUP-SIZE-way assicative.
+/* We group dictionary entries to make this GROUP-SIZE-way associative.
  */
 typedef struct entry_group_t
 {
   /* number of entries used [0 .. USED-1] */
-  apr_size_t used;
+  apr_uint32_t used;
 
   /* the actual entries */
   entry_t entries[GROUP_SIZE];
@@ -483,7 +483,7 @@ struct svn_membuffer_t
  */
 #define ALIGN_POINTER(pointer) ((void*)ALIGN_VALUE((apr_size_t)(char*)(pointer)))
 
-/* If locking is supported for CACHE, aquire a read lock for it.
+/* If locking is supported for CACHE, acquire a read lock for it.
  */
 static svn_error_t *
 read_lock_cache(svn_membuffer_t *cache)
@@ -614,10 +614,10 @@ get_entry(svn_membuffer_t *cache, apr_ui
 static APR_INLINE apr_uint32_t
 get_index(svn_membuffer_t *cache, entry_t *entry)
 {
-  apr_uint32_t group_index
+  apr_size_t group_index
     = ((char *)entry - (char *)cache->directory) / sizeof(entry_group_t);
 
-  return group_index * GROUP_SIZE
+  return (apr_uint32_t)group_index * GROUP_SIZE
        + (apr_uint32_t)(entry - cache->directory[group_index].entries);
 }
 
@@ -794,7 +794,7 @@ get_group_index(svn_membuffer_t **cache,
   return key[1] % segment0->group_count;
 }
 
-/* Reduce the hit count of ENTRY and update the accumunated hit info
+/* Reduce the hit count of ENTRY and update the accumulated hit info
  * in CACHE accordingly.
  */
 static APR_INLINE void
@@ -806,8 +806,8 @@ let_entry_age(svn_membuffer_t *cache, en
   entry->hit_count -= hits_removed;
 }
 
-/* Returns 0 if the entry group idenified by GROUP_INDEX in CACHE has not
- * been intialized, yet. In that case, this group can not data. Otherwise,
+/* Returns 0 if the entry group identified by GROUP_INDEX in CACHE has not
+ * been initialized, yet. In that case, this group can not data. Otherwise,
  * a non-zero value is returned.
  */
 static APR_INLINE unsigned char
@@ -822,7 +822,7 @@ is_group_initialized(svn_membuffer_t *ca
 }
 
 /* Initializes the section of the directory in CACHE that contains
- * the entry group indentified by GROUP_INDEX. */
+ * the entry group identified by GROUP_INDEX. */
 static void
 initialize_group(svn_membuffer_t *cache, apr_uint32_t group_index)
 {
@@ -923,7 +923,7 @@ find_entry(svn_membuffer_t *cache,
               entry = &group->entries[i];
 
           /* for the entries that don't have been removed,
-           * reduce their hitcounts to put them at a relative
+           * reduce their hit counts to put them at a relative
            * disadvantage the next time.
            */
           for (i = 0; i < GROUP_SIZE; ++i)
@@ -959,7 +959,7 @@ move_entry(svn_membuffer_t *cache, entry
 
   /* Move the entry to the start of the empty / insertion section
    * (if it isn't there already). Size-aligned moves are legal
-   * since all offsets and block sizes share this same aligment.
+   * since all offsets and block sizes share this same alignment.
    * Size-aligned moves tend to be faster than non-aligned ones
    * because no "odd" bytes at the end need to special treatment.
    */
@@ -1186,7 +1186,7 @@ svn_cache__membuffer_cache_create(svn_me
              < total_size)
         ++segment_count_shift;
 
-      segment_count = 1 << segment_count_shift;
+      segment_count = (apr_size_t)1 << segment_count_shift;
     }
 
   /* If we have an extremely large cache (>512 GB), the default segment
@@ -1233,7 +1233,7 @@ svn_cache__membuffer_cache_create(svn_me
                  ? MAX_ITEM_SIZE
                  : data_size / 4;
 
-  /* to keep the entries small, we use 32 bit indices only
+  /* to keep the entries small, we use 32 bit indexes only
    * -> we need to ensure that no more then 4G entries exist.
    *
    * Note, that this limit could only be exceeded in a very
@@ -1249,7 +1249,7 @@ svn_cache__membuffer_cache_create(svn_me
     {
       /* allocate buffers and initialize cache members
        */
-      c[seg].segment_count = segment_count;
+      c[seg].segment_count = (apr_uint32_t)segment_count;
 
       c[seg].group_count = group_count;
       c[seg].directory = apr_pcalloc(pool,
@@ -1438,7 +1438,7 @@ membuffer_cache_set_internal(svn_membuff
   return SVN_NO_ERROR;
 }
 
-/* Try to insert the ITEM and use the KEY to unqiuely identify it.
+/* Try to insert the ITEM and use the KEY to uniquely identify it.
  * However, there is no guarantee that it will actually be put into
  * the cache. If there is already some data associated to the KEY,
  * it will be removed from the cache even if the new data cannot
@@ -1817,11 +1817,11 @@ membuffer_cache_set_partial(svn_membuffe
  * Because membuffer caches tend to be very large, there will be rather few
  * of them (usually only one). Thus, the same instance shall be used as the
  * backend to many application-visible svn_cache__t instances. This should
- * also achive global resource usage fairness.
+ * also achieve global resource usage fairness.
  *
- * To accomodate items from multiple resources, the individual keys must be
- * unique over all sources. This is achived by simply adding a prefix key
- * that unambigously identifies the item's context (e.g. path to the
+ * To accommodate items from multiple resources, the individual keys must be
+ * unique over all sources. This is achieved by simply adding a prefix key
+ * that unambiguously identifies the item's context (e.g. path to the
  * respective repository). The prefix will be set upon construction of the
  * svn_cache__t instance.
  */
@@ -2148,11 +2148,11 @@ svn_membuffer_cache_get_info(void *cache
   svn_membuffer_cache_t *cache = cache_void;
   apr_uint32_t i;
 
-  /* cache frontend specific data */
+  /* cache front-end specific data */
 
   info->id = apr_pstrdup(result_pool, cache->full_prefix);
 
-  /* collect info from shared cache backend */
+  /* collect info from shared cache back-end */
 
   info->data_size = 0;
   info->used_size = 0;

Modified: subversion/branches/wc-collate-path/subversion/libsvn_subr/config_win.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/config_win.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_subr/config_win.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_subr/config_win.c Mon Nov  5 16:30:51 2012
@@ -56,7 +56,7 @@ svn_config__win_config_path(const char *
                      | CSIDL_FLAG_CREATE);
 
   WCHAR folder_ucs2[MAX_PATH];
-  apr_size_t inwords, outbytes, outlength;
+  int inwords, outbytes, outlength;
   char *folder_utf8;
 
   if (S_OK != SHGetFolderPathW(NULL, csidl, NULL, SHGFP_TYPE_CURRENT,
@@ -109,7 +109,7 @@ parse_section(svn_config_t *cfg, HKEY hk
   svn_stringbuf_ensure(value, SVN_REG_DEFAULT_VALUE_SIZE);
   for (index = 0; ; ++index)
     {
-      option_len = option->blocksize;
+      option_len = (DWORD)option->blocksize;
       err = RegEnumValue(hkey, index, option->data, &option_len,
                          NULL, &type, NULL, NULL);
       if (err == ERROR_NO_MORE_ITEMS)
@@ -128,7 +128,7 @@ parse_section(svn_config_t *cfg, HKEY hk
          http://subversion.tigris.org/issues/show_bug.cgi?id=671 */
       if (type == REG_SZ && option->data[0] != '#')
         {
-          DWORD value_len = value->blocksize;
+          DWORD value_len = (DWORD)value->blocksize;
           err = RegQueryValueEx(hkey, option->data, NULL, NULL,
                                 (LPBYTE)value->data, &value_len);
           if (err == ERROR_MORE_DATA)
@@ -214,7 +214,7 @@ svn_config__parse_registry(svn_config_t 
   svn_stringbuf_ensure(section, SVN_REG_DEFAULT_NAME_SIZE);
   for (index = 0; ; ++index)
     {
-      DWORD section_len = section->blocksize;
+      DWORD section_len = (DWORD)section->blocksize;
       FILETIME last_write_time;
       HKEY sub_hkey;
 

Modified: subversion/branches/wc-collate-path/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/dirent_uri.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_subr/dirent_uri.c Mon Nov  5 16:30:51 2012
@@ -911,7 +911,7 @@ svn_dirent_is_root(const char *dirent, a
       && dirent[len - 1] != '/')
     {
       int segments = 0;
-      int i;
+      apr_size_t i;
       for (i = len; i >= 2; i--)
         {
           if (dirent[i] == '/')

Modified: subversion/branches/wc-collate-path/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/io.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_subr/io.c Mon Nov  5 16:30:51 2012
@@ -138,6 +138,14 @@
 #endif
 #endif
 
+/* Forward declaration */
+static apr_status_t
+dir_is_empty(const char *dir, apr_pool_t *pool);
+static APR_INLINE svn_error_t *
+do_io_file_wrapper_cleanup(apr_file_t *file, apr_status_t status,
+                           const char *msg, const char *msg_no_name,
+                           apr_pool_t *pool);
+
 /* Local wrapper of svn_path_cstring_to_utf8() that does no copying on
  * operating systems where APR always uses utf-8 as native path format */
 static svn_error_t *
@@ -2077,11 +2085,6 @@ svn_io_file_lock2(const char *lock_file,
 
 /* Data consistency/coherency operations. */
 
-static APR_INLINE svn_error_t *
-do_io_file_wrapper_cleanup(apr_file_t *file, apr_status_t status,
-                           const char *msg, const char *msg_no_name,
-                           apr_pool_t *pool);
-
 svn_error_t *svn_io_file_flush_to_disk(apr_file_t *file,
                                        apr_pool_t *pool)
 {
@@ -3723,11 +3726,6 @@ svn_io_dir_open(apr_dir_t **new_dir, con
   return SVN_NO_ERROR;
 }
 
-/* Forward declaration */
-static apr_status_t
-dir_is_empty(const char *dir, apr_pool_t *pool);
-
-
 svn_error_t *
 svn_io_dir_remove_nonrecursive(const char *dirname, apr_pool_t *pool)
 {

Modified: subversion/branches/wc-collate-path/subversion/libsvn_subr/named_atomic.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/named_atomic.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_subr/named_atomic.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_subr/named_atomic.c Mon Nov  5 16:30:51 2012
@@ -24,7 +24,7 @@
 #include "private/svn_named_atomic.h"
 
 #include <apr_global_mutex.h>
-#include <apr_shm.h>
+#include <apr_mmap.h>
 
 #include "svn_private_config.h"
 #include "private/svn_atomic.h"
@@ -35,13 +35,16 @@
 
 /* Implementation aspects.
  *
- * We use a single shared memory block that will be created by the first
- * user and merely mapped by all subsequent ones. The memory block contains
- * an short header followed by a fixed-capacity array of named atomics. The
- * number of entries currently in use is stored in the header part.
+ * We use a single shared memory block (memory mapped file) that will be
+ * created by the first user and merely mapped by all subsequent ones.
+ * The memory block contains an short header followed by a fixed-capacity
+ * array of named atomics. The number of entries currently in use is stored
+ * in the header part.
  *
- * Finding / creating the SHM object as well as adding new array entries
- * is being guarded by an APR global mutex.
+ * Finding / creating the MMAP object as well as adding new array entries
+ * is being guarded by an APR global mutex. Since releasing the MMAP
+ * structure and closing the underlying does not affect other users of the
+ * same, cleanup will not be synchronized.
  *
  * The array is append-only.  Once a process mapped the block into its
  * address space, it may freely access any of the used entries.  However,
@@ -182,8 +185,8 @@ struct named_atomic_data_t
  */
 struct shared_data_t
 {
-  volatile apr_int32_t count;
-  char padding [sizeof(struct named_atomic_data_t) - sizeof(apr_int32_t)];
+  volatile apr_uint32_t count;
+  char padding [sizeof(struct named_atomic_data_t) - sizeof(apr_uint32_t)];
 
   struct named_atomic_data_t atomics[MAX_ATOMIC_COUNT];
 };
@@ -382,8 +385,13 @@ svn_atomic_namespace__create(svn_atomic_
                              apr_pool_t *result_pool)
 {
   apr_status_t apr_err;
+  svn_error_t *err;
+  apr_file_t *file;
+  apr_mmap_t *mmap;
   const char *shm_name, *lock_name;
-  apr_shm_t *shared_mem;
+  apr_finfo_t finfo;
+
+  apr_pool_t *subpool = svn_pool_create(result_pool);
 
   /* allocate the namespace data structure
    */
@@ -391,8 +399,8 @@ svn_atomic_namespace__create(svn_atomic_
 
   /* construct the names of the system objects that we need
    */
-  shm_name = apr_pstrcat(result_pool, name, SHM_NAME_SUFFIX, NULL);
-  lock_name = apr_pstrcat(result_pool, name, MUTEX_NAME_SUFFIX, NULL);
+  shm_name = apr_pstrcat(subpool, name, SHM_NAME_SUFFIX, NULL);
+  lock_name = apr_pstrcat(subpool, name, MUTEX_NAME_SUFFIX, NULL);
 
   /* initialize the lock objects
    */
@@ -415,42 +423,82 @@ svn_atomic_namespace__create(svn_atomic_
    */
   SVN_ERR(lock(&new_ns->mutex));
 
-  /* First, look for an existing shared memory object.  If it doesn't
-   * exist, create one.
+  /* First, make sure that the underlying file exists.  If it doesn't
+   * exist, create one and initialize its content.
+   */
+  err = svn_io_file_open(&file, shm_name,
+                          APR_READ | APR_WRITE | APR_CREATE,
+                          APR_OS_DEFAULT,
+                          result_pool);
+  if (!err)
+    {
+      err = svn_io_stat(&finfo, shm_name, APR_FINFO_SIZE, subpool);
+      if (!err && finfo.size < sizeof(struct shared_data_t))
+        {
+           /* Zero all counters, values and names.
+            */
+           struct shared_data_t initial_data;
+           memset(&initial_data, 0, sizeof(initial_data));
+           err = svn_io_file_write_full(file, &initial_data,
+                                        sizeof(initial_data), NULL,
+                                        subpool);
+        }
+    }
+
+  /* Now, map it into memory.
    */
-  apr_err = apr_shm_attach(&shared_mem, shm_name, result_pool);
-  if (apr_err)
+  if (!err)
     {
-      apr_err = apr_shm_create(&shared_mem,
-                               sizeof(*new_ns->data),
-                               shm_name,
-                               result_pool);
-      if (apr_err)
-        return unlock(&new_ns->mutex,
-                      svn_error_wrap_apr(apr_err,
-                          _("Can't get shared memory for named atomics")));
+      apr_err = apr_mmap_create(&mmap, file, 0, sizeof(*new_ns->data),
+                                APR_MMAP_READ | APR_MMAP_WRITE , result_pool);
+      if (!apr_err)
+        new_ns->data = mmap->mm;
+      else
+        err = svn_error_createf(apr_err, NULL,
+                                _("MMAP failed for file '%s'"), shm_name);
+    }
 
-      new_ns->data = apr_shm_baseaddr_get(shared_mem);
+  svn_pool_destroy(subpool);
 
-      /* Zero all counters, values and names.
+  if (!err && new_ns->data)
+    {
+      /* Detect severe cases of corruption (i.e. when some outsider messed
+       * with our data file)
+       */
+      if (new_ns->data->count > MAX_ATOMIC_COUNT)
+        return svn_error_create(SVN_ERR_CORRUPTED_ATOMIC_STORAGE, 0,
+                       _("Number of atomics in namespace is too large."));
+
+      /* Cache the number of existing, complete entries.  There can't be
+       * incomplete ones from other processes because we hold the mutex.
+       * Our process will also not access this information since we are
+       * either being called from within svn_atomic__init_once or by
+       * svn_atomic_namespace__create for a new object.
        */
-      memset(new_ns->data, 0, sizeof(*new_ns->data));
+      new_ns->min_used = new_ns->data->count;
+      *ns = new_ns;
     }
-  else
-    new_ns->data = apr_shm_baseaddr_get(shared_mem);
-
-  /* Cache the number of existing, complete entries.  There can't be
-   * incomplete ones from other processes because we hold the mutex.
-   * Our process will also not access this information since we are
-   * wither being called from within svn_atomic__init_once or by
-   * svn_atomic_namespace__create for a new object.
-   */
-  new_ns->min_used = new_ns->data->count;
 
   /* Unlock to allow other processes may access the shared memory as well.
    */
-  *ns = new_ns;
-  return unlock(&new_ns->mutex, SVN_NO_ERROR);
+  return unlock(&new_ns->mutex, err);
+}
+
+svn_error_t *
+svn_atomic_namespace__cleanup(const char *name,
+                              apr_pool_t *pool)
+{
+  const char *shm_name, *lock_name;
+
+  /* file names used for the specified namespace */
+  shm_name = apr_pstrcat(pool, name, SHM_NAME_SUFFIX, NULL);
+  lock_name = apr_pstrcat(pool, name, MUTEX_NAME_SUFFIX, NULL);
+
+  /* remove these files if they exist */
+  SVN_ERR(svn_io_remove_file2(shm_name, TRUE, pool));
+  SVN_ERR(svn_io_remove_file2(lock_name, TRUE, pool));
+
+  return SVN_NO_ERROR;
 }
 
 svn_error_t *
@@ -459,7 +507,7 @@ svn_named_atomic__get(svn_named_atomic__
                       const char *name,
                       svn_boolean_t auto_create)
 {
-  apr_int32_t i, count;
+  apr_uint32_t i, count;
   svn_error_t *error = SVN_NO_ERROR;
   apr_size_t len = strlen(name);
 
@@ -497,7 +545,7 @@ svn_named_atomic__get(svn_named_atomic__
   /* We only need to check for new entries.
    */
   for (i = count; i < ns->data->count; ++i)
-    if (strcmp(ns->data->atomics[i].name, name) == 0)
+    if (strncmp(ns->data->atomics[i].name, name, len + 1) == 0)
       {
         return_atomic(atomic, ns, i);
 

Modified: subversion/branches/wc-collate-path/subversion/libsvn_subr/spillbuf.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/spillbuf.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_subr/spillbuf.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_subr/spillbuf.c Mon Nov  5 16:30:51 2012
@@ -290,7 +290,7 @@ read_data(struct memblock_t **mem,
   *mem = get_buffer(buf);
   /* NOTE: mem's size/next are uninitialized.  */
 
-  if (buf->spill_size < buf->blocksize)
+  if ((apr_uint64_t)buf->spill_size < (apr_uint64_t)buf->blocksize)
     (*mem)->size = (apr_size_t)buf->spill_size;
   else
     (*mem)->size = buf->blocksize;  /* The size of (*mem)->data  */

Modified: subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite.c Mon Nov  5 16:30:51 2012
@@ -45,6 +45,9 @@
 #ifdef SVN_SQLITE_INLINE
 /* Include sqlite3 inline, making all symbols private. */
   #define SQLITE_API static
+  #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+    #pragma GCC diagnostic ignored "-Wunused-function"
+  #endif
   #include <sqlite3.c>
 #else
   #include <sqlite3.h>

Modified: subversion/branches/wc-collate-path/subversion/libsvn_subr/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/temp_serializer.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_subr/temp_serializer.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_subr/temp_serializer.c Mon Nov  5 16:30:51 2012
@@ -333,7 +333,7 @@ svn_temp_serializer__get_length(svn_temp
   return context->buffer->len;
 }
 
-/* Return the data buffer that receives the serialialized data from
+/* Return the data buffer that receives the serialized data from
  * the given serialization CONTEXT.
  */
 svn_stringbuf_t *

Modified: subversion/branches/wc-collate-path/subversion/libsvn_subr/utf_width.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/utf_width.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_subr/utf_width.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_subr/utf_width.c Mon Nov  5 16:30:51 2012
@@ -67,16 +67,16 @@
 #include "svn_private_config.h"
 
 struct interval {
-  int first;
-  int last;
+  apr_uint32_t first;
+  apr_uint32_t last;
 };
 
 /* auxiliary function for binary search in interval table */
 static int
-bisearch(apr_uint32_t ucs, const struct interval *table, int max)
+bisearch(apr_uint32_t ucs, const struct interval *table, apr_uint32_t max)
 {
-  int min = 0;
-  int mid;
+  apr_uint32_t min = 0;
+  apr_uint32_t mid;
 
   if (ucs < table[0].first || ucs > table[max].last)
     return 0;
@@ -85,7 +85,7 @@ bisearch(apr_uint32_t ucs, const struct 
     if (ucs > table[mid].last)
       min = mid + 1;
     else if (ucs < table[mid].first)
-      max = mid - 1;
+      max = mid - 1; /* this is safe because ucs >= table[0].first */
     else
       return 1;
   }

Modified: subversion/branches/wc-collate-path/subversion/libsvn_subr/win32_crashrpt.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/win32_crashrpt.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_subr/win32_crashrpt.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_subr/win32_crashrpt.c Mon Nov  5 16:30:51 2012
@@ -46,6 +46,12 @@ HANDLE dbghelp_dll = INVALID_HANDLE_VALU
 
 #define LOGFILE_PREFIX "svn-crash-log"
 
+#if defined(_M_IX86)
+#define FORMAT_PTR "0x%08x"
+#elif defined(_M_X64)
+#define FORMAT_PTR "0x%016I64x"
+#endif
+
 /*** Code. ***/
 
 /* Convert a wide-character string to utf-8. This function will create a buffer
@@ -158,7 +164,7 @@ write_module_info_callback(void *data,
       MINIDUMP_MODULE_CALLBACK module = callback_input->Module;
 
       char *buf = convert_wbcs_to_utf8(module.FullPath);
-      fprintf(log_file, "0x%08x", module.BaseOfImage);
+      fprintf(log_file, FORMAT_PTR, module.BaseOfImage);
       fprintf(log_file, "  %s", buf);
       free(buf);
 
@@ -268,9 +274,9 @@ format_basic_type(char *buf, DWORD basic
             case 2:  /* btChar */
               {
                 if (!IsBadStringPtr(*(PSTR*)address, 32))
-                  sprintf(buf, "\"%.31s\"", *(unsigned long *)address);
+                  sprintf(buf, "\"%.31s\"", *(const char **)address);
                 else
-                  sprintf(buf, "0x%08x", (int)*(unsigned long *)address);
+                  sprintf(buf, FORMAT_PTR, *(DWORD_PTR *)address);
               }
             case 6:  /* btInt */
               sprintf(buf, "%d", *(int *)address);
@@ -279,7 +285,7 @@ format_basic_type(char *buf, DWORD basic
               sprintf(buf, "%f", *(float *)address);
               break;
             default:
-              sprintf(buf, "0x%08x", *(unsigned long *)address);
+              sprintf(buf, FORMAT_PTR, *(DWORD_PTR *)address);
               break;
           }
         break;
@@ -290,7 +296,8 @@ format_basic_type(char *buf, DWORD basic
           sprintf(buf, "0x%016I64X", *(unsigned __int64 *)address);
         break;
       default:
-        sprintf(buf, "[unhandled type 0x%08x of length 0x%08x]", basic_type, length);
+        sprintf(buf, "[unhandled type 0x%08x of length " FORMAT_PTR "]",
+                     basic_type, length);
         break;
     }
 }
@@ -328,14 +335,14 @@ format_value(char *value_str, DWORD64 mo
               LocalFree(type_name_wbcs);
 
               if (ptr == 0)
-                sprintf(value_str, "(%s) 0x%08x",
-                        type_name, (DWORD *)value_addr);
+                sprintf(value_str, "(%s) " FORMAT_PTR,
+                        type_name, (DWORD_PTR *)value_addr);
               else if (ptr == 1)
-                sprintf(value_str, "(%s *) 0x%08x",
-                        type_name, *(DWORD *)value_addr);
+                sprintf(value_str, "(%s *) " FORMAT_PTR,
+                        type_name, *(DWORD_PTR *)value_addr);
               else
-                sprintf(value_str, "(%s **) 0x%08x",
-                        type_name, *(DWORD *)value_addr);
+                sprintf(value_str, "(%s **) " FORMAT_PTR,
+                        type_name, *(DWORD_PTR *)value_addr);
 
               free(type_name);
             }
@@ -352,12 +359,12 @@ format_value(char *value_str, DWORD64 mo
           /* print a char * as a string */
           if (ptr == 1 && length == 1)
             {
-              sprintf(value_str, "0x%08x \"%s\"",
-                      *(DWORD *)value_addr, (char *)*(DWORD*)value_addr);
+              sprintf(value_str, FORMAT_PTR " \"%s\"",
+                      *(DWORD_PTR *)value_addr, *(const char **)value_addr);
             }
           else if (ptr >= 1)
             {
-              sprintf(value_str, "0x%08x", *(DWORD *)value_addr);
+              sprintf(value_str, FORMAT_PTR, *(DWORD_PTR *)value_addr);
             }
           else if (SymGetTypeInfo_(proc, mod_base, type, TI_GET_BASETYPE, &bt))
             {
@@ -366,10 +373,10 @@ format_value(char *value_str, DWORD64 mo
         }
         break;
       case 12: /* SymTagEnum */
-          sprintf(value_str, "%d", *(DWORD *)value_addr);
+          sprintf(value_str, "%d", *(DWORD_PTR *)value_addr);
           break;
       case 13: /* SymTagFunctionType */
-          sprintf(value_str, "0x%08x", *(DWORD *)value_addr);
+          sprintf(value_str, FORMAT_PTR, *(DWORD_PTR *)value_addr);
           break;
       default:
           sprintf(value_str, "[unhandled tag: %d]", tag);

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/adm_files.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/adm_files.c Mon Nov  5 16:30:51 2012
@@ -592,7 +592,7 @@ svn_wc_create_tmp_file2(apr_file_t **fp,
 
   SVN_ERR(svn_wc__db_open(&db,
                           NULL /* config */,
-                          TRUE /* auto_upgrade */,
+                          FALSE /* auto_upgrade */,
                           TRUE /* enforce_empty_wq */,
                           pool, pool));
 

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/adm_ops.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/adm_ops.c Mon Nov  5 16:30:51 2012
@@ -2211,7 +2211,7 @@ svn_wc_get_pristine_copy_path(const char
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
 
-  SVN_ERR(svn_wc__db_open(&db, NULL, TRUE, TRUE, pool, pool));
+  SVN_ERR(svn_wc__db_open(&db, NULL, FALSE, TRUE, pool, pool));
   /* DB is now open. This is seemingly a "light" function that a caller
      may use repeatedly despite error return values. The rest of this
      function should aggressively close DB, even in the error case.  */

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/cleanup.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/cleanup.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/cleanup.c Mon Nov  5 16:30:51 2012
@@ -206,7 +206,7 @@ svn_wc_cleanup3(svn_wc_context_t *wc_ctx
   /* We need a DB that allows a non-empty work queue (though it *will*
      auto-upgrade). We'll handle everything manually.  */
   SVN_ERR(svn_wc__db_open(&db,
-                          NULL /* ### config */, TRUE, FALSE,
+                          NULL /* ### config */, FALSE, FALSE,
                           scratch_pool, scratch_pool));
 
   SVN_ERR(cleanup_internal(db, local_abspath, cancel_func, cancel_baton,

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/context.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/context.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/context.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/context.c Mon Nov  5 16:30:51 2012
@@ -65,10 +65,12 @@ svn_wc_context_create(svn_wc_context_t *
 {
   svn_wc_context_t *ctx = apr_pcalloc(result_pool, sizeof(*ctx));
 
-  /* Create the state_pool, and open up a wc_db in it. */
+  /* Create the state_pool, and open up a wc_db in it.
+   * Since config contains a private mutable member but C doesn't support
+   * we need to make it writable */
   ctx->state_pool = result_pool;
-  SVN_ERR(svn_wc__db_open(&ctx->db, config,
-                          TRUE, TRUE, ctx->state_pool, scratch_pool));
+  SVN_ERR(svn_wc__db_open(&ctx->db, (svn_config_t *)config,
+                          FALSE, TRUE, ctx->state_pool, scratch_pool));
   ctx->close_db_on_destroy = TRUE;
 
   apr_pool_cleanup_register(result_pool, ctx, close_ctx_apr,

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/entries.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/entries.c Mon Nov  5 16:30:51 2012
@@ -1389,10 +1389,10 @@ entries_read_txn(void *baton, svn_sqlite
 }
 
 svn_error_t *
-svn_wc_entries_read(apr_hash_t **entries,
-                    svn_wc_adm_access_t *adm_access,
-                    svn_boolean_t show_hidden,
-                    apr_pool_t *pool)
+svn_wc__entries_read_internal(apr_hash_t **entries,
+                              svn_wc_adm_access_t *adm_access,
+                              svn_boolean_t show_hidden,
+                              apr_pool_t *pool)
 {
   apr_hash_t *new_entries;
 
@@ -1401,7 +1401,7 @@ svn_wc_entries_read(apr_hash_t **entries
     {
       svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
       const char *local_abspath = svn_wc__adm_access_abspath(adm_access);
-      apr_pool_t *result_pool = svn_wc_adm_access_pool(adm_access);
+      apr_pool_t *result_pool = svn_wc__adm_access_pool_internal(adm_access);
       svn_sqlite__db_t *sdb;
       struct entries_read_baton_t erb;
 
@@ -1425,12 +1425,21 @@ svn_wc_entries_read(apr_hash_t **entries
     *entries = new_entries;
   else
     SVN_ERR(prune_deleted(entries, new_entries,
-                          svn_wc_adm_access_pool(adm_access),
+                          svn_wc__adm_access_pool_internal(adm_access),
                           pool));
 
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_wc_entries_read(apr_hash_t **entries,
+                    svn_wc_adm_access_t *adm_access,
+                    svn_boolean_t show_hidden,
+                    apr_pool_t *pool)
+{
+  return svn_error_trace(svn_wc__entries_read_internal(entries, adm_access,
+                                                       show_hidden, pool));
+}
 
 /* No transaction required: called from write_entry which is itself
    transaction-wrapped. */
@@ -2445,7 +2454,8 @@ walker_helper(const char *dirpath,
   svn_error_t *err;
   svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
 
-  err = svn_wc_entries_read(&entries, adm_access, show_hidden, pool);
+  err = svn_wc__entries_read_internal(&entries, adm_access, show_hidden,
+                                      pool);
 
   if (err)
     SVN_ERR(walk_callbacks->handle_error(dirpath, err, walk_baton, pool));

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/entries.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/entries.h?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/entries.h (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/entries.h Mon Nov  5 16:30:51 2012
@@ -148,6 +148,15 @@ svn_wc__serialize_file_external(const ch
                                 const svn_opt_revision_t *rev,
                                 apr_pool_t *pool);
 
+/* Non-deprecated wrapper variant of svn_wc_entries_read used implement
+   legacy API functions. See svn_wc_entries_read for a detailed description.
+ */
+svn_error_t *
+svn_wc__entries_read_internal(apr_hash_t **entries,
+                              svn_wc_adm_access_t *adm_access,
+                              svn_boolean_t show_hidden,
+                              apr_pool_t *pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/lock.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/lock.c Mon Nov  5 16:30:51 2012
@@ -98,7 +98,8 @@ svn_wc__internal_check_wc(int *wc_format
       svn_node_kind_t kind;
 
       if (err->apr_err != SVN_ERR_WC_MISSING &&
-          err->apr_err != SVN_ERR_WC_UNSUPPORTED_FORMAT)
+          err->apr_err != SVN_ERR_WC_UNSUPPORTED_FORMAT &&
+          err->apr_err != SVN_ERR_WC_UPGRADE_REQUIRED)
         return svn_error_trace(err);
       svn_error_clear(err);
 
@@ -331,7 +332,7 @@ pool_cleanup_locked(void *p)
          run, but the subpools will NOT be destroyed)  */
       scratch_pool = svn_pool_create(lock->pool);
 
-      err = svn_wc__db_open(&db, NULL /* ### config. need! */, TRUE, TRUE,
+      err = svn_wc__db_open(&db, NULL /* ### config. need! */, FALSE, TRUE,
                             scratch_pool, scratch_pool);
       if (!err)
         {
@@ -781,7 +782,7 @@ svn_wc_adm_open3(svn_wc_adm_access_t **a
          do it here.  */
       /* ### we could optimize around levels_to_lock==0, but much of this
          ### is going to be simplified soon anyways.  */
-      SVN_ERR(svn_wc__db_open(&db, NULL /* ### config. need! */, TRUE, TRUE,
+      SVN_ERR(svn_wc__db_open(&db, NULL /* ### config. need! */, FALSE, TRUE,
                               pool, pool));
       db_provided = FALSE;
     }
@@ -811,7 +812,7 @@ svn_wc_adm_probe_open3(svn_wc_adm_access
 
       /* Ugh. Too bad about having to open a DB.  */
       SVN_ERR(svn_wc__db_open(&db,
-                              NULL /* ### config */, TRUE, TRUE, pool, pool));
+                              NULL /* ### config */, FALSE, TRUE, pool, pool));
       err = probe(db, &dir, path, pool);
       svn_error_clear(svn_wc__db_close(db));
       SVN_ERR(err);
@@ -1157,7 +1158,7 @@ open_anchor(svn_wc_adm_access_t **anchor
      ### given that we need DB for format detection, may as well keep this.
      ### in any case, much of this is going to be simplified soon anyways.  */
   if (!db_provided)
-    SVN_ERR(svn_wc__db_open(&db, NULL, /* ### config. need! */ TRUE, TRUE,
+    SVN_ERR(svn_wc__db_open(&db, NULL, /* ### config. need! */ FALSE, TRUE,
                             pool, pool));
 
   if (svn_path_is_empty(path)
@@ -1478,6 +1479,11 @@ svn_wc_adm_access_pool(const svn_wc_adm_
   return adm_access->pool;
 }
 
+apr_pool_t *
+svn_wc__adm_access_pool_internal(const svn_wc_adm_access_t *adm_access)
+{
+  return adm_access->pool;
+}
 
 void
 svn_wc__adm_access_set_entries(svn_wc_adm_access_t *adm_access,

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/lock.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/lock.h?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/lock.h (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/lock.h Mon Nov  5 16:30:51 2012
@@ -77,6 +77,13 @@ svn_wc__adm_get_db(const svn_wc_adm_acce
 const char *
 svn_wc__adm_access_abspath(const svn_wc_adm_access_t *adm_access);
 
+/* Return the pool used by access baton ADM_ACCESS.
+ * Note: This is a non-deprecated variant of svn_wc_adm_access_pool for
+ * libsvn_wc internal usage only.
+ */
+apr_pool_t *
+svn_wc__adm_access_pool_internal(const svn_wc_adm_access_t *adm_access);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/old-and-busted.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/old-and-busted.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/old-and-busted.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/old-and-busted.c Mon Nov  5 16:30:51 2012
@@ -1327,7 +1327,7 @@ svn_wc_entry(const svn_wc_entry_t **entr
   /* Load an entries hash, and cache it into DIR_ACCESS. Go ahead and
      fetch all entries here (optimization) since we know how to filter
      out a "hidden" node.  */
-  SVN_ERR(svn_wc_entries_read(&entries, dir_access, TRUE, pool));
+  SVN_ERR(svn_wc__entries_read_internal(&entries, dir_access, TRUE, pool));
   *entry = apr_hash_get(entries, entry_name, APR_HASH_KEY_STRING);
 
   if (!show_hidden && *entry != NULL)

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/upgrade.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/upgrade.c Mon Nov  5 16:30:51 2012
@@ -1892,6 +1892,9 @@ svn_wc__upgrade_sdb(int *result_format,
         *result_format = XXX;
         /* FALLTHROUGH  */
 #endif
+      case SVN_WC__VERSION:
+        /* already upgraded */
+        *result_format = SVN_WC__VERSION;
     }
 
 #ifdef SVN_DEBUG
@@ -2019,7 +2022,7 @@ is_old_wcroot(const char *local_abspath,
     {
       return svn_error_createf(
         SVN_ERR_WC_INVALID_OP_ON_CWD, err,
-        _("Can't upgrade '%s' as it is not a pre-1.7 working copy directory"),
+        _("Can't upgrade '%s' as it is not a working copy"),
         svn_dirent_local_style(local_abspath, scratch_pool));
     }
   else if (svn_dirent_is_root(local_abspath, strlen(local_abspath)))
@@ -2068,7 +2071,7 @@ is_old_wcroot(const char *local_abspath,
 
   return svn_error_createf(
     SVN_ERR_WC_INVALID_OP_ON_CWD, NULL,
-    _("Can't upgrade '%s' as it is not a pre-1.7 working copy root,"
+    _("Can't upgrade '%s' as it is not a working copy root,"
       " the root is '%s'"),
     svn_dirent_local_style(local_abspath, scratch_pool),
     svn_dirent_local_style(parent_abspath, scratch_pool));
@@ -2128,6 +2131,34 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
   apr_hash_t *entries;
   const char *root_adm_abspath;
   upgrade_working_copy_baton_t cb_baton;
+  svn_error_t *err;
+  int result_format;
+
+  /* Try upgrading a wc-ng-style working copy. */
+  SVN_ERR(svn_wc__db_open(&db, NULL /* ### config */, TRUE, FALSE,
+                          scratch_pool, scratch_pool));
+
+  err = svn_wc__db_bump_format(&result_format, local_abspath, db,
+                               scratch_pool);
+  if (err)
+    {
+      if (err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED) /* pre-1.7 WC */
+        {
+          svn_error_clear(err);
+          SVN_ERR(svn_wc__db_close(db));
+        }
+      else
+        return svn_error_trace(err);
+    }
+  else
+    {
+      /* Auto-upgrade worked! */
+      SVN_ERR(svn_wc__db_close(db));
+
+      SVN_ERR_ASSERT(result_format == SVN_WC__VERSION);
+
+      return SVN_NO_ERROR;
+    }
 
   SVN_ERR(is_old_wcroot(local_abspath, scratch_pool));
 
@@ -2141,7 +2172,7 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
      upgrade. */
 
   SVN_ERR(svn_wc__db_open(&db,
-                          NULL /* ### config */, FALSE, FALSE,
+                          NULL /* ### config */, TRUE, FALSE,
                           scratch_pool, scratch_pool));
 
   SVN_ERR(svn_wc__read_entries_old(&entries, local_abspath,

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/util.c?rev=1405866&r1=1405865&r2=1405866&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/util.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/util.c Mon Nov  5 16:30:51 2012
@@ -469,7 +469,7 @@ svn_wc__status2_from_3(svn_wc_status2_t 
   /* (Currently a no-op, but just make sure it is ok) */
   if (old_status->repos_node_status == svn_wc_status_modified
       || old_status->repos_node_status == svn_wc_status_conflicted)
-    (*status)->text_status = old_status->repos_text_status;
+    (*status)->repos_text_status = old_status->repos_text_status;
 
   if (old_status->node_status == svn_wc_status_added)
     (*status)->prop_status = svn_wc_status_none; /* No separate info */



Mime
View raw message