Author: hwright
Date: Tue Jun 12 09:58:12 2012
New Revision: 1349222

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

Modified:
    subversion/branches/ev2-export/   (props changed)
    subversion/branches/ev2-export/configure.ac
    
subversion/branches/ev2-export/subversion/include/private/svn_client_private.h
    subversion/branches/ev2-export/subversion/libsvn_client/merge.c
    subversion/branches/ev2-export/subversion/libsvn_client/status.c
    subversion/branches/ev2-export/subversion/libsvn_ra_neon/merge.c
    subversion/branches/ev2-export/subversion/libsvn_ra_serf/update.c
    subversion/branches/ev2-export/subversion/libsvn_ra_serf/util.c
    subversion/branches/ev2-export/subversion/libsvn_ra_svn/marshal.c
    subversion/branches/ev2-export/subversion/libsvn_repos/replay.c
    subversion/branches/ev2-export/subversion/libsvn_subr/base64.c
    subversion/branches/ev2-export/subversion/libsvn_subr/path.c
    subversion/branches/ev2-export/subversion/libsvn_subr/skel.c
    subversion/branches/ev2-export/subversion/libsvn_subr/stream.c
    subversion/branches/ev2-export/subversion/libsvn_subr/string.c
    subversion/branches/ev2-export/subversion/libsvn_subr/temp_serializer.c
    
subversion/branches/ev2-export/subversion/tests/cmdline/merge_symmetric_tests.py
    subversion/branches/ev2-export/subversion/tests/cmdline/stat_tests.py

Propchange: subversion/branches/ev2-export/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1348783-1349219

Modified: subversion/branches/ev2-export/configure.ac
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/configure.ac?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/configure.ac (original)
+++ subversion/branches/ev2-export/configure.ac Tue Jun 12 09:58:12 2012
@@ -1431,9 +1431,12 @@ if test "$svn_lib_berkeley_db" = "no" &&
 
 
 You don't seem to have Berkeley DB version $db_version or newer
-installed and linked to APR-UTIL.  We have created Makefile which will build
+installed and linked to APR-UTIL.  We have created a Makefile which will build
 Subversion without support for the Berkeley DB back-end.  You can find the
 latest version of Berkeley DB here:
-  http://www.oracle.com/technology/software/products/berkeley-db/index.html
+
+  http://www.oracle.com/technetwork/products/berkeleydb/downloads/index.html
+
+or explicitly specify --without-berkeley-db to silence this warning.
 ])
 fi

