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

svn commit: r1367002 [12/21] - in /subversion/branches/svn-bisect: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ contrib/client-side/emacs/ contrib/server-side/mod_dontdothat/ notes/ notes/api-errata/1.7/ notes/http-and-webdav/...

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/dirent_uri.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/dirent_uri.c Mon Jul 30 06:39:28 2012
@@ -1295,25 +1295,17 @@ svn_uri_basename(const char *uri, apr_po
 {
   apr_size_t len = strlen(uri);
   apr_size_t start;
-  const char *base_name;
 
   assert(svn_uri_is_canonical(uri, NULL));
 
   if (svn_uri_is_root(uri, len))
     return "";
-  else
-    {
-      start = len;
-      while (start > 0 && uri[start - 1] != '/')
-        --start;
-    }
 
-  if (pool)
-    base_name = apr_pstrmemdup(pool, uri + start, len - start);
-  else
-    base_name = uri + start;
+  start = len;
+  while (start > 0 && uri[start - 1] != '/')
+    --start;
 
-  return svn_path_uri_decode(base_name, pool);
+  return svn_path_uri_decode(uri + start, pool);
 }
 
 void
@@ -2382,10 +2374,10 @@ svn_uri_get_file_url_from_dirent(const c
 #else
   if (dirent[0] == '/')
     {
-      /* Handle UNC paths */
-      assert(dirent[1] != '/'); /* Not absolute! */
+      /* Handle UNC paths //server/share -> file://server/share */
+      assert(dirent[1] == '/'); /* Expect UNC, not non-absolute */
 
-      *url = apr_pstrcat(pool, "file://", dirent+1, NULL);
+      *url = apr_pstrcat(pool, "file:", dirent, NULL);
     }
   else
     *url = apr_pstrcat(pool, "file:///", dirent, NULL);

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/error.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/error.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/error.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/error.c Mon Jul 30 06:39:28 2012
@@ -28,6 +28,8 @@
 #include <apr_pools.h>
 #include <apr_strings.h>
 
+#include <zlib.h>
+
 #include "svn_cmdline.h"
 #include "svn_error.h"
 #include "svn_pools.h"
@@ -673,3 +675,52 @@ svn_error__malfunction(svn_boolean_t can
 {
   return malfunction_handler(can_return, file, line, expr);
 }
+
+svn_error_t *
+svn_error__wrap_zlib(int zerr, const char *function, const char *message)
+{
+  apr_status_t status;
+  const char *zmsg;
+
+  if (zerr == Z_OK)
+    return SVN_NO_ERROR;
+
+  switch (zerr)
+    {
+    case Z_STREAM_ERROR:
+      status = SVN_ERR_STREAM_MALFORMED_DATA;
+      zmsg = _("stream error");
+      break;
+
+    case Z_MEM_ERROR:
+      status = APR_ENOMEM;
+      zmsg = _("out of memory");
+      break;
+
+    case Z_BUF_ERROR:
+      status = APR_ENOMEM;
+      zmsg = _("buffer error");
+      break;
+
+    case Z_VERSION_ERROR:
+      status = SVN_ERR_STREAM_UNRECOGNIZED_DATA;
+      zmsg = _("version error");
+      break;
+
+    case Z_DATA_ERROR:
+      status = SVN_ERR_STREAM_MALFORMED_DATA;
+      zmsg = _("corrupt data");
+      break;
+
+    default:
+      status = SVN_ERR_STREAM_UNRECOGNIZED_DATA;
+      zmsg = _("unknown error");
+      break;
+    }
+
+  if (message != NULL)
+    return svn_error_createf(status, NULL, "zlib (%s): %s: %s", function,
+                             zmsg, message);
+  else
+    return svn_error_createf(status, NULL, "zlib (%s): %s", function, zmsg);
+}

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/gpg_agent.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/gpg_agent.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/gpg_agent.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/gpg_agent.c Mon Jul 30 06:39:28 2012
@@ -154,8 +154,9 @@ send_option(int sd, char *buf, size_t n,
 
 /* Implementation of svn_auth__password_get_t that retrieves the password
    from gpg-agent */
-static svn_boolean_t
-password_get_gpg_agent(const char **password,
+static svn_error_t *
+password_get_gpg_agent(svn_boolean_t *done,
+                       const char **password,
                        apr_hash_t *creds,
                        const char *realmstring,
                        const char *username,
@@ -182,6 +183,8 @@ password_get_gpg_agent(const char **pass
   char *password_prompt;
   char *realm_prompt;
 
+  *done = FALSE;
+
   gpg_agent_info = getenv("GPG_AGENT_INFO");
   if (gpg_agent_info != NULL)
     {
@@ -190,7 +193,7 @@ password_get_gpg_agent(const char **pass
       socket_name = APR_ARRAY_IDX(socket_details, 0, const char *);
     }
   else
-    return FALSE;
+    return SVN_NO_ERROR;
 
   if (socket_name != NULL)
     {
@@ -200,29 +203,29 @@ password_get_gpg_agent(const char **pass
 
       sd = socket(AF_UNIX, SOCK_STREAM, 0);
       if (sd == -1)
-        return FALSE;
+        return SVN_NO_ERROR;
     
       if (connect(sd, (struct sockaddr *)&addr, sizeof(addr)) == -1)
         {
           close(sd);
-          return FALSE;
+          return SVN_NO_ERROR;
         }
     }
   else
-    return FALSE;
+    return SVN_NO_ERROR;
 
   /* Receive the connection status from the gpg-agent daemon. */
   buffer = apr_palloc(pool, BUFFER_SIZE);
   if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE))
     {
       close(sd);
-      return FALSE;
+      return SVN_NO_ERROR;
     }
 
   if (strncmp(buffer, "OK", 2) != 0)
     {
       close(sd);
-      return FALSE;
+      return SVN_NO_ERROR;
     }
 
   /* The GPG-Agent documentation says:
@@ -232,19 +235,19 @@ password_get_gpg_agent(const char **pass
   if (write(sd, request, strlen(request)) == -1)
     {
       close(sd);
-      return FALSE;
+      return SVN_NO_ERROR;
     }
   if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE))
     {
       close(sd);
-      return FALSE;
+      return SVN_NO_ERROR;
     }
   if (strncmp(buffer, "D", 1) == 0)
     p = &buffer[2];
   if (!p)
     {
       close(sd);
-      return FALSE;
+      return SVN_NO_ERROR;
     }
   ep = strchr(p, '\n');
   if (ep != NULL)
@@ -252,18 +255,18 @@ password_get_gpg_agent(const char **pass
   if (strcmp(socket_name, p) != 0)
     {
       close(sd);
-      return FALSE;
+      return SVN_NO_ERROR;
     }
   /* The agent will terminate its response with "OK". */
   if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE))
     {
       close(sd);
-      return FALSE;
+      return SVN_NO_ERROR;
     }
   if (strncmp(buffer, "OK", 2) != 0)
     {
       close(sd);
-      return FALSE;
+      return SVN_NO_ERROR;
     }
 
   /* Send TTY_NAME to the gpg-agent daemon. */
@@ -273,13 +276,13 @@ password_get_gpg_agent(const char **pass
       if (!send_option(sd, buffer, BUFFER_SIZE, "ttyname", tty_name, pool))
         {
           close(sd);
-          return FALSE;
+          return SVN_NO_ERROR;
         }
     }
   else
     {
       close(sd);
-      return FALSE;
+      return SVN_NO_ERROR;
     }
 
   /* Send TTY_TYPE to the gpg-agent daemon. */
@@ -289,13 +292,13 @@ password_get_gpg_agent(const char **pass
       if (!send_option(sd, buffer, BUFFER_SIZE, "ttytype", tty_type, pool))
         {
           close(sd);
-          return FALSE;
+          return SVN_NO_ERROR;
         }
     }
   else
     {
       close(sd);
-      return FALSE;
+      return SVN_NO_ERROR;
     }
 
   /* Compute LC_CTYPE. */
@@ -311,7 +314,7 @@ password_get_gpg_agent(const char **pass
       if (!send_option(sd, buffer, BUFFER_SIZE, "lc-ctype", lc_ctype, pool))
         {
           close(sd);
-          return FALSE;
+          return SVN_NO_ERROR;
         }
     }
 
@@ -323,7 +326,7 @@ password_get_gpg_agent(const char **pass
       if (!send_option(sd, buffer, BUFFER_SIZE, "display", display, pool))
         {
           close(sd);
-          return FALSE;
+          return SVN_NO_ERROR;
         }
     }
 
@@ -348,25 +351,25 @@ password_get_gpg_agent(const char **pass
   if (write(sd, request, strlen(request)) == -1)
     {
       close(sd);
-      return FALSE;
+      return SVN_NO_ERROR;
     }
   if (!receive_from_gpg_agent(sd, buffer, BUFFER_SIZE))
     {
       close(sd);
-      return FALSE;
+      return SVN_NO_ERROR;
     }
 
   close(sd);
 
   if (strncmp(buffer, "ERR", 3) == 0)
-    return FALSE;
+    return SVN_NO_ERROR;
   
   p = NULL;
   if (strncmp(buffer, "D", 1) == 0)
     p = &buffer[2];
 
   if (!p)
-    return FALSE;
+    return SVN_NO_ERROR;
 
   ep = strchr(p, '\n');
   if (ep != NULL)
@@ -374,14 +377,20 @@ password_get_gpg_agent(const char **pass
 
   *password = p;
 
-  return TRUE;
+  *done = TRUE;
+  return SVN_NO_ERROR;
 }
 
 
-/* Implementation of svn_auth__password_set_t that stores the password in
-   GPG Agent. */
-static svn_boolean_t
-password_set_gpg_agent(apr_hash_t *creds,
+/* Implementation of svn_auth__password_set_t that would store the
+   password in GPG Agent if that's how this particular integration
+   worked.  But it isn't.  GPG Agent stores the password provided by
+   the user via the pinentry program immediately upon its provision
+   (and regardless of its accuracy as passwords go), so there's
+   nothing really to do here.  */
+static svn_error_t *
+password_set_gpg_agent(svn_boolean_t *done,
+                       apr_hash_t *creds,
                        const char *realmstring,
                        const char *username,
                        const char *password,
@@ -389,7 +398,9 @@ password_set_gpg_agent(apr_hash_t *creds
                        svn_boolean_t non_interactive,
                        apr_pool_t *pool)
 {
-  return TRUE;
+  *done = TRUE;
+
+  return SVN_NO_ERROR;
 }
 
 

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/io.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/io.c Mon Jul 30 06:39:28 2012
@@ -170,7 +170,7 @@ cstring_from_utf8(const char **path_apr,
 
 
 /* Set *NAME_P to the UTF-8 representation of directory entry NAME.
- * NAME is in the the internal encoding used by APR; PARENT is in
+ * NAME is in the internal encoding used by APR; PARENT is in
  * UTF-8 and in internal (not local) style.
  *
  * Use PARENT only for generating an error string if the conversion
@@ -438,7 +438,7 @@ svn_io_open_uniquely_named(apr_file_t **
               /* The variable parts of unique_name will not require UTF8
                  conversion. Therefore, if UTF8 conversion had no effect
                  on it in the first iteration, it won't require conversion
-                 in any future interation. */
+                 in any future iteration. */
               needs_utf8_conversion = strcmp(unique_name_apr, unique_name);
             }
         }
@@ -1343,7 +1343,7 @@ get_default_file_perms(apr_fileperms_t *
   static apr_fileperms_t default_perms = 0;
 
   /* Technically, this "racy": Multiple threads may use enter here and
-     try to figure out the default permisission concurrently. That's fine
+     try to figure out the default permission concurrently. That's fine
      since they will end up with the same results. Even more technical,
      apr_fileperms_t is an atomic type on 32+ bit machines.
    */
@@ -1555,7 +1555,7 @@ static apr_status_t io_utf8_to_unicode_p
      * Allocate the maximum string length based on leading 4
      * characters of \\?\ (allowing nearly unlimited path lengths)
      * plus the trailing null, then transform /'s into \\'s since
-     * the \\?\ form doesn't allow '/' path seperators.
+     * the \\?\ form doesn't allow '/' path separators.
      *
      * Note that the \\?\ form only works for local drive paths, and
      * \\?\UNC\ is needed UNC paths.
@@ -1565,7 +1565,7 @@ static apr_status_t io_utf8_to_unicode_p
     apr_status_t rv;
 
     /* This is correct, we don't twist the filename if it will
-     * definately be shorter than 248 characters.  It merits some
+     * definitely be shorter than 248 characters.  It merits some
      * performance testing to see if this has any effect, but there
      * seem to be applications that get confused by the resulting
      * Unicode \\?\ style file names, especially if they use argv[0]
@@ -2173,7 +2173,7 @@ svn_io_remove_dir(const char *path, apr_
 }
 
 /*
- Mac OS X has a bug where if you're readding the contents of a
+ Mac OS X has a bug where if you're reading the contents of a
  directory via readdir in a loop, and you remove one of the entries in
  the directory and the directory has 338 or more files in it you will
  skip over some of the entries in the directory.  Needless to say,
@@ -2417,10 +2417,11 @@ handle_child_process_error(apr_pool_t *p
 
 
 svn_error_t *
-svn_io_start_cmd2(apr_proc_t *cmd_proc,
+svn_io_start_cmd3(apr_proc_t *cmd_proc,
                   const char *path,
                   const char *cmd,
                   const char *const *args,
+                  const char *const *env,
                   svn_boolean_t inherit,
                   svn_boolean_t infile_pipe,
                   apr_file_t *infile,
@@ -2542,8 +2543,8 @@ svn_io_start_cmd2(apr_proc_t *cmd_proc,
 
 
   /* Start the cmd command. */
-  apr_err = apr_proc_create(cmd_proc, cmd_apr, args_native, NULL,
-                            cmdproc_attr, pool);
+  apr_err = apr_proc_create(cmd_proc, cmd_apr, args_native,
+                            inherit ? NULL : env, cmdproc_attr, pool);
   if (apr_err)
     return svn_error_wrap_apr(apr_err, _("Can't start process '%s'"), cmd);
 
@@ -3279,6 +3280,15 @@ svn_io_write_unique(const char **tmp_pat
 svn_error_t *
 svn_io_file_trunc(apr_file_t *file, apr_off_t offset, apr_pool_t *pool)
 {
+  /* This is a work-around. APR would flush the write buffer
+     _after_ truncating the file causing now invalid buffered
+     data to be written behind OFFSET. */
+  SVN_ERR(do_io_file_wrapper_cleanup
+    (file, apr_file_flush(file),
+     N_("Can't flush file '%s'"),
+     N_("Can't flush stream"),
+     pool));
+
   return do_io_file_wrapper_cleanup
     (file, apr_file_trunc(file, offset),
      N_("Can't truncate file '%s'"),

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/macos_keychain.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/macos_keychain.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/macos_keychain.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/macos_keychain.c Mon Jul 30 06:39:28 2012
@@ -65,8 +65,9 @@
 
 /* Implementation of svn_auth__password_set_t that stores
    the password in the OS X KeyChain. */
-static svn_boolean_t
-keychain_password_set(apr_hash_t *creds,
+static svn_error_t *
+keychain_password_set(svn_boolean_t *done,
+                      apr_hash_t *creds,
                       const char *realmstring,
                       const char *username,
                       const char *password,
@@ -106,13 +107,16 @@ keychain_password_set(apr_hash_t *creds,
   if (non_interactive)
     SecKeychainSetUserInteractionAllowed(TRUE);
 
-  return status == 0;
+  *done = (status == 0);
+
+  return SVN_NO_ERROR;
 }
 
 /* Implementation of svn_auth__password_get_t that retrieves
    the password from the OS X KeyChain. */
-static svn_boolean_t
-keychain_password_get(const char **password,
+static svn_error_t *
+keychain_password_get(svn_boolean_t *done,
+                      const char **password,
                       apr_hash_t *creds,
                       const char *realmstring,
                       const char *username,
@@ -124,6 +128,8 @@ keychain_password_get(const char **passw
   UInt32 length;
   void *data;
 
+  *done = FALSE;
+
   if (non_interactive)
     SecKeychainSetUserInteractionAllowed(FALSE);
 
@@ -137,11 +143,12 @@ keychain_password_get(const char **passw
     SecKeychainSetUserInteractionAllowed(TRUE);
 
   if (status != 0)
-    return FALSE;
+    return SVN_NO_ERROR;
 
   *password = apr_pstrmemdup(pool, data, length);
   SecKeychainItemFreeContent(NULL, data);
-  return TRUE;
+  *done = TRUE;
+  return SVN_NO_ERROR;
 }
 
 /* Get cached encrypted credentials from the simple provider's cache. */

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/opt.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/opt.c Mon Jul 30 06:39:28 2012
@@ -1100,7 +1100,7 @@ svn_opt__print_version_info(const char *
                                      "   compiled %s, %s\n\n"), pgm_name,
                              SVN_VERSION, __DATE__, __TIME__));
   SVN_ERR(svn_cmdline_fputs(
-             _("Copyright (C) 2011 The Apache Software Foundation.\n"
+             _("Copyright (C) 2012 The Apache Software Foundation.\n"
                "This software consists of contributions made by many "
                "people; see the NOTICE\n"
                "file for more information.\n"

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/simple_providers.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/simple_providers.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/simple_providers.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/simple_providers.c Mon Jul 30 06:39:28 2012
@@ -62,8 +62,9 @@ typedef struct simple_provider_baton_t
 
 /* Implementation of svn_auth__password_get_t that retrieves
    the plaintext password from CREDS. */
-svn_boolean_t
-svn_auth__simple_password_get(const char **password,
+svn_error_t *
+svn_auth__simple_password_get(svn_boolean_t *done,
+                              const char **password,
                               apr_hash_t *creds,
                               const char *realmstring,
                               const char *username,
@@ -72,6 +73,9 @@ svn_auth__simple_password_get(const char
                               apr_pool_t *pool)
 {
   svn_string_t *str;
+
+  *done = FALSE;
+
   str = apr_hash_get(creds, AUTHN_USERNAME_KEY, APR_HASH_KEY_STRING);
   if (str && username && strcmp(str->data, username) == 0)
     {
@@ -79,16 +83,18 @@ svn_auth__simple_password_get(const char
       if (str && str->data)
         {
           *password = str->data;
-          return TRUE;
+          *done = TRUE;
         }
     }
-  return FALSE;
+
+  return SVN_NO_ERROR;
 }
 
 /* Implementation of svn_auth__password_set_t that stores
    the plaintext password in CREDS. */
-svn_boolean_t
-svn_auth__simple_password_set(apr_hash_t *creds,
+svn_error_t *
+svn_auth__simple_password_set(svn_boolean_t *done,
+                              apr_hash_t *creds,
                               const char *realmstring,
                               const char *username,
                               const char *password,
@@ -98,7 +104,9 @@ svn_auth__simple_password_set(apr_hash_t
 {
   apr_hash_set(creds, AUTHN_PASSWORD_KEY, APR_HASH_KEY_STRING,
                svn_string_create(password, pool));
-  return TRUE;
+  *done = TRUE;
+
+  return SVN_NO_ERROR;
 }
 
 /* Set **USERNAME to the username retrieved from CREDS; ignore
@@ -211,8 +219,12 @@ svn_auth__simple_first_creds_helper(void
         {
           if (have_passtype)
             {
-              if (!password_get(&default_password, creds_hash, realmstring,
-                                username, parameters, non_interactive, pool))
+              svn_boolean_t done;
+
+              SVN_ERR(password_get(&done, &default_password, creds_hash,
+                                   realmstring, username, parameters,
+                                   non_interactive, pool));
+              if (!done)
                 {
                   need_to_save = TRUE;
                 }
@@ -241,9 +253,12 @@ svn_auth__simple_first_creds_helper(void
                 password = NULL;
               else
                 {
-                  if (!password_get(&password, creds_hash, realmstring,
-                                    username, parameters, non_interactive,
-                                    pool))
+                  svn_boolean_t done;
+
+                  SVN_ERR(password_get(&done, &password, creds_hash,
+                                       realmstring, username, parameters,
+                                       non_interactive, pool));
+                  if (!done)
                     password = NULL;
 
                   /* If the auth data didn't contain a password type,
@@ -314,15 +329,9 @@ svn_auth__simple_save_creds_helper(svn_b
     apr_hash_get(parameters,
                  SVN_AUTH_PARAM_DONT_STORE_PASSWORDS,
                  APR_HASH_KEY_STRING) != NULL;
-  const char *store_plaintext_passwords =
-    apr_hash_get(parameters,
-                 SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS,
-                 APR_HASH_KEY_STRING);
   svn_boolean_t non_interactive = apr_hash_get(parameters,
                                                SVN_AUTH_PARAM_NON_INTERACTIVE,
                                                APR_HASH_KEY_STRING) != NULL;
-  simple_provider_baton_t *b = (simple_provider_baton_t *)provider_baton;
-
   svn_boolean_t no_auth_cache =
     (! creds->may_save) || (apr_hash_get(parameters,
                                          SVN_AUTH_PARAM_NO_AUTH_CACHE,
@@ -365,6 +374,16 @@ svn_auth__simple_save_creds_helper(svn_b
         }
       else
         {
+#ifdef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
+          may_save_password = FALSE;
+#else
+          const char *store_plaintext_passwords =
+            apr_hash_get(parameters,
+                         SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS,
+                         APR_HASH_KEY_STRING);
+          simple_provider_baton_t *b =
+            (simple_provider_baton_t *)provider_baton;
+
           if (svn_cstring_casecmp(store_plaintext_passwords,
                                   SVN_CONFIG_ASK) == 0)
             {
@@ -449,13 +468,14 @@ svn_auth__simple_save_creds_helper(svn_b
                 store_plaintext_passwords,
                 SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS);
             }
+#endif
         }
 
       if (may_save_password)
         {
-          *saved = password_set(creds_hash, realmstring,
-                                creds->username, creds->password,
-                                parameters, non_interactive, pool);
+          SVN_ERR(password_set(saved, creds_hash, realmstring,
+                               creds->username, creds->password,
+                               parameters, non_interactive, pool));
           if (*saved && passtype)
             /* Store the password type with the auth data, so that we
                know which provider owns the password. */

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/skel.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/skel.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/skel.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/skel.c Mon Jul 30 06:39:28 2012
@@ -138,7 +138,7 @@ getsize(const char *data, apr_size_t len
 /* Store the ASCII decimal representation of VALUE at DATA.  Return
    the length of the representation if all goes well; return zero if
    the result doesn't fit in LEN bytes.  */
-static int
+static apr_size_t
 putsize(char *data, apr_size_t len, apr_size_t value)
 {
   apr_size_t i = 0;
@@ -157,7 +157,7 @@ putsize(char *data, apr_size_t len, apr_
 
   /* Put the digits in most-significant-first order.  */
   {
-    int left, right;
+    apr_size_t left, right;
 
     for (left = 0, right = i-1; left < right; left++, right--)
       {
@@ -401,23 +401,16 @@ explicit_atom(const char *data,
 
 static apr_size_t estimate_unparsed_size(const svn_skel_t *skel);
 static svn_stringbuf_t *unparse(const svn_skel_t *skel,
-                                svn_stringbuf_t *str,
-                                apr_pool_t *pool);
+                                svn_stringbuf_t *str);
 
 
 svn_stringbuf_t *
 svn_skel__unparse(const svn_skel_t *skel, apr_pool_t *pool)
 {
-  svn_stringbuf_t *str;
-
-  /* Allocate a string to hold the data.  */
-  str = apr_palloc(pool, sizeof(*str));
-  str->pool = pool;
-  str->blocksize = estimate_unparsed_size(skel) + 200;
-  str->data = apr_palloc(pool, str->blocksize);
-  str->len = 0;
+  svn_stringbuf_t *str
+    = svn_stringbuf_create_ensure(estimate_unparsed_size(skel) + 200, pool);
 
-  return unparse(skel, str, pool);
+  return unparse(skel, str);
 }
 
 
@@ -486,10 +479,9 @@ use_implicit(const svn_skel_t *skel)
 }
 
 
-/* Append the concrete representation of SKEL to the string STR.
-   Grow S with new space from POOL as necessary.  */
+/* Append the concrete representation of SKEL to the string STR. */
 static svn_stringbuf_t *
-unparse(const svn_skel_t *skel, svn_stringbuf_t *str, apr_pool_t *pool)
+unparse(const svn_skel_t *skel, svn_stringbuf_t *str)
 {
   if (skel->is_atom)
     {
@@ -500,7 +492,7 @@ unparse(const svn_skel_t *skel, svn_stri
         {
           /* Append the length to STR.  */
           char buf[200];
-          int length_len;
+          apr_size_t length_len;
 
           length_len = putsize(buf, sizeof(buf), skel->len);
 
@@ -508,33 +500,27 @@ 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);
+          svn_stringbuf_ensure(str, str->len + length_len + 1 + skel->len + 1);
           svn_stringbuf_appendbytes(str, buf, length_len);
-          str->data[str->len++] = ' ';
+          svn_stringbuf_appendbyte(str, ' ');
           svn_stringbuf_appendbytes(str, skel->data, skel->len);
         }
     }
   else
     {
-      /* Append a list to STR.  */
+      /* Append a list to STR: an opening parenthesis, the list elements
+       * separated by a space, and a closing parenthesis.  */
       svn_skel_t *child;
 
-      /* Emit an opening parenthesis.  */
-      svn_stringbuf_ensure(str, str->len + 1);
-      str->data[str->len++] = '(';
+      svn_stringbuf_appendbyte(str, '(');
 
-      /* Append each element.  Emit a space between each pair of elements.  */
       for (child = skel->children; child; child = child->next)
         {
-          unparse(child, str, pool);
+          unparse(child, str);
           if (child->next)
-            {
-              svn_stringbuf_ensure(str, str->len + 1);
-              str->data[str->len++] = ' ';
-            }
+            svn_stringbuf_appendbyte(str, ' ');
         }
 
-      /* Emit a closing parenthesis.  */
       svn_stringbuf_appendbyte(str, ')');
     }
 

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/spillbuf.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/spillbuf.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/spillbuf.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/spillbuf.c Mon Jul 30 06:39:28 2012
@@ -552,3 +552,56 @@ svn_spillbuf__reader_write(svn_spillbuf_
   return svn_error_trace(svn_spillbuf__write(&reader->buf, data, len,
                                              scratch_pool));
 }
+
+
+struct spillbuf_baton
+{
+  svn_spillbuf_reader_t *reader;
+  apr_pool_t *scratch_pool;
+};
+
+
+static svn_error_t *
+read_handler_spillbuf(void *baton, char *buffer, apr_size_t *len)
+{
+  struct spillbuf_baton *sb = baton;
+
+  SVN_ERR(svn_spillbuf__reader_read(len, sb->reader, buffer, *len,
+                                    sb->scratch_pool));
+
+  svn_pool_clear(sb->scratch_pool);
+  return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
+write_handler_spillbuf(void *baton, const char *data, apr_size_t *len)
+{
+  struct spillbuf_baton *sb = baton;
+
+  SVN_ERR(svn_spillbuf__reader_write(sb->reader, data, *len, sb->scratch_pool));
+
+  svn_pool_clear(sb->scratch_pool);
+  return SVN_NO_ERROR;
+}
+
+
+svn_stream_t *
+svn_stream__from_spillbuf(apr_size_t blocksize,
+                          apr_size_t maxsize,
+                          apr_pool_t *result_pool)
+{
+  svn_stream_t *stream;
+  struct spillbuf_baton *sb = apr_pcalloc(result_pool, sizeof(*sb));
+
+  sb->reader = svn_spillbuf__reader_create(blocksize, maxsize, result_pool);
+  sb->scratch_pool = svn_pool_create(result_pool);
+
+  stream = svn_stream_create(sb, result_pool);
+
+  svn_stream_set_read(stream, read_handler_spillbuf);
+  svn_stream_set_write(stream, write_handler_spillbuf);
+
+
+  return stream;
+}

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/sqlite.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/sqlite.c Mon Jul 30 06:39:28 2012
@@ -120,16 +120,17 @@ struct svn_sqlite__value_t
 {                                                                \
   int sqlite_err__temp = (x);                                    \
   if (sqlite_err__temp != SQLITE_OK)                             \
-    return svn_error_create(SQLITE_ERROR_CODE(sqlite_err__temp), \
-                            NULL, sqlite3_errmsg((db)->db3));    \
+    return svn_error_createf(SQLITE_ERROR_CODE(sqlite_err__temp), \
+                             NULL, "sqlite: %s",                 \
+                             sqlite3_errmsg((db)->db3));         \
 } while (0)
 
 #define SQLITE_ERR_MSG(x, msg) do                                \
 {                                                                \
   int sqlite_err__temp = (x);                                    \
   if (sqlite_err__temp != SQLITE_OK)                             \
-    return svn_error_create(SQLITE_ERROR_CODE(sqlite_err__temp), \
-                            NULL, msg);                          \
+    return svn_error_createf(SQLITE_ERROR_CODE(sqlite_err__temp), \
+                             NULL, "sqlite: %s", (msg));         \
 } while (0)
 
 
@@ -245,8 +246,8 @@ svn_sqlite__step(svn_boolean_t *got_row,
     {
       svn_error_t *err1, *err2;
 
-      err1 = svn_error_create(SQLITE_ERROR_CODE(sqlite_result), NULL,
-                              sqlite3_errmsg(stmt->db->db3));
+      err1 = svn_error_createf(SQLITE_ERROR_CODE(sqlite_result), NULL,
+                               "sqlite: %s", sqlite3_errmsg(stmt->db->db3));
       err2 = svn_sqlite__reset(stmt);
       return svn_error_compose_create(err1, err2);
     }
@@ -678,14 +679,15 @@ internal_open(sqlite3 **db3, const char 
       int err_code = sqlite3_open_v2(path, db3, flags, NULL);
       if (err_code != SQLITE_OK)
         {
+          /* Save the error message before closing the SQLite handle. */
           char *msg = apr_pstrdup(scratch_pool, sqlite3_errmsg(*db3));
 
           /* We don't catch the error here, since we care more about the open
              error than the close error at this point. */
           sqlite3_close(*db3);
 
-          msg = apr_pstrcat(scratch_pool, msg, ": '", path, "'", (char *)NULL);
-          return svn_error_create(SQLITE_ERROR_CODE(err_code), NULL, msg);
+          return svn_error_createf(SQLITE_ERROR_CODE(err_code), NULL,
+                                   "sqlite: %s: '%s'", msg, path);
         }
     }
   }

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/ssl_client_cert_pw_providers.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/ssl_client_cert_pw_providers.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/ssl_client_cert_pw_providers.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/ssl_client_cert_pw_providers.c Mon Jul 30 06:39:28 2012
@@ -63,8 +63,9 @@ typedef struct ssl_client_cert_pw_file_p
 /* This implements the svn_auth__password_get_t interface.
    Set **PASSPHRASE to the plaintext passphrase retrieved from CREDS;
    ignore other parameters. */
-svn_boolean_t
-svn_auth__ssl_client_cert_pw_get(const char **passphrase,
+svn_error_t *
+svn_auth__ssl_client_cert_pw_get(svn_boolean_t *done,
+                                 const char **passphrase,
                                  apr_hash_t *creds,
                                  const char *realmstring,
                                  const char *username,
@@ -77,15 +78,18 @@ svn_auth__ssl_client_cert_pw_get(const c
   if (str && str->data)
     {
       *passphrase = str->data;
-      return TRUE;
+      *done = TRUE;
+      return SVN_NO_ERROR;
     }
+  *done = FALSE;
   return FALSE;
 }
 
 /* This implements the svn_auth__password_set_t interface.
    Store PASSPHRASE in CREDS; ignore other parameters. */
-svn_boolean_t
-svn_auth__ssl_client_cert_pw_set(apr_hash_t *creds,
+svn_error_t *
+svn_auth__ssl_client_cert_pw_set(svn_boolean_t *done,
+                                 apr_hash_t *creds,
                                  const char *realmstring,
                                  const char *username,
                                  const char *passphrase,
@@ -95,7 +99,8 @@ svn_auth__ssl_client_cert_pw_set(apr_has
 {
   apr_hash_set(creds, AUTHN_PASSPHRASE_KEY, APR_HASH_KEY_STRING,
                svn_string_create(passphrase, pool));
-  return TRUE;
+  *done = TRUE;
+  return SVN_NO_ERROR;
 }
 
 svn_error_t *
@@ -137,8 +142,11 @@ svn_auth__ssl_client_cert_pw_file_first_
       svn_error_clear(err);
       if (! err && creds_hash)
         {
-          if (!passphrase_get(&password, creds_hash, realmstring,
-                              NULL, parameters, non_interactive, pool))
+          svn_boolean_t done;
+
+          SVN_ERR(passphrase_get(&done, &password, creds_hash, realmstring,
+                                 NULL, parameters, non_interactive, pool));
+          if (!done)
             password = NULL;
         }
     }
@@ -176,16 +184,9 @@ svn_auth__ssl_client_cert_pw_file_save_c
     apr_hash_get(parameters,
                  SVN_AUTH_PARAM_DONT_STORE_SSL_CLIENT_CERT_PP,
                  APR_HASH_KEY_STRING) != NULL;
-  const char *store_ssl_client_cert_pp_plaintext =
-    apr_hash_get(parameters,
-                 SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
-                 APR_HASH_KEY_STRING);
   svn_boolean_t non_interactive = apr_hash_get(parameters,
                                                SVN_AUTH_PARAM_NON_INTERACTIVE,
                                                APR_HASH_KEY_STRING) != NULL;
-  ssl_client_cert_pw_file_provider_baton_t *b =
-    (ssl_client_cert_pw_file_provider_baton_t *)provider_baton;
-
   svn_boolean_t no_auth_cache =
     (! creds->may_save) || (apr_hash_get(parameters,
                                          SVN_AUTH_PARAM_NO_AUTH_CACHE,
@@ -219,6 +220,16 @@ svn_auth__ssl_client_cert_pw_file_save_c
         }
       else
         {
+#ifdef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
+          may_save_passphrase = FALSE;
+#else
+          const char *store_ssl_client_cert_pp_plaintext =
+            apr_hash_get(parameters,
+                         SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
+                         APR_HASH_KEY_STRING);
+          ssl_client_cert_pw_file_provider_baton_t *b =
+            (ssl_client_cert_pw_file_provider_baton_t *)provider_baton;
+
           if (svn_cstring_casecmp(store_ssl_client_cert_pp_plaintext,
                                   SVN_CONFIG_ASK) == 0)
             {
@@ -297,13 +308,14 @@ svn_auth__ssl_client_cert_pw_file_save_c
                 store_ssl_client_cert_pp_plaintext,
                 SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT);
             }
+#endif
         }
 
       if (may_save_passphrase)
         {
-          *saved = passphrase_set(creds_hash, realmstring,
-                                  NULL, creds->password, parameters,
-                                  non_interactive, pool);
+          SVN_ERR(passphrase_set(saved, creds_hash, realmstring,
+                                 NULL, creds->password, parameters,
+                                 non_interactive, pool));
 
           if (*saved && passtype)
             {

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/ssl_server_trust_providers.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/ssl_server_trust_providers.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/ssl_server_trust_providers.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/ssl_server_trust_providers.c Mon Jul 30 06:39:28 2012
@@ -208,11 +208,12 @@ ssl_server_trust_prompt_first_cred(void 
     apr_hash_get(parameters,
                  SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO,
                  APR_HASH_KEY_STRING);
+  svn_boolean_t may_save = (!no_auth_cache
+                            && !(*failures & SVN_AUTH_SSL_OTHER));
 
-  SVN_ERR(pb->prompt_func((svn_auth_cred_ssl_server_trust_t **)
-                          credentials_p, pb->prompt_baton, realmstring,
-                          *failures, cert_info, ! no_auth_cache &&
-                          ! (*failures & SVN_AUTH_SSL_OTHER), pool));
+  SVN_ERR(pb->prompt_func((svn_auth_cred_ssl_server_trust_t **)credentials_p,
+                          pb->prompt_baton, realmstring, *failures, cert_info,
+                          may_save, pool));
 
   *iter_baton = NULL;
   return SVN_NO_ERROR;

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/stream.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/stream.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/stream.c Mon Jul 30 06:39:28 2012
@@ -42,8 +42,10 @@
 #include "svn_utf.h"
 #include "svn_checksum.h"
 #include "svn_path.h"
+#include "private/svn_error_private.h"
 #include "private/svn_eol_private.h"
 #include "private/svn_io_private.h"
+#include "private/svn_subr_private.h"
 
 
 struct svn_stream_t {
@@ -374,7 +376,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);
+        svn_stringbuf_ensure(str, str->len + LINE_CHUNK_SIZE + 1);
         numbytes = LINE_CHUNK_SIZE;
         SVN_ERR(svn_stream_read(stream, str->data + str->len, &numbytes));
         str->len += numbytes;
@@ -955,59 +957,6 @@ zfree(voidpf opaque, voidpf address)
   /* Empty, since we allocate on the pool */
 }
 
-/* Converts a zlib error to an svn_error_t. zerr is the error code,
-   function is the function name, and stream is the z_stream we are
-   using.  */
-static svn_error_t *
-zerr_to_svn_error(int zerr, const char *function, z_stream *stream)
-{
-  apr_status_t status;
-  const char *message;
-
-  if (zerr == Z_OK)
-    return SVN_NO_ERROR;
-
-  switch (zerr)
-    {
-    case Z_STREAM_ERROR:
-      status = SVN_ERR_STREAM_MALFORMED_DATA;
-      message = "stream error";
-      break;
-
-    case Z_MEM_ERROR:
-      status = APR_ENOMEM;
-      message = "out of memory";
-      break;
-
-    case Z_BUF_ERROR:
-      status = APR_ENOMEM;
-      message = "buffer error";
-      break;
-
-    case Z_VERSION_ERROR:
-      status = SVN_ERR_STREAM_UNRECOGNIZED_DATA;
-      message = "version error";
-      break;
-
-    case Z_DATA_ERROR:
-      status = SVN_ERR_STREAM_MALFORMED_DATA;
-      message = "corrupted data";
-      break;
-
-    default:
-      status = SVN_ERR_STREAM_UNRECOGNIZED_DATA;
-      message = "error";
-      break;
-    }
-
-  if (stream->msg != NULL)
-    return svn_error_createf(status, NULL, "zlib (%s): %s: %s", function,
-                             message, stream->msg);
-  else
-    return svn_error_createf(status, NULL, "zlib (%s): %s", function,
-                             message);
-}
-
 /* Helper function to figure out the sync mode */
 static svn_error_t *
 read_helper_gz(svn_read_fn_t read_fn,
@@ -1055,11 +1004,11 @@ read_handler_gz(void *baton, char *buffe
                              &btn->in->avail_in, &btn->read_flush));
 
       zerr = inflateInit(btn->in);
-      SVN_ERR(zerr_to_svn_error(zerr, "inflateInit", btn->in));
+      SVN_ERR(svn_error__wrap_zlib(zerr, "inflateInit", btn->in->msg));
     }
 
   btn->in->next_out = (Bytef *) buffer;
-  btn->in->avail_out = *len;
+  btn->in->avail_out = (uInt) *len;
 
   while (btn->in->avail_out > 0)
     {
@@ -1082,7 +1031,8 @@ read_handler_gz(void *baton, char *buffe
       if (zerr == Z_STREAM_END)
         break;
       else if (zerr != Z_OK)
-        return zerr_to_svn_error(zerr, "inflate", btn->in);
+        return svn_error_trace(svn_error__wrap_zlib(zerr, "inflate",
+                                                    btn->in->msg));
     }
 
   *len -= btn->in->avail_out;
@@ -1107,7 +1057,7 @@ write_handler_gz(void *baton, const char
       btn->out->opaque =  btn->pool;
 
       zerr = deflateInit(btn->out, Z_DEFAULT_COMPRESSION);
-      SVN_ERR(zerr_to_svn_error(zerr, "deflateInit", btn->out));
+      SVN_ERR(svn_error__wrap_zlib(zerr, "deflateInit", btn->out->msg));
     }
 
   /* The largest buffer we should need is 0.1% larger than the
@@ -1117,15 +1067,15 @@ write_handler_gz(void *baton, const char
   write_buf = apr_palloc(subpool, buf_size);
 
   btn->out->next_in = (Bytef *) buffer;  /* Casting away const! */
-  btn->out->avail_in = *len;
+  btn->out->avail_in = (uInt) *len;
 
   while (btn->out->avail_in > 0)
     {
       btn->out->next_out = write_buf;
-      btn->out->avail_out = buf_size;
+      btn->out->avail_out = (uInt) buf_size;
 
       zerr = deflate(btn->out, Z_NO_FLUSH);
-      SVN_ERR(zerr_to_svn_error(zerr, "deflate", btn->out));
+      SVN_ERR(svn_error__wrap_zlib(zerr, "deflate", btn->out->msg));
       write_len = buf_size - btn->out->avail_out;
       if (write_len > 0)
         SVN_ERR(btn->write(btn->subbaton, write_buf, &write_len));
@@ -1146,7 +1096,7 @@ close_handler_gz(void *baton)
   if (btn->in != NULL)
     {
       zerr = inflateEnd(btn->in);
-      SVN_ERR(zerr_to_svn_error(zerr, "inflateEnd", btn->in));
+      SVN_ERR(svn_error__wrap_zlib(zerr, "inflateEnd", btn->in->msg));
     }
 
   if (btn->out != NULL)
@@ -1163,7 +1113,8 @@ close_handler_gz(void *baton)
 
           zerr = deflate(btn->out, Z_FINISH);
           if (zerr != Z_STREAM_END && zerr != Z_OK)
-            return zerr_to_svn_error(zerr, "deflate", btn->out);
+            return svn_error_trace(svn_error__wrap_zlib(zerr, "deflate",
+                                                        btn->out->msg));
           write_len = ZBUFFER_SIZE - btn->out->avail_out;
           if (write_len > 0)
             SVN_ERR(btn->write(btn->subbaton, buf, &write_len));
@@ -1172,7 +1123,7 @@ close_handler_gz(void *baton)
         }
 
       zerr = deflateEnd(btn->out);
-      SVN_ERR(zerr_to_svn_error(zerr, "deflateEnd", btn->out));
+      SVN_ERR(svn_error__wrap_zlib(zerr, "deflateEnd", btn->out->msg));
     }
 
   if (btn->close != NULL)
@@ -1692,3 +1643,16 @@ svn_string_from_stream(svn_string_t **re
 
   return SVN_NO_ERROR;
 }
+
+
+/* These are somewhat arbirary, if we ever get good empirical data as to
+   actually valid values, feel free to update them. */
+#define BUFFER_BLOCK_SIZE 1024
+#define BUFFER_MAX_SIZE 100000
+
+svn_stream_t *
+svn_stream_buffered(apr_pool_t *result_pool)
+{
+  return svn_stream__from_spillbuf(BUFFER_BLOCK_SIZE, BUFFER_MAX_SIZE,
+                                   result_pool);
+}

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/svn_base64.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/svn_base64.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/svn_base64.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/svn_base64.c Mon Jul 30 06:39:28 2012
@@ -407,10 +407,16 @@ decode_bytes(svn_stringbuf_t *str, const
   signed char find;
   const char *end = data + len;
 
-  /* Resize the stringbuf to make room for the (approximate) size of
-     output, to avoid repeated resizes later.
-     The optimizations in decode_line rely on no resizes being necessary! */
-  svn_stringbuf_ensure(str, str->len + (len / 4) * 3 + 3);
+  /* Resize the stringbuf to make room for the maximum size of output,
+     to avoid repeated resizes later.  The optimizations in
+     decode_line rely on no resizes being necessary!
+
+     (*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(str, str->len + ((*inbuflen + len) / 4) * 3 + 1);
 
   while ( !*done && p < end )
     {

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/svn_mutex.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/svn_mutex.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/svn_mutex.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/svn_mutex.c Mon Jul 30 06:39:28 2012
@@ -26,7 +26,7 @@
 
 svn_error_t *
 svn_mutex__init(svn_mutex__t **mutex_p, 
-                svn_boolean_t enable_mutex, 
+                svn_boolean_t mutex_required, 
                 apr_pool_t *result_pool)
 {
   /* always initialize the mutex pointer, even though it is not
@@ -34,7 +34,7 @@ svn_mutex__init(svn_mutex__t **mutex_p, 
   *mutex_p = NULL;
 
 #if APR_HAS_THREADS
-  if (enable_mutex)
+  if (mutex_required)
     {
       apr_thread_mutex_t *apr_mutex;
       apr_status_t status =

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/svn_string.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/svn_string.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/svn_string.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/svn_string.c Mon Jul 30 06:39:28 2012
@@ -642,12 +642,11 @@ svn_cstring_split_append(apr_array_heade
                          svn_boolean_t chop_whitespace,
                          apr_pool_t *pool)
 {
-  char *last;
   char *pats;
   char *p;
 
   pats = apr_pstrdup(pool, input);  /* strtok wants non-const data */
-  p = apr_strtok(pats, sep_chars, &last);
+  p = svn_cstring_tokenize(sep_chars, &pats);
 
   while (p)
     {
@@ -667,7 +666,7 @@ svn_cstring_split_append(apr_array_heade
       if (p[0] != '\0')
         APR_ARRAY_PUSH(array, const char *) = p;
 
-      p = apr_strtok(NULL, sep_chars, &last);
+      p = svn_cstring_tokenize(sep_chars, &pats);
     }
 
   return;
@@ -718,6 +717,47 @@ svn_cstring_match_list(const char *str, 
   return FALSE;
 }
 
+char * 
+svn_cstring_tokenize(const char *sep, char **str)
+{
+    char *token;
+    const char * next;
+    char csep;
+
+    /* check parameters */
+    if ((sep == NULL) || (str == NULL) || (*str == NULL))
+        return NULL;
+
+    /* let APR handle edge cases and multiple separators */
+    csep = *sep;
+    if (csep == '\0' || sep[1] != '\0')
+      return apr_strtok(NULL, sep, str);
+
+    /* skip characters in sep (will terminate at '\0') */
+    token = *str;
+    while (*token == csep)
+        ++token;
+
+    if (!*token)          /* no more tokens */
+        return NULL;
+
+    /* skip valid token characters to terminate token and
+     * prepare for the next call (will terminate at '\0) 
+     */
+    next = strchr(token, csep);
+    if (next == NULL)
+      {
+        *str = token + strlen(token);
+      }
+    else
+      {
+        *(char *)next = '\0';
+        *str = (char *)next + 1;
+      }
+
+    return token;
+}
+
 int svn_cstring_count_newlines(const char *msg)
 {
   int count = 0;

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/utf.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/utf.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/utf.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/utf.c Mon Jul 30 06:39:28 2012
@@ -23,6 +23,7 @@
 
 
 
+#include <stdlib.h>
 #include <string.h>
 #include <assert.h>
 
@@ -55,6 +56,7 @@ static const char *SVN_UTF_UTON_XLATE_HA
 static const char *SVN_APR_UTF8_CHARSET = "UTF-8";
 
 static svn_mutex__t *xlate_handle_mutex = NULL;
+static svn_boolean_t assume_native_charset_is_utf8 = FALSE;
 
 /* The xlate handle cache is a global hash table with linked lists of xlate
  * handles.  In multi-threaded environments, a thread "borrows" an xlate
@@ -118,7 +120,8 @@ xlate_handle_node_cleanup(void *arg)
 }
 
 void
-svn_utf_initialize(apr_pool_t *pool)
+svn_utf_initialize2(apr_pool_t *pool,
+                    svn_boolean_t assume_native_utf8)
 {
   if (!xlate_handle_hash)
     {
@@ -141,6 +144,9 @@ svn_utf_initialize(apr_pool_t *pool)
       apr_pool_cleanup_register(subpool, NULL, xlate_cleanup,
                                 apr_pool_cleanup_null);
     }
+
+    if (!assume_native_charset_is_utf8)
+      assume_native_charset_is_utf8 = assume_native_utf8;
 }
 
 /* Return a unique string key based on TOPAGE and FROMPAGE.  TOPAGE and
@@ -442,7 +448,9 @@ static svn_error_t *
 get_ntou_xlate_handle_node(xlate_handle_node_t **ret, apr_pool_t *pool)
 {
   return get_xlate_handle_node(ret, SVN_APR_UTF8_CHARSET,
-                               SVN_APR_LOCALE_CHARSET,
+                               assume_native_charset_is_utf8
+                                 ? SVN_APR_UTF8_CHARSET
+                                 : SVN_APR_LOCALE_CHARSET,
                                SVN_UTF_NTOU_XLATE_HANDLE, pool);
 }
 
@@ -455,7 +463,10 @@ get_ntou_xlate_handle_node(xlate_handle_
 static svn_error_t *
 get_uton_xlate_handle_node(xlate_handle_node_t **ret, apr_pool_t *pool)
 {
-  return get_xlate_handle_node(ret, SVN_APR_LOCALE_CHARSET,
+  return get_xlate_handle_node(ret,
+                               assume_native_charset_is_utf8
+                                 ? SVN_APR_UTF8_CHARSET
+                                 : SVN_APR_LOCALE_CHARSET,
                                SVN_APR_UTF8_CHARSET,
                                SVN_UTF_UTON_XLATE_HANDLE, pool);
 }

Modified: subversion/branches/svn-bisect/subversion/libsvn_subr/win32_crypto.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_subr/win32_crypto.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_subr/win32_crypto.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_subr/win32_crypto.c Mon Jul 30 06:39:28 2012
@@ -52,8 +52,9 @@ static const WCHAR description[] = L"aut
 
 /* Implementation of svn_auth__password_set_t that encrypts
    the incoming password using the Windows CryptoAPI. */
-static svn_boolean_t
-windows_password_encrypter(apr_hash_t *creds,
+static svn_error_t *
+windows_password_encrypter(svn_boolean_t *done,
+                           apr_hash_t *creds,
                            const char *realmstring,
                            const char *username,
                            const char *in,
@@ -73,20 +74,21 @@ windows_password_encrypter(apr_hash_t *c
     {
       char *coded = apr_palloc(pool, apr_base64_encode_len(blobout.cbData));
       apr_base64_encode(coded, (const char*)blobout.pbData, blobout.cbData);
-      crypted = svn_auth__simple_password_set(creds, realmstring, username,
-                                              coded, parameters,
-                                              non_interactive, pool);
+      SVN_ERR(svn_auth__simple_password_set(done, creds, realmstring, username,
+                                            coded, parameters,
+                                            non_interactive, pool));
       LocalFree(blobout.pbData);
     }
 
-  return crypted;
+  return SVN_NO_ERROR;
 }
 
 /* Implementation of svn_auth__password_get_t that decrypts
    the incoming password using the Windows CryptoAPI and verifies its
    validity. */
-static svn_boolean_t
-windows_password_decrypter(const char **out,
+static svn_error_t *
+windows_password_decrypter(svn_boolean_t *done,
+                           const char **out,
                            apr_hash_t *creds,
                            const char *realmstring,
                            const char *username,
@@ -100,9 +102,10 @@ windows_password_decrypter(const char **
   svn_boolean_t decrypted;
   char *in;
 
-  if (!svn_auth__simple_password_get(&in, creds, realmstring, username,
-                                     parameters, non_interactive, pool))
-    return FALSE;
+  SVN_ERR(svn_auth__simple_password_get(done, &in, creds, realmstring, username,
+                                        parameters, non_interactive, pool));
+  if (!done)
+    return SVN_NO_ERROR;
 
   blobin.cbData = strlen(in);
   blobin.pbData = apr_palloc(pool, apr_base64_decode_len(in));
@@ -119,7 +122,8 @@ windows_password_decrypter(const char **
       LocalFree(descr);
     }
 
-  return decrypted;
+  *done = decrypted;
+  return SVN_NO_ERROR;
 }
 
 /* Get cached encrypted credentials from the simple provider's cache. */
@@ -186,8 +190,9 @@ svn_auth_get_windows_simple_provider(svn
 
 /* Implementation of svn_auth__password_set_t that encrypts
    the incoming password using the Windows CryptoAPI. */
-static svn_boolean_t
-windows_ssl_client_cert_pw_encrypter(apr_hash_t *creds,
+static svn_error_t *
+windows_ssl_client_cert_pw_encrypter(svn_boolean_t *done,
+                                     apr_hash_t *creds,
                                      const char *realmstring,
                                      const char *username,
                                      const char *in,
@@ -207,20 +212,21 @@ windows_ssl_client_cert_pw_encrypter(apr
     {
       char *coded = apr_palloc(pool, apr_base64_encode_len(blobout.cbData));
       apr_base64_encode(coded, (const char*)blobout.pbData, blobout.cbData);
-      crypted = svn_auth__ssl_client_cert_pw_set(creds, realmstring, username,
-                                                 coded, parameters,
-                                                 non_interactive, pool);
+      SVN_ERR(svn_auth__ssl_client_cert_pw_set(done, creds, realmstring,
+                                               username, coded, parameters,
+                                               non_interactive, pool));
       LocalFree(blobout.pbData);
     }
 
-  return crypted;
+  return SVN_NO_ERROR;
 }
 
 /* Implementation of svn_auth__password_get_t that decrypts
    the incoming password using the Windows CryptoAPI and verifies its
    validity. */
-static svn_boolean_t
-windows_ssl_client_cert_pw_decrypter(const char **out,
+static svn_error_t *
+windows_ssl_client_cert_pw_decrypter(svn_boolean_t *done,
+                                     const char **out,
                                      apr_hash_t *creds,
                                      const char *realmstring,
                                      const char *username,
@@ -234,9 +240,11 @@ windows_ssl_client_cert_pw_decrypter(con
   svn_boolean_t decrypted;
   char *in;
 
-  if (!svn_auth__ssl_client_cert_pw_get(&in, creds, realmstring, username,
-                                        parameters, non_interactive, pool))
-    return FALSE;
+  SVN_ERR(svn_auth__ssl_client_cert_pw_get(done, &in, creds, realmstring,
+                                           username, parameters,
+                                           non_interactive, pool));
+  if (!done)
+    return SVN_NO_ERROR;
 
   blobin.cbData = strlen(in);
   blobin.pbData = apr_palloc(pool, apr_base64_decode_len(in));
@@ -253,7 +261,8 @@ windows_ssl_client_cert_pw_decrypter(con
       LocalFree(descr);
     }
 
-  return decrypted;
+  *done = decrypted;
+  return SVN_NO_ERROR;
 }
 
 /* Get cached encrypted credentials from the simple provider's cache. */

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/adm_ops.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/adm_ops.c Mon Jul 30 06:39:28 2012
@@ -610,8 +610,7 @@ svn_wc__delete_many(svn_wc_context_t *wc
   svn_error_t *err;
   svn_wc__db_status_t status;
   svn_kind_t kind;
-  svn_boolean_t conflicted;
-  const apr_array_header_t *conflicts;
+  const apr_array_header_t *conflicts = NULL;
   apr_array_header_t *versioned_targets;
   const char *local_abspath;
   int i;
@@ -622,6 +621,8 @@ svn_wc__delete_many(svn_wc_context_t *wc
                                      sizeof(const char *));
   for (i = 0; i < targets->nelts; i++)
     {
+      svn_boolean_t conflicted = FALSE;
+
       svn_pool_clear(iterpool);
 
       local_abspath = APR_ARRAY_IDX(targets, i, const char *);
@@ -699,7 +700,7 @@ svn_wc__delete_many(svn_wc_context_t *wc
                                     cancel_func, cancel_baton,
                                     notify_func, notify_baton, scratch_pool));
 
-  if (!keep_local && conflicted && conflicts != NULL)
+  if (!keep_local && conflicts != NULL)
     {
       svn_pool_clear(iterpool);
 
@@ -1460,11 +1461,11 @@ remove_conflict_file(svn_boolean_t *noti
 static int
 compare_revert_list_copied_children(const void *a, const void *b)
 {
-  const svn_wc__db_revert_list_copied_child_info_t *ca = a;
-  const svn_wc__db_revert_list_copied_child_info_t *cb = b;
+  const svn_wc__db_revert_list_copied_child_info_t * const *ca = a;
+  const svn_wc__db_revert_list_copied_child_info_t * const *cb = b;
   int i;
 
-  i = svn_path_compare_paths(ca->abspath, cb->abspath);
+  i = svn_path_compare_paths(ca[0]->abspath, cb[0]->abspath);
 
   /* Reverse the result of svn_path_compare_paths() to achieve
    * descending order. */
@@ -1736,8 +1737,15 @@ revert_restore(svn_wc__db_t *db,
         }
       else if (on_disk == svn_node_file && kind != svn_kind_file)
         {
-          SVN_ERR(svn_io_remove_file2(local_abspath, FALSE, scratch_pool));
-          on_disk = svn_node_none;
+#ifdef HAVE_SYMLINK
+          /* Preserve symlinks pointing at directories. Changes on the
+           * directory node have been reverted. The symlink should remain. */
+          if (!(special && kind == svn_kind_dir))
+#endif
+            {
+              SVN_ERR(svn_io_remove_file2(local_abspath, FALSE, scratch_pool));
+              on_disk = svn_node_none;
+            }
         }
       else if (on_disk == svn_node_file)
         {

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/copy.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/copy.c Mon Jul 30 06:39:28 2012
@@ -435,6 +435,7 @@ copy_versioned_dir(svn_wc__db_t *db,
         SVN_ERR(svn_wc__db_op_copy_shadowed_layer(db,
                                                   child_src_abspath,
                                                   child_dst_abspath,
+                                                  is_move,
                                                   scratch_pool));
 
       if (child_status == svn_wc__db_status_normal
@@ -984,6 +985,7 @@ svn_wc_move(svn_wc_context_t *wc_ctx,
             apr_pool_t *scratch_pool)
 {
   svn_wc__db_t *db = wc_ctx->db;
+
   SVN_ERR(copy_or_move(wc_ctx, src_abspath, dst_abspath,
                        TRUE /* metadata_only */,
                        TRUE /* is_move */,
@@ -991,6 +993,10 @@ svn_wc_move(svn_wc_context_t *wc_ctx,
                        notify_func, notify_baton,
                        scratch_pool));
 
+  /* An iterrupt at this point will leave the new copy marked as
+     moved-here but the source has not yet been deleted or marked as
+     moved-to. */
+
   /* Should we be using a workqueue for this move?  It's not clear.
      What should happen if the copy above is interrupted?  The user
      may want to abort the move and a workqueue might interfere with

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/deprecated.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/deprecated.c Mon Jul 30 06:39:28 2012
@@ -1907,6 +1907,43 @@ static struct svn_wc_diff_callbacks4_t d
   wrap_4to3_dir_closed
 };
 
+
+svn_error_t *
+svn_wc_get_diff_editor6(const svn_delta_editor_t **editor,
+                        void **edit_baton,
+                        svn_wc_context_t *wc_ctx,
+                        const char *anchor_abspath,
+                        const char *target,
+                        svn_depth_t depth,
+                        svn_boolean_t ignore_ancestry,
+                        svn_boolean_t show_copies_as_adds,
+                        svn_boolean_t use_git_diff_format,
+                        svn_boolean_t use_text_base,
+                        svn_boolean_t reverse_order,
+                        svn_boolean_t server_performs_filtering,
+                        const apr_array_header_t *changelist_filter,
+                        const svn_wc_diff_callbacks4_t *callbacks,
+                        void *callback_baton,
+                        svn_cancel_func_t cancel_func,
+                        void *cancel_baton,
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(
+    svn_wc__get_diff_editor(editor, edit_baton,
+                            wc_ctx,
+                            anchor_abspath, target,
+                            depth,
+                            ignore_ancestry, show_copies_as_adds,
+                            use_git_diff_format, use_text_base,
+                            reverse_order, server_performs_filtering,
+                            changelist_filter,
+                            callbacks, callback_baton,
+                            cancel_func, cancel_baton,
+                            result_pool, scratch_pool));
+}
+
+
 svn_error_t *
 svn_wc_get_diff_editor5(svn_wc_adm_access_t *anchor,
                         const char *target,
@@ -2585,6 +2622,47 @@ status4_wrapper_func(void *baton,
   return (*swb->old_func)(swb->old_baton, path, dup, scratch_pool);
 }
 
+
+svn_error_t *
+svn_wc_get_status_editor5(const svn_delta_editor_t **editor,
+                          void **edit_baton,
+                          void **set_locks_baton,
+                          svn_revnum_t *edit_revision,
+                          svn_wc_context_t *wc_ctx,
+                          const char *anchor_abspath,
+                          const char *target_basename,
+                          svn_depth_t depth,
+                          svn_boolean_t get_all,
+                          svn_boolean_t no_ignore,
+                          svn_boolean_t depth_as_sticky,
+                          svn_boolean_t server_performs_filtering,
+                          const apr_array_header_t *ignore_patterns,
+                          svn_wc_status_func4_t status_func,
+                          void *status_baton,
+                          svn_cancel_func_t cancel_func,
+                          void *cancel_baton,
+                          apr_pool_t *result_pool,
+                          apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(
+    svn_wc__get_status_editor(editor, edit_baton,
+                              set_locks_baton,
+                              edit_revision,
+                              wc_ctx,
+                              anchor_abspath,
+                              target_basename,
+                              depth,
+                              get_all, no_ignore,
+                              depth_as_sticky,
+                              server_performs_filtering,
+                              ignore_patterns,
+                              status_func, status_baton,
+                              cancel_func, cancel_baton,
+                              result_pool,
+                              scratch_pool));
+}
+
+
 svn_error_t *
 svn_wc_get_status_editor4(const svn_delta_editor_t **editor,
                           void **edit_baton,
@@ -3154,6 +3232,59 @@ svn_wc_is_wc_root(svn_boolean_t *wc_root
   return svn_error_trace(svn_wc_context_destroy(wc_ctx));
 }
 
+
+svn_error_t *
+svn_wc_get_update_editor4(const svn_delta_editor_t **editor,
+                          void **edit_baton,
+                          svn_revnum_t *target_revision,
+                          svn_wc_context_t *wc_ctx,
+                          const char *anchor_abspath,
+                          const char *target_basename,
+                          svn_boolean_t use_commit_times,
+                          svn_depth_t depth,
+                          svn_boolean_t depth_is_sticky,
+                          svn_boolean_t allow_unver_obstructions,
+                          svn_boolean_t adds_as_modification,
+                          svn_boolean_t server_performs_filtering,
+                          svn_boolean_t clean_checkout,
+                          const char *diff3_cmd,
+                          const apr_array_header_t *preserved_exts,
+                          svn_wc_dirents_func_t fetch_dirents_func,
+                          void *fetch_dirents_baton,
+                          svn_wc_conflict_resolver_func2_t conflict_func,
+                          void *conflict_baton,
+                          svn_wc_external_update_t external_func,
+                          void *external_baton,
+                          svn_cancel_func_t cancel_func,
+                          void *cancel_baton,
+                          svn_wc_notify_func2_t notify_func,
+                          void *notify_baton,
+                          apr_pool_t *result_pool,
+                          apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(
+    svn_wc__get_update_editor(editor, edit_baton,
+                              target_revision,
+                              wc_ctx,
+                              anchor_abspath,
+                              target_basename,
+                              use_commit_times,
+                              depth, depth_is_sticky,
+                              allow_unver_obstructions,
+                              adds_as_modification,
+                              server_performs_filtering,
+                              clean_checkout,
+                              diff3_cmd,
+                              preserved_exts,
+                              fetch_dirents_func, fetch_dirents_baton,
+                              conflict_func, conflict_baton,
+                              external_func, external_baton,
+                              cancel_func, cancel_baton,
+                              notify_func, notify_baton,
+                              result_pool, scratch_pool));
+}
+
+
 svn_error_t *
 svn_wc_get_update_editor3(svn_revnum_t *target_revision,
                           svn_wc_adm_access_t *anchor,
@@ -3288,6 +3419,56 @@ svn_wc_get_update_editor(svn_revnum_t *t
                                    traversal_info, pool);
 }
 
+
+svn_error_t *
+svn_wc_get_switch_editor4(const svn_delta_editor_t **editor,
+                          void **edit_baton,
+                          svn_revnum_t *target_revision,
+                          svn_wc_context_t *wc_ctx,
+                          const char *anchor_abspath,
+                          const char *target_basename,
+                          const char *switch_url,
+                          svn_boolean_t use_commit_times,
+                          svn_depth_t depth,
+                          svn_boolean_t depth_is_sticky,
+                          svn_boolean_t allow_unver_obstructions,
+                          svn_boolean_t server_performs_filtering,
+                          const char *diff3_cmd,
+                          const apr_array_header_t *preserved_exts,
+                          svn_wc_dirents_func_t fetch_dirents_func,
+                          void *fetch_dirents_baton,
+                          svn_wc_conflict_resolver_func2_t conflict_func,
+                          void *conflict_baton,
+                          svn_wc_external_update_t external_func,
+                          void *external_baton,
+                          svn_cancel_func_t cancel_func,
+                          void *cancel_baton,
+                          svn_wc_notify_func2_t notify_func,
+                          void *notify_baton,
+                          apr_pool_t *result_pool,
+                          apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(
+    svn_wc__get_switch_editor(editor, edit_baton,
+                              target_revision,
+                              wc_ctx,
+                              anchor_abspath, target_basename,
+                              switch_url,
+                              use_commit_times,
+                              depth, depth_is_sticky,
+                              allow_unver_obstructions,
+                              server_performs_filtering,
+                              diff3_cmd,
+                              preserved_exts,
+                              fetch_dirents_func, fetch_dirents_baton,
+                              conflict_func, conflict_baton,
+                              external_func, external_baton,
+                              cancel_func, cancel_baton,
+                              notify_func, notify_baton,
+                              result_pool, scratch_pool));
+}
+
+
 svn_error_t *
 svn_wc_get_switch_editor3(svn_revnum_t *target_revision,
                           svn_wc_adm_access_t *anchor,

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/diff_editor.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/diff_editor.c Mon Jul 30 06:39:28 2012
@@ -1856,7 +1856,7 @@ close_edit(void *edit_baton,
 
 /* Create a diff editor and baton. */
 svn_error_t *
-svn_wc_get_diff_editor6(const svn_delta_editor_t **editor,
+svn_wc__get_diff_editor(const svn_delta_editor_t **editor,
                         void **edit_baton,
                         svn_wc_context_t *wc_ctx,
                         const char *anchor_abspath,
@@ -1880,6 +1880,7 @@ svn_wc_get_diff_editor6(const svn_delta_
   void *inner_baton;
   svn_delta_editor_t *tree_editor;
   const svn_delta_editor_t *inner_editor;
+  struct svn_wc__shim_fetch_baton_t *sfb;
   svn_delta_shim_callbacks_t *shim_callbacks =
                                 svn_delta_shim_callbacks_default(result_pool);
 
@@ -1933,6 +1934,17 @@ svn_wc_get_diff_editor6(const svn_delta_
                                             edit_baton,
                                             result_pool));
 
+  sfb = apr_palloc(result_pool, sizeof(*sfb));
+  sfb->db = wc_ctx->db;
+  sfb->base_abspath = eb->anchor_abspath;
+  sfb->fetch_base = TRUE;
+
+  shim_callbacks->fetch_kind_func = svn_wc__fetch_kind_func;
+  shim_callbacks->fetch_props_func = svn_wc__fetch_props_func;
+  shim_callbacks->fetch_base_func = svn_wc__fetch_base_func;
+  shim_callbacks->fetch_baton = sfb;
+
+
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
                                    shim_callbacks, result_pool, scratch_pool));
 

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/externals.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/externals.c Mon Jul 30 06:39:28 2012
@@ -300,8 +300,13 @@ svn_wc_parse_externals_description3(apr_
 
       item->target_dir = svn_dirent_internal_style(item->target_dir, pool);
 
-      if (item->target_dir[0] == '\0' || item->target_dir[0] == '/'
-          || svn_path_is_backpath_present(item->target_dir))
+      if (item->target_dir[0] == '\0'
+          || svn_dirent_is_absolute(item->target_dir)
+          || svn_path_is_backpath_present(item->target_dir)
+          || !svn_dirent_skip_ancestor("dummy",
+                                       svn_dirent_join("dummy",
+                                                       item->target_dir,
+                                                       pool)))
         return svn_error_createf
           (SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION, NULL,
            _("Invalid %s property on '%s': "
@@ -616,8 +621,13 @@ close_file(void *file_baton,
       {
         new_checksum = eb->original_checksum;
 
-        SVN_ERR(svn_wc__db_base_get_props(&actual_props, eb->db,
-                                          eb->local_abspath, pool, pool));
+        if (eb->had_props)
+          SVN_ERR(svn_wc__db_base_get_props(&base_props, eb->db,
+                                            eb->local_abspath,
+                                            pool, pool));
+
+        SVN_ERR(svn_wc__db_read_props(&actual_props, eb->db,
+                                      eb->local_abspath, pool, pool));
       }
 
     if (!base_props)
@@ -1133,7 +1143,7 @@ is_external_rolled_out(svn_boolean_t *is
   err = svn_wc__node_get_origin(NULL, NULL,
                                 &x_repos_relpath,
                                 &x_repos_root_url,
-                                NULL,
+                                NULL, NULL,
                                 wc_ctx, xinfo->local_abspath,
                                 FALSE, /* scan_deleted */
                                 scratch_pool, scratch_pool);
@@ -1353,6 +1363,16 @@ svn_wc__externals_gather_definitions(apr
     }
 }
 
+svn_error_t *
+svn_wc__close_db(const char *external_abspath,
+                 svn_wc_context_t *wc_ctx,
+                 apr_pool_t *scratch_pool)
+{
+  SVN_ERR(svn_wc__db_drop_root(wc_ctx->db, external_abspath,
+                               scratch_pool));
+  return SVN_NO_ERROR;
+}
+
 /* Return the scheme of @a uri in @a scheme allocated from @a pool.
    If @a uri does not appear to be a valid URI, then @a scheme will
    not be updated.  */

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/info.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/info.c Mon Jul 30 06:39:28 2012
@@ -182,7 +182,7 @@ build_info_for_node(svn_wc__info2_t **in
           SVN_ERR(svn_wc__internal_get_origin(NULL, &tmpinfo->rev,
                                               &repos_relpath,
                                               &tmpinfo->repos_root_URL,
-                                              &tmpinfo->repos_UUID,
+                                              &tmpinfo->repos_UUID, NULL,
                                               db, local_abspath, TRUE,
                                               result_pool, scratch_pool));
         }

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/node.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/node.c Mon Jul 30 06:39:28 2012
@@ -1349,6 +1349,7 @@ svn_wc__internal_get_origin(svn_boolean_
                             const char **repos_relpath,
                             const char **repos_root_url,
                             const char **repos_uuid,
+                            const char **copy_root_abspath,
                             svn_wc__db_t *db,
                             const char *local_abspath,
                             svn_boolean_t scan_deleted,
@@ -1399,7 +1400,8 @@ svn_wc__internal_get_origin(svn_boolean_
       if (repos_uuid)
         *repos_uuid = original_repos_uuid;
 
-      return SVN_NO_ERROR;
+      if (copy_root_abspath == NULL)
+        return SVN_NO_ERROR;
     }
 
   {
@@ -1428,13 +1430,19 @@ svn_wc__internal_get_origin(svn_boolean_
                                          result_pool, scratch_pool));
 
         if (status == svn_wc__db_status_added)
-          return SVN_NO_ERROR; /* Local addition */
+          {
+            if (is_copy)
+              *is_copy = FALSE;
+            return SVN_NO_ERROR; /* Local addition */
+          }
 
         *repos_relpath = svn_relpath_join(
                                 original_repos_relpath,
                                 svn_dirent_skip_ancestor(op_root_abspath,
                                                          local_abspath),
                                 result_pool);
+        if (copy_root_abspath)
+          *copy_root_abspath = op_root_abspath;
       }
     else /* Deleted, excluded, not-present, server-excluded, ... */
       {
@@ -1459,6 +1467,7 @@ svn_wc__node_get_origin(svn_boolean_t *i
                         const char **repos_relpath,
                         const char **repos_root_url,
                         const char **repos_uuid,
+                        const char **copy_root_abspath,
                         svn_wc_context_t *wc_ctx,
                         const char *local_abspath,
                         svn_boolean_t scan_deleted,
@@ -1467,6 +1476,7 @@ svn_wc__node_get_origin(svn_boolean_t *i
 {
   return svn_error_trace(svn_wc__internal_get_origin(is_copy, revision,
                            repos_relpath, repos_root_url, repos_uuid,
+                           copy_root_abspath,
                            wc_ctx->db, local_abspath, scan_deleted,
                            result_pool, scratch_pool));
 }

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/questions.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/questions.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/questions.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/questions.c Mon Jul 30 06:39:28 2012
@@ -531,19 +531,6 @@ svn_wc__min_max_revisions(svn_revnum_t *
 
 
 svn_error_t *
-svn_wc__is_sparse_checkout(svn_boolean_t *is_sparse_checkout,
-                           svn_wc_context_t *wc_ctx,
-                           const char *local_abspath,
-                           apr_pool_t *scratch_pool)
-{
-  return svn_error_trace(svn_wc__db_is_sparse_checkout(is_sparse_checkout,
-                                                       wc_ctx->db,
-                                                       local_abspath,
-                                                       scratch_pool));
-}
-
-
-svn_error_t *
 svn_wc__has_switched_subtrees(svn_boolean_t *is_switched,
                               svn_wc_context_t *wc_ctx,
                               const char *local_abspath,

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/status.c?rev=1367002&r1=1367001&r2=1367002&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/status.c Mon Jul 30 06:39:28 2012
@@ -1318,13 +1318,37 @@ get_dir_status(const struct walk_status_
 
   /* Handle "this-dir" first. */
   if (! skip_this_dir)
-    SVN_ERR(send_status_structure(wb, local_abspath,
-                                  parent_repos_root_url,
-                                  parent_repos_relpath,
-                                  parent_repos_uuid,
-                                  dir_info, dirent, get_all,
-                                  status_func, status_baton,
-                                  iterpool));
+    {
+#ifdef HAVE_SYMLINK
+      if (dirent->special)
+        {
+          svn_io_dirent2_t *this_dirent = svn_io_dirent2_dup(dirent, iterpool);
+
+          /* We're being pointed to "this-dir" via a symlink.
+           * Get the real node kind and pretend the path is not a symlink.
+           * This prevents send_status_structure() from treating this-dir
+           * as a directory obstructed by a file. */
+          SVN_ERR(svn_io_check_resolved_path(local_abspath,
+                                             &this_dirent->kind, iterpool));
+          this_dirent->special = FALSE;
+          SVN_ERR(send_status_structure(wb, local_abspath,
+                                        parent_repos_root_url,
+                                        parent_repos_relpath,
+                                        parent_repos_uuid,
+                                        dir_info, this_dirent, get_all,
+                                        status_func, status_baton,
+                                        iterpool));
+        }
+     else
+#endif
+        SVN_ERR(send_status_structure(wb, local_abspath,
+                                      parent_repos_root_url,
+                                      parent_repos_relpath,
+                                      parent_repos_uuid,
+                                      dir_info, dirent, get_all,
+                                      status_func, status_baton,
+                                      iterpool));
+    }
 
   /* If the requested depth is empty, we only need status on this-dir. */
   if (depth == svn_depth_empty)
@@ -1649,7 +1673,7 @@ tweak_statushash(void *baton,
   return SVN_NO_ERROR;
 }
 
-/* Returns the URL for DB, or NULL: */
+/* Returns the URL for DB */
 static const char *
 find_dir_repos_relpath(const struct dir_baton *db, apr_pool_t *pool)
 {
@@ -1666,14 +1690,11 @@ find_dir_repos_relpath(const struct dir_
       /* Note that status->repos_relpath could be NULL in the case of a missing
        * directory, which means we need to recurse up another level to get
        * a useful relpath. */
-      if (status)
+      if (status && status->repos_relpath)
         return status->repos_relpath;
 
       repos_relpath = find_dir_repos_relpath(pb, pool);
-      if (repos_relpath)
-        return svn_relpath_join(repos_relpath, db->name, pool);
-      else
-        return NULL;
+      return svn_relpath_join(repos_relpath, db->name, pool);
     }
 }
 
@@ -2369,19 +2390,15 @@ close_file(void *file_baton,
           const char *dir_repos_relpath = find_dir_repos_relpath(fb->dir_baton,
                                                                  pool);
 
-          if (dir_repos_relpath)
-            {
-              /* repos_lock still uses the deprecated filesystem absolute path
-                 format */
-
-              const char *repos_relpath = svn_relpath_join(dir_repos_relpath,
-                                                           fb->name, pool);
-
-              repos_lock = apr_hash_get(fb->edit_baton->wb.repos_locks,
-                                        svn_fspath__join("/", repos_relpath,
-                                                         pool),
-                                        APR_HASH_KEY_STRING);
-            }
+          /* repos_lock still uses the deprecated filesystem absolute path
+             format */
+          const char *repos_relpath = svn_relpath_join(dir_repos_relpath,
+                                                       fb->name, pool);
+
+          repos_lock = apr_hash_get(fb->edit_baton->wb.repos_locks,
+                                    svn_fspath__join("/", repos_relpath,
+                                                     pool),
+                                    APR_HASH_KEY_STRING);
         }
     }
   else
@@ -2432,7 +2449,7 @@ close_edit(void *edit_baton,
 /*** Public API ***/
 
 svn_error_t *
-svn_wc_get_status_editor5(const svn_delta_editor_t **editor,
+svn_wc__get_status_editor(const svn_delta_editor_t **editor,
                           void **edit_baton,
                           void **set_locks_baton,
                           svn_revnum_t *edit_revision,
@@ -2455,6 +2472,7 @@ svn_wc_get_status_editor5(const svn_delt
   struct edit_baton *eb;
   svn_delta_editor_t *tree_editor = svn_delta_default_editor(result_pool);
   void *inner_baton;
+  struct svn_wc__shim_fetch_baton_t *sfb;
   const svn_delta_editor_t *inner_editor;
   svn_delta_shim_callbacks_t *shim_callbacks =
                                 svn_delta_shim_callbacks_default(result_pool);
@@ -2545,6 +2563,16 @@ svn_wc_get_status_editor5(const svn_delt
   if (set_locks_baton)
     *set_locks_baton = eb;
 
+  sfb = apr_palloc(result_pool, sizeof(*sfb));
+  sfb->db = wc_ctx->db;
+  sfb->base_abspath = eb->anchor_abspath;
+  sfb->fetch_base = FALSE;
+
+  shim_callbacks->fetch_kind_func = svn_wc__fetch_kind_func;
+  shim_callbacks->fetch_props_func = svn_wc__fetch_props_func;
+  shim_callbacks->fetch_base_func = svn_wc__fetch_base_func;
+  shim_callbacks->fetch_baton = sfb;
+
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
                                    shim_callbacks,
                                    result_pool, scratch_pool));
@@ -2606,7 +2634,11 @@ svn_wc__internal_walk_status(svn_wc__db_
   SVN_ERR(svn_io_stat_dirent(&dirent, local_abspath, TRUE,
                              scratch_pool, scratch_pool));
 
-  if (info && info->kind == svn_kind_dir)
+  if (info
+      && info->kind == svn_kind_dir
+      && info->status != svn_wc__db_status_not_present
+      && info->status != svn_wc__db_status_excluded
+      && info->status != svn_wc__db_status_server_excluded)
     {
       SVN_ERR(get_dir_status(&wb,
                              local_abspath,