Modified: 
subversion/branches/ev2-export/subversion/include/private/svn_client_private.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/include/private/svn_client_private.h?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- 
subversion/branches/ev2-export/subversion/include/private/svn_client_private.h 
(original)
+++ 
subversion/branches/ev2-export/subversion/include/private/svn_client_private.h 
Tue Jun 12 09:58:12 2012
@@ -180,9 +180,7 @@ svn_client__wc_node_get_origin(svn_clien
 
 /* A macro to mark sections of code that belong to the 'symmetric merge'
  * feature while it's still new. */
-#ifdef SVN_DEBUG
 #define SVN_WITH_SYMMETRIC_MERGE
-#endif
 
 #ifdef SVN_WITH_SYMMETRIC_MERGE
 

Modified: subversion/branches/ev2-export/subversion/libsvn_client/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/merge.c?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/merge.c Tue Jun 12 
09:58:12 2012
@@ -11462,9 +11462,6 @@ find_symmetric_merge(svn_client__pathrev
   SVN_ERR(find_base_on_target(&base_on_target, &mid, s_t,
                               ctx, scratch_pool, scratch_pool));
 
-  SVN_DBG(("base on source: %s@%ld\n", base_on_source->url, 
base_on_source->rev));
-  SVN_DBG(("base on target: %s@%ld\n", base_on_target->url, 
base_on_target->rev));
-
   /* Choose a base. */
   if (base_on_source->rev >= base_on_target->rev)
     {
@@ -11568,11 +11565,6 @@ do_symmetric_merge_locked(const svn_clie
   source.loc1 = merge->base;
   source.loc2 = merge->right;
   source.ancestral = (merge->mid == NULL);
-  SVN_DBG(("yca   %s@%ld\n", merge->yca->url, merge->yca->rev));
-  SVN_DBG(("base  %s@%ld\n", merge->base->url, merge->base->rev));
-  if (merge->mid)
-    SVN_DBG(("mid   %s@%ld\n", merge->mid->url, merge->mid->rev));
-  SVN_DBG(("right %s@%ld\n", merge->right->url, merge->right->rev));
 
   if (merge->mid)
     {

Modified: subversion/branches/ev2-export/subversion/libsvn_client/status.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/status.c?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/status.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/status.c Tue Jun 12 
09:58:12 2012
@@ -298,39 +298,44 @@ svn_client_status5(svn_revnum_t *result_
       /* The status editor only works on directories, so get the ancestor
          if necessary */
 
-     svn_node_kind_t kind;
-
-     SVN_ERR(svn_wc_read_kind(&kind, ctx->wc_ctx, target_abspath, FALSE,
-                              pool));
-
-     /* Dir must be a working copy directory or the status editor fails */
-     if (kind == svn_node_dir)
-       {
-         dir_abspath = target_abspath;
-         target_basename = "";
-         dir = path;
-       }
-     else
-       {
-         dir_abspath = svn_dirent_dirname(target_abspath, pool);
-         target_basename = svn_dirent_basename(target_abspath, NULL);
-         dir = svn_dirent_dirname(path, pool);
-
-         if (kind != svn_node_file)
-           {
-             err = svn_wc_read_kind(&kind, ctx->wc_ctx, dir_abspath, FALSE,
-                                    pool);
-
-             svn_error_clear(err);
-
-             if (err || kind != svn_node_dir)
-               {
-                 return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
-                                          _("'%s' is not a working copy"),
-                                          svn_dirent_local_style(path, pool));
-               }
-           }
-       }
+      svn_node_kind_t kind;
+ 
+      SVN_ERR(svn_wc_read_kind(&kind, ctx->wc_ctx, target_abspath, FALSE,
+                               pool));
+ 
+      /* Dir must be a working copy directory or the status editor fails */
+      if (kind == svn_node_dir)
+        {
+          dir_abspath = target_abspath;
+          target_basename = "";
+          dir = path;
+        }
+      else
+        {
+          dir_abspath = svn_dirent_dirname(target_abspath, pool);
+          target_basename = svn_dirent_basename(target_abspath, NULL);
+          dir = svn_dirent_dirname(path, pool);
+ 
+          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);
+ 
+              svn_error_clear(err);
+ 
+              if (err || kind != svn_node_dir)
+                {
+                  return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
+                                           _("'%s' is not a working copy"),
+                                           svn_dirent_local_style(path, pool));
+                }
+            }
+        }
     }
   else
     {

Modified: subversion/branches/ev2-export/subversion/libsvn_ra_neon/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_ra_neon/merge.c?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_ra_neon/merge.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_ra_neon/merge.c Tue Jun 12 
09:58:12 2012
@@ -627,7 +627,7 @@ svn_error_t * svn_ra_neon__assemble_lock
 
   buf_size += SVN_LEN(SVN_LOCK_TOKEN_LIST_CLOSE);
 
-  svn_stringbuf_ensure(lockbuf, buf_size + 1);
+  svn_stringbuf_ensure(lockbuf, buf_size);
 
   /* Now append all the temporary hash's keys and values into the
      stringbuf.  This is better than doing apr_pstrcat() in a loop,

Modified: subversion/branches/ev2-export/subversion/libsvn_ra_serf/update.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_ra_serf/update.c?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_ra_serf/update.c Tue Jun 
12 09:58:12 2012
@@ -220,7 +220,7 @@ typedef struct report_info_t
   /* controlling file_baton and textdelta handler */
   void *file_baton;
   const char *base_checksum;
-  const char *final_sha1_checksum; /* ### currently unused */
+  const char *final_sha1_checksum;
   svn_txdelta_window_handler_t textdelta;
   void *textdelta_baton;
 

Modified: subversion/branches/ev2-export/subversion/libsvn_ra_serf/util.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_ra_serf/util.c?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_ra_serf/util.c Tue Jun 12 
09:58:12 2012
@@ -1216,7 +1216,7 @@ start_xml(void *userData, const char *ra
   svn_ra_serf__expand_ns(&name, parser->state->ns_list, raw_name);
 
   err = parser->start(parser, name, attrs, scratch_pool);
-  if (err && APR_STATUS_IS_EOF(err->apr_err))
+  if (err && !SERF_BUCKET_READ_ERROR(err->apr_err))
     err = svn_error_create(SVN_ERR_RA_SERF_WRAPPED_ERROR, err, NULL);
 
   parser->error = err;
@@ -1241,7 +1241,7 @@ end_xml(void *userData, const char *raw_
   svn_ra_serf__expand_ns(&name, parser->state->ns_list, raw_name);
 
   err = parser->end(parser, name, scratch_pool);
-  if (err && APR_STATUS_IS_EOF(err->apr_err))
+  if (err && !SERF_BUCKET_READ_ERROR(err->apr_err))
     err = svn_error_create(SVN_ERR_RA_SERF_WRAPPED_ERROR, err, NULL);
 
   parser->error = err;
@@ -1266,7 +1266,7 @@ cdata_xml(void *userData, const char *da
   scratch_pool = parser->state->pool;
 
   err = parser->cdata(parser, data, len, scratch_pool);
-  if (err && APR_STATUS_IS_EOF(err->apr_err))
+  if (err && !SERF_BUCKET_READ_ERROR(err->apr_err))
     err = svn_error_create(SVN_ERR_RA_SERF_WRAPPED_ERROR, err, NULL);
 
   parser->error = err;

Modified: subversion/branches/ev2-export/subversion/libsvn_ra_svn/marshal.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_ra_svn/marshal.c?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_ra_svn/marshal.c Tue Jun 
12 09:58:12 2012
@@ -699,7 +699,7 @@ static svn_error_t *read_string(svn_ra_s
               ? len
               : SUSPICIOUSLY_HUGE_STRING_SIZE_THRESHOLD;
 
-      svn_stringbuf_ensure(stringbuf, stringbuf->len + readbuf_len + 1);
+      svn_stringbuf_ensure(stringbuf, stringbuf->len + readbuf_len);
       dest = stringbuf->data + stringbuf->len;
     }
 

Modified: subversion/branches/ev2-export/subversion/libsvn_repos/replay.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_repos/replay.c?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_repos/replay.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_repos/replay.c Tue Jun 12 
09:58:12 2012
@@ -36,6 +36,7 @@
 #include "svn_private_config.h"
 #include "private/svn_fspath.h"
 #include "private/svn_repos_private.h"
+#include "private/svn_delta_private.h"
 
 
 /*** Backstory ***/
@@ -137,7 +138,6 @@ struct path_driver_cb_baton
   void *authz_read_baton;
 
   const char *base_path; /* relpath */
-  size_t base_path_len;
 
   svn_revnum_t low_water_mark;
   /* Stack of active copy operations. */
@@ -339,20 +339,6 @@ add_subdir(svn_fs_root_t *source_root,
   return SVN_NO_ERROR;
 }
 
-static svn_boolean_t
-is_within_base_path(const char *path, const char *base_path,
-                    apr_ssize_t base_len)
-{
-  if (base_path[0] == '\0')
-    return TRUE;
-
-  if (strncmp(base_path, path, base_len) == 0
-      && (path[base_len] == '/' || path[base_len] == '\0'))
-    return TRUE;
-
-  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. */
@@ -487,7 +473,6 @@ path_driver_cb_func(void **dir_baton,
   svn_fs_root_t *source_root = cb->compare_root;
   const char *source_fspath = NULL;
   const char *base_path = cb->base_path;
-  size_t base_path_len = cb->base_path_len;
 
   *dir_baton = NULL;
 
@@ -577,8 +562,7 @@ path_driver_cb_func(void **dir_baton,
          all. */
       if (copyfrom_path
           && ((! src_readable)
-              || (! is_within_base_path(copyfrom_path + 1, base_path,
-                                        base_path_len))
+              || (svn_relpath_skip_ancestor(base_path, copyfrom_path + 1) == 
NULL)
               || (cb->low_water_mark > copyfrom_rev)))
         {
           copyfrom_path = NULL;
@@ -808,12 +792,12 @@ svn_repos_replay2(svn_fs_root_t *root,
                   void *authz_read_baton,
                   apr_pool_t *pool)
 {
+#if 1
   apr_hash_t *fs_changes;
   apr_hash_t *changed_paths;
   apr_hash_index_t *hi;
   apr_array_header_t *paths;
   struct path_driver_cb_baton cb_baton;
-  size_t base_path_len;
 
   /* Special-case r0, which we know is an empty revision; if we don't
      special-case it we might end up trying to compare it to "r-1". */
@@ -831,8 +815,6 @@ svn_repos_replay2(svn_fs_root_t *root,
   else if (base_path[0] == '/')
     ++base_path;
 
-  base_path_len = strlen(base_path);
-
   /* Make an array from the keys of our CHANGED_PATHS hash, and copy
      the values into a new hash whose keys have no leading slashes. */
   paths = apr_array_make(pool, apr_hash_count(fs_changes),
@@ -865,14 +847,14 @@ svn_repos_replay2(svn_fs_root_t *root,
 
           /* If the base_path doesn't match the top directory of this path
              we don't want anything to do with it... */
-          if (is_within_base_path(path, base_path, base_path_len))
+          if (svn_relpath_skip_ancestor(base_path, path) != NULL)
             {
               APR_ARRAY_PUSH(paths, const char *) = path;
               apr_hash_set(changed_paths, path, keylen, change);
             }
           /* ...unless this was a change to one of the parent directories of
              base_path. */
-          else if (is_within_base_path(base_path, path, keylen))
+          else if (svn_relpath_skip_ancestor(path, base_path) != NULL)
             {
               APR_ARRAY_PUSH(paths, const char *) = path;
               apr_hash_set(changed_paths, path, keylen, change);
@@ -893,7 +875,6 @@ svn_repos_replay2(svn_fs_root_t *root,
   cb_baton.authz_read_func = authz_read_func;
   cb_baton.authz_read_baton = authz_read_baton;
   cb_baton.base_path = base_path;
-  cb_baton.base_path_len = base_path_len;
   cb_baton.low_water_mark = low_water_mark;
   cb_baton.compare_root = NULL;
 
@@ -922,11 +903,72 @@ svn_repos_replay2(svn_fs_root_t *root,
   return svn_delta_path_driver(editor, edit_baton,
                                SVN_INVALID_REVNUM, paths,
                                path_driver_cb_func, &cb_baton, pool);
+#else
+  svn_editor_t *editorv2;
+  struct svn_delta__extra_baton *exb;
+  svn_delta__unlock_func_t unlock_func;
+  svn_boolean_t send_abs_paths;
+  const char *repos_root = "";
+  void *unlock_baton;
+
+  /* Special-case r0, which we know is an empty revision; if we don't
+     special-case it we might end up trying to compare it to "r-1". */
+  if (svn_fs_is_revision_root(root)
+        && svn_fs_revision_root_revision(root) == 0)
+    {
+      SVN_ERR(editor->set_target_revision(edit_baton, 0, pool));
+      return SVN_NO_ERROR;
+    }
+
+  /* Determine the revision to use throughout the edit, and call
+     EDITOR's set_target_revision() function.  */
+  if (svn_fs_is_revision_root(root))
+    {
+      svn_revnum_t revision = svn_fs_revision_root_revision(root);
+      SVN_ERR(editor->set_target_revision(edit_baton, revision, pool));
+    }
+
+  if (! base_path)
+    base_path = "";
+  else if (base_path[0] == '/')
+    ++base_path;
+
+  /* Use the shim to convert our editor to an Ev2 editor, and pass it down
+     the stack. */
+  SVN_ERR(svn_delta__editor_from_delta(&editorv2, &exb,
+                                       &unlock_func, &unlock_baton,
+                                       editor, edit_baton,
+                                       &send_abs_paths,
+                                       repos_root, "",
+                                       NULL, NULL,
+                                       NULL, NULL,
+                                       NULL, NULL,
+                                       pool, pool));
+
+  SVN_ERR(svn_repos__replay_ev2(root, base_path, low_water_mark, send_deltas,
+                                editorv2, authz_read_func, authz_read_baton,
+                                pool));
+
+  return SVN_NO_ERROR;
+#endif
+}
+
+
+/*****************************************************************
+ *                      Ev2 Implementation                       *
+ *****************************************************************/
+
+static svn_error_t *
+replay_node(const char *repos_relpath,
+            svn_editor_t *editor,
+            apr_pool_t *scratch_pool)
+{
+  SVN__NOT_IMPLEMENTED();
 }
 
 svn_error_t *
 svn_repos__replay_ev2(svn_fs_root_t *root,
-                      const char *base_dir,
+                      const char *base_repos_relpath,
                       svn_revnum_t low_water_mark,
                       svn_boolean_t send_deltas,
                       svn_editor_t *editor,
@@ -934,5 +976,103 @@ svn_repos__replay_ev2(svn_fs_root_t *roo
                       void *authz_read_baton,
                       apr_pool_t *scratch_pool)
 {
-  SVN__NOT_IMPLEMENTED();
+  apr_hash_t *fs_changes;
+  apr_hash_t *changed_paths;
+  apr_hash_index_t *hi;
+  apr_array_header_t *paths;
+  svn_fs_root_t *compare_root;
+  apr_array_header_t *copies;
+  apr_pool_t *iterpool;
+  int i;
+
+  SVN_ERR_ASSERT(!svn_dirent_is_absolute(base_repos_relpath));
+
+  /* Special-case r0, which we know is an empty revision; if we don't
+     special-case it we might end up trying to compare it to "r-1". */
+  if (svn_fs_is_revision_root(root)
+        && svn_fs_revision_root_revision(root) == 0)
+    {
+      return SVN_NO_ERROR;
+    }
+
+  /* Fetch the paths changed under ROOT. */
+  SVN_ERR(svn_fs_paths_changed2(&fs_changes, root, scratch_pool));
+
+  /* Make an array from the keys of our CHANGED_PATHS hash, and copy
+     the values into a new hash whose keys have no leading slashes. */
+  paths = apr_array_make(scratch_pool, apr_hash_count(fs_changes),
+                         sizeof(const char *));
+  changed_paths = apr_hash_make(scratch_pool);
+  for (hi = apr_hash_first(scratch_pool, fs_changes); hi;
+        hi = apr_hash_next(hi))
+    {
+      const void *key;
+      void *val;
+      apr_ssize_t keylen;
+      const char *path;
+      svn_fs_path_change2_t *change;
+      svn_boolean_t allowed = TRUE;
+
+      apr_hash_this(hi, &key, &keylen, &val);
+      path = key;
+      change = val;
+
+      if (authz_read_func)
+        SVN_ERR(authz_read_func(&allowed, root, path, authz_read_baton,
+                                scratch_pool));
+
+      if (allowed)
+        {
+          if (path[0] == '/')
+            {
+              path++;
+              keylen--;
+            }
+
+          /* If the base_path doesn't match the top directory of this path
+             we don't want anything to do with it... */
+          if (svn_relpath_skip_ancestor(base_repos_relpath, path) != NULL)
+            {
+              APR_ARRAY_PUSH(paths, const char *) = path;
+              apr_hash_set(changed_paths, path, keylen, change);
+            }
+          /* ...unless this was a change to one of the parent directories of
+             base_path. */
+          else if (svn_relpath_skip_ancestor(path, base_repos_relpath) != NULL)
+            {
+              APR_ARRAY_PUSH(paths, const char *) = path;
+              apr_hash_set(changed_paths, path, keylen, change);
+            }
+        }
+    }
+
+  /* If we were not given a low water mark, assume that everything is there,
+     all the way back to revision 0. */
+  if (! SVN_IS_VALID_REVNUM(low_water_mark))
+    low_water_mark = 0;
+
+  if (send_deltas)
+    {
+      SVN_ERR(svn_fs_revision_root(&compare_root,
+                                   svn_fs_root_fs(root),
+                                   svn_fs_is_revision_root(root)
+                                     ? svn_fs_revision_root_revision(root) - 1
+                                     : svn_fs_txn_root_base_revision(root),
+                                   scratch_pool));
+    }
+  else
+    compare_root = NULL;
+
+  copies = apr_array_make(scratch_pool, 4, sizeof(struct copy_info *));
+
+  /* Now actually handle the various paths. */
+  iterpool = svn_pool_create(scratch_pool);
+  for (i = 0; i < paths->nelts; i++)
+    {
+      const char *repos_relpath = APR_ARRAY_IDX(paths, i, const char *);
+      SVN_ERR(replay_node(repos_relpath, editor, iterpool));
+    }
+
+  svn_pool_destroy(iterpool);
+  return SVN_NO_ERROR;
 }

Modified: subversion/branches/ev2-export/subversion/libsvn_subr/base64.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/base64.c?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/base64.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/base64.c Tue Jun 12 
09:58:12 2012
@@ -415,9 +415,9 @@ decode_bytes(svn_stringbuf_t *str, const
      (*inbuflen+len) is encoded data length
      (*inbuflen+len)/4 is the number of complete 4-bytes sets
      (*inbuflen+len)/4*3 is the number of decoded bytes
-     (*inbuflen+len)/4*3+1 is the number of decoded bytes plus a null
+     svn_stringbuf_ensure will add an additional byte for the terminating 0.
   */
-  svn_stringbuf_ensure(str, str->len + ((*inbuflen + len) / 4) * 3 + 1);
+  svn_stringbuf_ensure(str, str->len + ((*inbuflen + len) / 4) * 3);
 
   while ( !*done && p < end )
     {

Modified: subversion/branches/ev2-export/subversion/libsvn_subr/path.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/path.c?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/path.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/path.c Tue Jun 12 
09:58:12 2012
@@ -1168,8 +1168,8 @@ illegal_path_escape(const char *path, ap
         svn_stringbuf_appendbytes(retstr, path + copied,
                                   i - copied);
 
-      /* Make sure buffer is big enough for '\' 'N' 'N' 'N' null */
-      svn_stringbuf_ensure(retstr, retstr->len + 5);
+      /* Make sure buffer is big enough for '\' 'N' 'N' 'N' (and NUL) */
+      svn_stringbuf_ensure(retstr, retstr->len + 4);
       /*### The backslash separator doesn't work too great with Windows,
          but it's what we'll use for consistency with invalid utf8
          formatting (until someone has a better idea) */

Modified: subversion/branches/ev2-export/subversion/libsvn_subr/skel.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/skel.c?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/skel.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/skel.c Tue Jun 12 
09:58:12 2012
@@ -501,7 +501,7 @@ unparse(const svn_skel_t *skel, svn_stri
 
           /* Make sure we have room for the length, the space, and the
              atom's contents.  */
-          svn_stringbuf_ensure(str, str->len + length_len + 1 + skel->len + 1);
+          svn_stringbuf_ensure(str, str->len + length_len + 1 + skel->len);
           svn_stringbuf_appendbytes(str, buf, length_len);
           svn_stringbuf_appendbyte(str, ' ');
           svn_stringbuf_appendbytes(str, skel->data, skel->len);

Modified: subversion/branches/ev2-export/subversion/libsvn_subr/stream.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/stream.c?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/stream.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/stream.c Tue Jun 12 
09:58:12 2012
@@ -380,7 +380,7 @@ stream_readline_chunky(svn_stringbuf_t *
       {
         /* Append the next chunk to the string read so far.
          */
-        svn_stringbuf_ensure(str, str->len + LINE_CHUNK_SIZE + 1);
+        svn_stringbuf_ensure(str, str->len + LINE_CHUNK_SIZE);
         numbytes = LINE_CHUNK_SIZE;
         SVN_ERR(svn_stream_read(stream, str->data + str->len, &numbytes));
         str->len += numbytes;

Modified: subversion/branches/ev2-export/subversion/libsvn_subr/string.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/string.c?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/string.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/string.c Tue Jun 12 
09:58:12 2012
@@ -1,6 +1,6 @@
 /*
- * svn_string.c:  routines to manipulate counted-length strings
- *                (svn_stringbuf_t and svn_string_t) and C strings.
+ * string.c:  routines to manipulate counted-length strings
+ *            (svn_stringbuf_t and svn_string_t) and C strings.
  *
  *
  * ====================================================================
@@ -407,7 +407,7 @@ svn_stringbuf_set(svn_stringbuf_t *str, 
 {
   apr_size_t amt = strlen(value);
 
-  svn_stringbuf_ensure(str, amt + 1);
+  svn_stringbuf_ensure(str, amt);
   memcpy(str->data, value, amt + 1);
   str->len = amt;
 }
@@ -549,8 +549,8 @@ svn_stringbuf_appendbytes(svn_stringbuf_
 
   total_len = str->len + count;  /* total size needed */
 
-  /* +1 for null terminator. */
-  svn_stringbuf_ensure(str, (total_len + 1));
+  /* svn_stringbuf_ensure adds 1 for null terminator. */
+  svn_stringbuf_ensure(str, total_len);
 
   /* get address 1 byte beyond end of original bytestring */
   start_address = (str->data + str->len);

Modified: 
subversion/branches/ev2-export/subversion/libsvn_subr/temp_serializer.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/temp_serializer.c?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/temp_serializer.c 
(original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/temp_serializer.c Tue 
Jun 12 09:58:12 2012
@@ -72,7 +72,7 @@ struct svn_temp_serializer__context_t
   source_stack_t *source;
 };
 
-/* Mmake sure the serialized data len is a multiple of the default alignment,
+/* Make sure the serialized data len is a multiple of the default alignment,
  * i.e. structures may be appended without violating member alignment
  * guarantees.
  */
@@ -83,7 +83,7 @@ align_buffer_end(svn_temp_serializer__co
   apr_size_t aligned_len = APR_ALIGN_DEFAULT(current_len);
   if (aligned_len != current_len)
     {
-      svn_stringbuf_ensure(context->buffer, aligned_len+1);
+      svn_stringbuf_ensure(context->buffer, aligned_len);
       context->buffer->len = aligned_len;
     }
 }

Modified: 
subversion/branches/ev2-export/subversion/tests/cmdline/merge_symmetric_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/merge_symmetric_tests.py?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- 
subversion/branches/ev2-export/subversion/tests/cmdline/merge_symmetric_tests.py
 (original)
+++ 
subversion/branches/ev2-export/subversion/tests/cmdline/merge_symmetric_tests.py
 Tue Jun 12 09:58:12 2012
@@ -481,7 +481,6 @@ def merge_twice_same_direction_2(sbox):
 #   Merge to and fro
 
 @SkipUnless(server_has_mergeinfo)
-@Wimp("needs SVN_WITH_SYMMETRIC_MERGE")
 def merge_to_and_fro_1_1(sbox):
   """merge_to_and_fro_1_1"""
 
@@ -498,7 +497,6 @@ def merge_to_and_fro_1_1(sbox):
                   expect_3ways=[three_way_merge('A4', 'B7')])
 
 @SkipUnless(server_has_mergeinfo)
-@Wimp("needs SVN_WITH_SYMMETRIC_MERGE")
 def merge_to_and_fro_1_2(sbox):
   """merge_to_and_fro_1_2"""
 
@@ -542,7 +540,6 @@ def init_merge_to_and_fro_2(sbox, mod_9,
     no_op_commit(sbox)  # r10
 
 @SkipUnless(server_has_mergeinfo)
-@Wimp("needs SVN_WITH_SYMMETRIC_MERGE")
 def merge_to_and_fro_2_1(sbox):
   """merge_to_and_fro_2_1"""
 
@@ -559,7 +556,6 @@ def merge_to_and_fro_2_1(sbox):
                   expect_3ways=[three_way_merge('A7', 'B10')])
 
 @SkipUnless(server_has_mergeinfo)
-@Wimp("needs SVN_WITH_SYMMETRIC_MERGE")
 def merge_to_and_fro_2_2(sbox):
   """merge_to_and_fro_2_2"""
 
@@ -603,7 +599,6 @@ def init_merge_to_and_fro_3(sbox, mod_9,
     no_op_commit(sbox)  # r10
 
 @SkipUnless(server_has_mergeinfo)
-@Wimp("needs SVN_WITH_SYMMETRIC_MERGE")
 def merge_to_and_fro_3_1(sbox):
   """merge_to_and_fro_3_1"""
 
@@ -620,7 +615,6 @@ def merge_to_and_fro_3_1(sbox):
                   expect_3ways=[three_way_merge_no_op('B7', 'B10')])
 
 @SkipUnless(server_has_mergeinfo)
-@Wimp("needs SVN_WITH_SYMMETRIC_MERGE")
 def merge_to_and_fro_3_2(sbox):
   """merge_to_and_fro_3_2"""
 
@@ -637,7 +631,6 @@ def merge_to_and_fro_3_2(sbox):
                   expect_3ways=[three_way_merge('B7', 'B10')])
 
 @SkipUnless(server_has_mergeinfo)
-@Wimp("needs SVN_WITH_SYMMETRIC_MERGE")
 def merge_to_and_fro_4_1(sbox):
   """merge_to_and_fro_4_1"""
 
@@ -654,7 +647,6 @@ def merge_to_and_fro_4_1(sbox):
                   expect_3ways=[three_way_merge_no_op('B7', 'A10')])
 
 @SkipUnless(server_has_mergeinfo)
-@Wimp("needs SVN_WITH_SYMMETRIC_MERGE")
 def merge_to_and_fro_4_2(sbox):
   """merge_to_and_fro_4_2"""
 

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/stat_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/stat_tests.py?rev=1349222&r1=1349221&r2=1349222&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/stat_tests.py 
(original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/stat_tests.py Tue 
Jun 12 09:58:12 2012
@@ -1567,6 +1567,82 @@ def status_depth_update(sbox):
 
 
 #----------------------------------------------------------------------
+def status_depth_update_local_modifications(sbox):
+  "run 'status --depth=X -u' with local changes"
+  
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  A_path = sbox.ospath('A')
+  D_path = os.path.join(A_path, 'D')
+
+  mu_path = os.path.join(A_path, 'mu')
+  gamma_path = os.path.join(D_path, 'gamma')
+
+  svntest.main.run_svn(None, 'propset', 'svn:test', 'value', A_path)
+  svntest.main.run_svn(None, 'propset', 'svn:test', 'value', D_path)
+
+  svntest.main.file_append(mu_path, 'modified')
+  svntest.main.file_append(gamma_path, 'modified')
+
+  # depth=empty
+  expected = svntest.verify.UnorderedOutput(
+                  [" M               1   %s\n" % A_path,
+                   "Status against revision:      1\n"])
+
+  svntest.actions.run_and_verify_svn(None,
+                                     expected,
+                                     [],
+                                     "status", "-u", "--depth=empty", A_path)
+
+  expected = svntest.verify.UnorderedOutput(
+                  ["M                1   %s\n" % mu_path,
+                   "Status against revision:      1\n"])
+
+  svntest.actions.run_and_verify_svn(None,
+                                     expected,
+                                     [],
+                                     "status", "-u", "--depth=empty", mu_path)
+
+  # depth=files
+  expected = svntest.verify.UnorderedOutput(
+                  ["M                1   %s\n" % mu_path,
+                   " M               1   %s\n" % A_path,
+                   "Status against revision:      1\n"])
+
+  svntest.actions.run_and_verify_svn(None,
+                                     expected,
+                                     [],
+                                     "status", "-u", "--depth=files",
+                                     A_path)
+
+  # depth=immediates
+  expected = svntest.verify.UnorderedOutput(
+                  [" M               1   %s\n" % A_path,
+                   " M               1   %s\n" % D_path,
+                   "M                1   %s\n" % mu_path,
+                   "Status against revision:      1\n"])
+
+  svntest.actions.run_and_verify_svn(None,
+                                     expected,
+                                     [],
+                                     "status", "-u", "--depth=immediates",
+                                     A_path)
+
+  # depth=infinity (the default)
+  expected = svntest.verify.UnorderedOutput(
+                  [" M               1   %s\n" % A_path,
+                   " M               1   %s\n" % D_path,
+                   "M                1   %s\n" % mu_path,
+                   "M                1   %s\n" % gamma_path,
+                   "Status against revision:      1\n"])
+
+  svntest.actions.run_and_verify_svn(None,
+                                     expected,
+                                     [],
+                                     "status", "-u", "--depth=infinity",
+                                     A_path)
+
+#----------------------------------------------------------------------
 # Test for issue #2420
 @Issue(2420)
 def status_dash_u_deleted_directories(sbox):
@@ -1995,6 +2071,7 @@ test_list = [ None,
               status_dash_u_deleted_directories,
               status_depth_local,
               status_depth_update,
+              status_depth_update_local_modifications,
               status_dash_u_type_change,
               status_with_tree_conflicts,
               status_nested_wc_old_format,


Reply via email to