You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2012/03/05 10:25:33 UTC

svn commit: r1296975 [7/12] - in /subversion/branches/revprop-packing: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ build/win32/ notes/ notes/api-errata/1.7/ subversion/bindings/javahl/native/ subversion/bindings/javahl/tests/...

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/simple_providers.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/simple_providers.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/simple_providers.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/simple_providers.c Mon Mar  5 09:25:25 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,
@@ -458,9 +473,9 @@ svn_auth__simple_save_creds_helper(svn_b
 
       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/revprop-packing/subversion/libsvn_subr/skel.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/skel.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/skel.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/skel.c Mon Mar  5 09:25:25 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/revprop-packing/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/sqlite.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/sqlite.c Mon Mar  5 09:25:25 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/revprop-packing/subversion/libsvn_subr/ssl_client_cert_pw_providers.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/ssl_client_cert_pw_providers.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/ssl_client_cert_pw_providers.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/ssl_client_cert_pw_providers.c Mon Mar  5 09:25:25 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;
         }
     }
@@ -305,9 +313,9 @@ svn_auth__ssl_client_cert_pw_file_save_c
 
       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/revprop-packing/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/stream.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/stream.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/stream.c Mon Mar  5 09:25:25 2012
@@ -377,7 +377,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;
@@ -1031,7 +1031,7 @@ read_handler_gz(void *baton, char *buffe
     }
 
   btn->in->next_out = (Bytef *) buffer;
-  btn->in->avail_out = *len;
+  btn->in->avail_out = (uInt) *len;
 
   while (btn->in->avail_out > 0)
     {
@@ -1090,12 +1090,12 @@ 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(svn_error__wrap_zlib(zerr, "deflate", btn->out->msg));

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/svn_base64.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/svn_base64.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/svn_base64.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/svn_base64.c Mon Mar  5 09:25:25 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/revprop-packing/subversion/libsvn_subr/svn_mutex.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/svn_mutex.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/svn_mutex.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/svn_mutex.c Mon Mar  5 09:25:25 2012
@@ -25,8 +25,8 @@
 #include "private/svn_mutex.h"
 
 svn_error_t *
-svn_mutex__init(svn_mutex__t **mutex_p, 
-                svn_boolean_t mutex_required, 
+svn_mutex__init(svn_mutex__t **mutex_p,
+                svn_boolean_t mutex_required,
                 apr_pool_t *result_pool)
 {
   /* always initialize the mutex pointer, even though it is not
@@ -47,7 +47,7 @@ svn_mutex__init(svn_mutex__t **mutex_p, 
       *mutex_p = apr_mutex;
     }
 #endif
-    
+
   return SVN_NO_ERROR;
 }
 
@@ -67,7 +67,7 @@ svn_mutex__lock(svn_mutex__t *mutex)
 }
 
 svn_error_t *
-svn_mutex__unlock(svn_mutex__t *mutex, 
+svn_mutex__unlock(svn_mutex__t *mutex,
                   svn_error_t *err)
 {
 #if APR_HAS_THREADS

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/svn_string.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/svn_string.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/svn_string.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/svn_string.c Mon Mar  5 09:25:25 2012
@@ -133,7 +133,7 @@ create_string(const char *data, apr_size
 }
 
 static char empty_buffer[1] = {0};
-  
+
 svn_string_t *
 svn_string_create_empty(apr_pool_t *pool)
 {
@@ -302,7 +302,7 @@ svn_stringbuf_create_empty(apr_pool_t *p
 {
   /* All instances share the same zero-length buffer.
    * Some algorithms, however, assume that they may write
-   * the terminating zero. So, empty_buffer must be writable 
+   * the terminating zero. So, empty_buffer must be writable
    * (a simple (char *)"" will cause SEGFAULTs). */
 
   return create_stringbuf(empty_buffer, 0, 0, pool);
@@ -717,7 +717,7 @@ svn_cstring_match_list(const char *str, 
   return FALSE;
 }
 
-char * 
+char *
 svn_cstring_tokenize(const char *sep, char **str)
 {
     char *token;
@@ -742,7 +742,7 @@ svn_cstring_tokenize(const char *sep, ch
         return NULL;
 
     /* skip valid token characters to terminate token and
-     * prepare for the next call (will terminate at '\0) 
+     * prepare for the next call (will terminate at '\0)
      */
     next = strchr(token, csep);
     if (next == NULL)

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/utf.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/utf.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/utf.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/utf.c Mon Mar  5 09:25:25 2012
@@ -200,8 +200,8 @@ atomic_swap(void * volatile * mem, void 
 #endif
 }
 
-/* Set *RET to a newly created handle node for converting from FROMPAGE 
-   to TOPAGE, If apr_xlate_open() returns APR_EINVAL or APR_ENOTIMPL, set 
+/* Set *RET to a newly created handle node for converting from FROMPAGE
+   to TOPAGE, If apr_xlate_open() returns APR_EINVAL or APR_ENOTIMPL, set
    (*RET)->handle to NULL.  If fail for any other reason, return the error.
    Allocate *RET and its xlate handle in POOL. */
 static svn_error_t *
@@ -274,11 +274,11 @@ xlate_alloc_handle(xlate_handle_node_t *
 
 /* Extend xlate_alloc_handle by using USERDATA_KEY as a key in our
    global hash map, if available.
-   
+
    Allocate *RET and its xlate handle in POOL if svn_utf_initialize()
    hasn't been called or USERDATA_KEY is NULL.  Else, allocate them
    in the pool of xlate_handle_hash.
-   
+
    Note: this function is not thread-safe. Call get_xlate_handle_node
    instead. */
 static svn_error_t *
@@ -292,7 +292,7 @@ get_xlate_handle_node_internal(xlate_han
       xlate_handle_node_t *old_node = NULL;
 
       /* 2nd level: hash lookup */
-      xlate_handle_node_t **old_node_p = apr_hash_get(xlate_handle_hash, 
+      xlate_handle_node_t **old_node_p = apr_hash_get(xlate_handle_hash,
                                                       userdata_key,
                                                       APR_HASH_KEY_STRING);
       if (old_node_p)
@@ -381,7 +381,7 @@ get_xlate_handle_node(xlate_handle_node_
 }
 
 /* Put back NODE into the xlate handle cache for use by other calls.
-   
+
    Note: this function is not thread-safe. Call put_xlate_handle_node
    instead. */
 static svn_error_t *
@@ -403,7 +403,7 @@ put_xlate_handle_node_internal(xlate_han
     }
   node->next = *node_p;
   *node_p = node;
-  
+
   return SVN_NO_ERROR;
 }
 
@@ -431,7 +431,7 @@ put_xlate_handle_node(xlate_handle_node_
         return SVN_NO_ERROR;
 
       SVN_MUTEX__WITH_LOCK(xlate_handle_mutex,
-                           put_xlate_handle_node_internal(node, 
+                           put_xlate_handle_node_internal(node,
                                                           userdata_key));
     }
   else
@@ -439,7 +439,7 @@ put_xlate_handle_node(xlate_handle_node_
       /* Store it in the per-pool cache. */
       apr_pool_userdata_set(node, userdata_key, apr_pool_cleanup_null, pool);
     }
-    
+
   return SVN_NO_ERROR;
 }
 
@@ -748,7 +748,7 @@ svn_utf_stringbuf_to_utf8(svn_stringbuf_
 
   return svn_error_compose_create(err,
                                   put_xlate_handle_node
-                                     (node, 
+                                     (node,
                                       SVN_UTF_NTOU_XLATE_HANDLE,
                                       pool));
 }
@@ -782,7 +782,7 @@ svn_utf_string_to_utf8(const svn_string_
 
   return svn_error_compose_create(err,
                                   put_xlate_handle_node
-                                     (node, 
+                                     (node,
                                       SVN_UTF_NTOU_XLATE_HANDLE,
                                       pool));
 }
@@ -827,7 +827,7 @@ svn_utf_cstring_to_utf8(const char **des
   err = convert_cstring(dest, src, node, pool);
   SVN_ERR(svn_error_compose_create(err,
                                    put_xlate_handle_node
-                                      (node, 
+                                      (node,
                                        SVN_UTF_NTOU_XLATE_HANDLE,
                                        pool)));
   return check_cstring_utf8(*dest, pool);
@@ -850,7 +850,7 @@ svn_utf_cstring_to_utf8_ex2(const char *
   err = convert_cstring(dest, src, node, pool);
   SVN_ERR(svn_error_compose_create(err,
                                    put_xlate_handle_node
-                                      (node, 
+                                      (node,
                                        SVN_UTF_NTOU_XLATE_HANDLE,
                                        pool)));
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/win32_crypto.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/win32_crypto.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/win32_crypto.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/win32_crypto.c Mon Mar  5 09:25:25 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/revprop-packing/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/adm_ops.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/adm_ops.c Mon Mar  5 09:25:25 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);
 
@@ -1711,7 +1712,7 @@ revert_restore(svn_wc__db_t *db,
           svn_boolean_t removed;
 
           SVN_ERR(revert_restore_handle_copied_dirs(&removed, db,
-                                                    local_abspath, TRUE, 
+                                                    local_abspath, TRUE,
                                                     cancel_func, cancel_baton,
                                                     scratch_pool));
           if (removed)
@@ -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/revprop-packing/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/deprecated.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/deprecated.c Mon Mar  5 09:25:25 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/revprop-packing/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/diff_editor.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/diff_editor.c Mon Mar  5 09:25:25 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,

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/entries.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/entries.c Mon Mar  5 09:25:25 2012
@@ -1897,7 +1897,7 @@ write_entry(struct write_baton **entry_n
         }
       else if (entry->absent)
         {
-          SVN_ERR_ASSERT(base_node->presence 
+          SVN_ERR_ASSERT(base_node->presence
                                 == svn_wc__db_status_server_excluded);
           /* ### should be svn_node_unknown, but let's store what we have. */
           base_node->kind = entry->kind;

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/externals.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/externals.c Mon Mar  5 09:25:25 2012
@@ -1181,7 +1181,7 @@ svn_wc__committable_externals_below(apr_
                                                  local_abspath,
                                                  depth != svn_depth_infinity,
                                                  result_pool, scratch_pool));
-  
+
   if (orig_externals == NULL)
     return SVN_NO_ERROR;
 
@@ -1363,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/revprop-packing/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/props.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/props.c Mon Mar  5 09:25:25 2012
@@ -2546,7 +2546,8 @@ svn_wc_canonicalize_svn_prop(const svn_s
            || strcmp(propname, SVN_PROP_EXTERNALS) == 0)
     {
       /* Make sure that the last line ends in a newline */
-      if (propval->data[propval->len - 1] != '\n')
+      if (propval->len == 0
+          || propval->data[propval->len - 1] != '\n')
         {
           new_value = svn_stringbuf_create_from_string(propval, pool);
           svn_stringbuf_appendbyte(new_value, '\n');

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/status.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/status.c Mon Mar  5 09:25:25 2012
@@ -294,7 +294,7 @@ read_info(const struct svn_wc__db_info_t
         {
           const char *moved_to_abspath;
           const char *moved_to_op_root_abspath;
-          
+
           /* NOTE: we can't use op-root-ness as a condition here since a base
            * node can be the root of a move and still not be an explicit
            * op-root (having a working node with op_depth == pathelements).
@@ -303,7 +303,7 @@ read_info(const struct svn_wc__db_info_t
            *   svn mv a/b bb
            *   svn del a
            * and
-           *   svn mv a aa  
+           *   svn mv a aa
            *   svn mv aa/b bb
            * In both, 'bb' is moved from 'a/b', but 'a/b' has no op_depth>0
            * node at all, as its parent 'a' is locally deleted. */
@@ -1203,7 +1203,7 @@ one_child_status(const struct walk_statu
   /* The node exists on disk but there is no versioned information about it,
    * or it doesn't exist but is a tree conflicted path or should be
    * reported not-present. */
-   
+
   /* Why pass ignore patterns on a tree conflicted node, even if it should
    * always show up in clients' status reports anyway? Because the calling
    * client decides whether to ignore, and thus this flag needs to be
@@ -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)
@@ -1594,9 +1618,9 @@ tweak_statushash(void *baton,
           else
             statstruct->repos_relpath = apr_pstrdup(pool, b->repos_relpath);
 
-          statstruct->repos_root_url = 
+          statstruct->repos_root_url =
                               b->edit_baton->anchor_status->repos_root_url;
-          statstruct->repos_uuid = 
+          statstruct->repos_uuid =
                               b->edit_baton->anchor_status->repos_uuid;
         }
 
@@ -2425,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,

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/update_editor.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/update_editor.c Mon Mar  5 09:25:25 2012
@@ -4581,7 +4581,7 @@ close_file(void *file_baton,
 
       /* If the file was moved-away, notify for the moved-away node.
        * The original location only had its BASE info changed and
-       * we don't usually notify about such changes. */ 
+       * we don't usually notify about such changes. */
       notify = svn_wc_create_notify(working_abspath, action, scratch_pool);
       notify->kind = svn_node_file;
       notify->content_state = content_state;
@@ -5003,7 +5003,7 @@ make_editor(svn_revnum_t *target_revisio
 
 
 svn_error_t *
-svn_wc_get_update_editor4(const svn_delta_editor_t **editor,
+svn_wc__get_update_editor(const svn_delta_editor_t **editor,
                           void **edit_baton,
                           svn_revnum_t *target_revision,
                           svn_wc_context_t *wc_ctx,
@@ -5046,7 +5046,7 @@ svn_wc_get_update_editor4(const svn_delt
 }
 
 svn_error_t *
-svn_wc_get_switch_editor4(const svn_delta_editor_t **editor,
+svn_wc__get_switch_editor(const svn_delta_editor_t **editor,
                           void **edit_baton,
                           svn_revnum_t *target_revision,
                           svn_wc_context_t *wc_ctx,

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/util.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/util.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/util.c Mon Mar  5 09:25:25 2012
@@ -548,7 +548,7 @@ svn_wc__fetch_kind_func(svn_kind_t *kind
 
   SVN_ERR(svn_wc__db_read_kind(kind, sfb->db, local_abspath, FALSE,
                                scratch_pool));
-  
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.c Mon Mar  5 09:25:25 2012
@@ -3672,7 +3672,7 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
                   dst_wcroot->wc_id,
                   dst_relpath,
                   copyfrom_id,
-                  copyfrom_relpath, 
+                  copyfrom_relpath,
                   copyfrom_rev,
                   children,
                   dst_op_depth,
@@ -6600,7 +6600,7 @@ op_delete_many_txn(void *baton,
       const char *target_relpath = APR_ARRAY_IDX(odmb->rel_targets, i,
                                                  const char *);
       struct op_delete_baton_t odb;
-      
+
       svn_pool_clear(iterpool);
       odb.delete_depth = relpath_depth(target_relpath);
       odb.moved_to_relpath = NULL;
@@ -6686,7 +6686,7 @@ svn_wc__db_op_delete(svn_wc__db_t *db,
                                                 db, local_abspath,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
-  
+
   if (moved_to_abspath)
     {
       SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&moved_to_wcroot,
@@ -6774,7 +6774,7 @@ svn_wc__db_op_delete_many(svn_wc__db_t *
 
     }
   svn_pool_destroy(iterpool);
-  
+
   /* Perform the deletion operation (transactionally), perform any
      notifications necessary, and then clean out our temporary tables.  */
   return svn_error_trace(with_finalization(wcroot, wcroot->abspath,
@@ -7120,7 +7120,7 @@ read_info(svn_wc__db_status_t *status,
     err = svn_error_compose_create(err, svn_sqlite__reset(stmt_act));
 
   if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
-    err = svn_error_quick_wrap(err, 
+    err = svn_error_quick_wrap(err,
                                apr_psprintf(scratch_pool,
                                             "Error reading node '%s'",
                                             local_relpath));
@@ -7132,6 +7132,49 @@ read_info(svn_wc__db_status_t *status,
 
 
 svn_error_t *
+svn_wc__db_read_info_internal(svn_wc__db_status_t *status,
+                              svn_kind_t *kind,
+                              svn_revnum_t *revision,
+                              const char **repos_relpath,
+                              apr_int64_t *repos_id,
+                              svn_revnum_t *changed_rev,
+                              apr_time_t *changed_date,
+                              const char **changed_author,
+                              svn_depth_t *depth,
+                              const svn_checksum_t **checksum,
+                              const char **target,
+                              const char **original_repos_relpath,
+                              apr_int64_t *original_repos_id,
+                              svn_revnum_t *original_revision,
+                              svn_wc__db_lock_t **lock,
+                              svn_filesize_t *recorded_size,
+                              apr_time_t *recorded_mod_time,
+                              const char **changelist,
+                              svn_boolean_t *conflicted,
+                              svn_boolean_t *op_root,
+                              svn_boolean_t *had_props,
+                              svn_boolean_t *props_mod,
+                              svn_boolean_t *have_base,
+                              svn_boolean_t *have_more_work,
+                              svn_boolean_t *have_work,
+                              svn_wc__db_wcroot_t *wcroot,
+                              const char *local_relpath,
+                              apr_pool_t *result_pool,
+                              apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(
+           read_info(status, kind, revision, repos_relpath, repos_id,
+                     changed_rev, changed_date, changed_author,
+                     depth, checksum, target, original_repos_relpath,
+                     original_repos_id, original_revision, lock,
+                     recorded_size, recorded_mod_time, changelist, conflicted,
+                     op_root, had_props, props_mod,
+                     have_base, have_more_work, have_work,
+                     wcroot, local_relpath, result_pool, scratch_pool));
+}
+
+
+svn_error_t *
 svn_wc__db_read_info(svn_wc__db_status_t *status,
                      svn_kind_t *kind,
                      svn_revnum_t *revision,
@@ -7385,7 +7428,7 @@ read_children_info(void *baton,
                                                     result_pool);
 
           /* Moved-to is only stored at op_depth 0. */
-          moved_to_relpath = svn_sqlite__column_text(stmt, 21, NULL); 
+          moved_to_relpath = svn_sqlite__column_text(stmt, 21, NULL);
           if (moved_to_relpath)
             child_item->info.moved_to_abspath =
               svn_dirent_join(wcroot->abspath, moved_to_relpath, result_pool);
@@ -7419,7 +7462,6 @@ read_children_info(void *baton,
       struct svn_wc__db_info_t *child;
       const char *child_relpath = svn_sqlite__column_text(stmt, 7, NULL);
       const char *name = svn_relpath_basename(child_relpath, NULL);
-      svn_error_t *err;
 
       child_item = apr_hash_get(nodes, name, APR_HASH_KEY_STRING);
       if (!child_item)
@@ -7436,6 +7478,7 @@ read_children_info(void *baton,
 #ifdef HAVE_SYMLINK
       if (child->props_mod)
         {
+          svn_error_t *err;
           apr_hash_t *properties;
 
           err = svn_sqlite__column_properties(&properties, stmt, 6,
@@ -10186,9 +10229,9 @@ scan_deletion_txn(void *baton,
               moved_to_relpath = svn_relpath_join(moved_to_op_root_relpath,
                                                   moved_child_relpath,
                                                   scratch_pool);
-              
+
               if (sd_baton->moved_to_relpath)
-                *sd_baton->moved_to_relpath = moved_to_relpath ? 
+                *sd_baton->moved_to_relpath = moved_to_relpath ?
                   apr_pstrdup(sd_baton->result_pool, moved_to_relpath) : NULL;
             }
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.h Mon Mar  5 09:25:25 2012
@@ -1535,7 +1535,7 @@ svn_wc__db_op_revert(svn_wc__db_t *db,
  * path was reverted.  Set *CONFLICT_OLD, *CONFLICT_NEW,
  * *CONFLICT_WORKING and *PROP_REJECT to the names of the conflict
  * files, or NULL if the names are not stored.
- * 
+ *
  * Set *COPIED_HERE if the reverted node was copied here and is the
  * operation root of the copy.
  * Set *KIND to the node kind of the reverted node.

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db_private.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db_private.h Mon Mar  5 09:25:25 2012
@@ -54,7 +54,7 @@ struct svn_wc__db_t {
   struct
   {
     svn_stringbuf_t *abspath;
-    svn_node_kind_t kind;
+    svn_kind_t kind;
   } parse_cache;
 
   /* As we grow the state of this DB, allocate that state here. */
@@ -174,6 +174,39 @@ svn_wc__db_util_open_db(svn_sqlite__db_t
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool);
 
+/* Like svn_wc__db_read_info(), but taking WCROOT+LOCAL_RELPATH instead of
+   DB+LOCAL_ABSPATH, and outputting repos ids instead of URL+UUID. */
+svn_error_t *
+svn_wc__db_read_info_internal(svn_wc__db_status_t *status,
+                              svn_kind_t *kind,
+                              svn_revnum_t *revision,
+                              const char **repos_relpath,
+                              apr_int64_t *repos_id,
+                              svn_revnum_t *changed_rev,
+                              apr_time_t *changed_date,
+                              const char **changed_author,
+                              svn_depth_t *depth,
+                              const svn_checksum_t **checksum,
+                              const char **target,
+                              const char **original_repos_relpath,
+                              apr_int64_t *original_repos_id,
+                              svn_revnum_t *original_revision,
+                              svn_wc__db_lock_t **lock,
+                              svn_filesize_t *recorded_size,
+                              apr_time_t *recorded_mod_time,
+                              const char **changelist,
+                              svn_boolean_t *conflicted,
+                              svn_boolean_t *op_root,
+                              svn_boolean_t *had_props,
+                              svn_boolean_t *props_mod,
+                              svn_boolean_t *have_base,
+                              svn_boolean_t *have_more_work,
+                              svn_boolean_t *have_work,
+                              svn_wc__db_wcroot_t *wcroot,
+                              const char *local_relpath,
+                              apr_pool_t *result_pool,
+                              apr_pool_t *scratch_pool);
+
 
 /* Transaction handling */
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db_wcroot.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db_wcroot.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db_wcroot.c Mon Mar  5 09:25:25 2012
@@ -100,16 +100,15 @@ get_old_version(int *version,
    of LOCAL_ABSPATH, using DB and SCRATCH_POOL as needed.
 
    This function may do strange things, but at long as it comes up with the
-   Right Answer, we should be happy.
-
-   Sets *KIND to svn_node_dir for symlinks. */
+   Right Answer, we should be happy. */
 static svn_error_t *
-get_path_kind(svn_node_kind_t *kind,
+get_path_kind(svn_kind_t *kind,
               svn_wc__db_t *db,
               const char *local_abspath,
               apr_pool_t *scratch_pool)
 {
   svn_boolean_t special;
+  svn_node_kind_t node_kind;
 
   /* This implements a *really* simple LRU cache, where "simple" is defined
      as "only one element".  In other words, we remember the most recently
@@ -133,12 +132,10 @@ get_path_kind(svn_node_kind_t *kind,
       svn_stringbuf_set(db->parse_cache.abspath, local_abspath);
     }
 
-  SVN_ERR(svn_io_check_special_path(local_abspath, &db->parse_cache.kind,
+  SVN_ERR(svn_io_check_special_path(local_abspath, &node_kind,
                                     &special, scratch_pool));
 
-  /* The wcroot could be a symlink to a directory. (Issue #2557, #3987) */
-  if (special)
-    db->parse_cache.kind = svn_node_dir;
+  db->parse_cache.kind = svn__kind_from_node_kind(node_kind, special);
   *kind = db->parse_cache.kind;
 
   return SVN_NO_ERROR;
@@ -366,7 +363,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv
 {
   const char *local_dir_abspath;
   const char *original_abspath = local_abspath;
-  svn_node_kind_t kind;
+  svn_kind_t kind;
   const char *build_relpath;
   svn_wc__db_wcroot_t *probe_wcroot;
   svn_wc__db_wcroot_t *found_wcroot = NULL;
@@ -402,7 +399,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv
      ### into wc_db which references a file. calls for directories could
      ### get an early-exit in the hash lookup just above.  */
   SVN_ERR(get_path_kind(&kind, db, local_abspath, scratch_pool));
-  if (kind != svn_node_dir)
+  if (kind != svn_kind_dir)
     {
       /* If the node specified by the path is NOT present, then it cannot
          possibly be a directory containing ".svn/wc.db".
@@ -437,7 +434,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv
          many ancestors need to be scanned until we start hitting content
          on the disk. Set ALWAYS_CHECK to keep looking for .svn/entries
          rather than bailing out after the first check.  */
-      if (kind == svn_node_none)
+      if (kind == svn_kind_none)
         always_check = TRUE;
 
       /* Start the scanning at LOCAL_DIR_ABSPATH.  */
@@ -511,6 +508,38 @@ svn_wc__db_wcroot_parse_local_abspath(sv
       if (svn_dirent_is_root(local_abspath, strlen(local_abspath)))
         {
           /* Hit the root without finding a wcroot. */
+
+          /* The wcroot could be a symlink to a directory.
+           * (Issue #2557, #3987). If so, try again, this time scanning
+           * for a db within the directory the symlink points to,
+           * rather than within the symlink's parent directory. */
+          if (kind == svn_kind_symlink)
+            {
+              svn_node_kind_t resolved_kind;
+
+              local_abspath = original_abspath;
+
+              SVN_ERR(svn_io_check_resolved_path(local_abspath,
+                                                 &resolved_kind,
+                                                 scratch_pool));
+              if (resolved_kind == svn_node_dir)
+                {
+                  /* Is this directory recorded in our hash?  */
+                  found_wcroot = apr_hash_get(db->dir_data, local_abspath,
+                                              APR_HASH_KEY_STRING);
+                  if (found_wcroot)
+                    break;
+
+try_symlink_as_dir:
+                  kind = svn_kind_dir;
+                  moved_upwards = FALSE;
+                  local_dir_abspath = local_abspath;
+                  build_relpath = "";
+
+                  continue;
+                }
+            }
+
           return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
                                    _("'%s' is not a working copy"),
                                    svn_dirent_local_style(original_abspath,
@@ -584,6 +613,61 @@ svn_wc__db_wcroot_parse_local_abspath(sv
     *local_relpath = svn_relpath_join(dir_relpath, build_relpath, result_pool);
   }
 
+  if (kind == svn_kind_symlink)
+    {
+      svn_boolean_t retry_if_dir = FALSE;
+      svn_wc__db_status_t status;
+      svn_boolean_t conflicted;
+      svn_error_t *err;
+
+      /* Check if the symlink is versioned or obstructs a versioned node
+       * in this DB -- in that case, use this wcroot. Else, if the symlink
+       * points to a directory, try to find a wcroot in that directory
+       * instead. */
+
+      err = svn_wc__db_read_info_internal(&status, NULL, NULL, NULL, NULL,
+                                          NULL, NULL, NULL, NULL, NULL, NULL,
+                                          NULL, NULL, NULL, NULL, NULL, NULL,
+                                          NULL, &conflicted, NULL, NULL, NULL,
+                                          NULL, NULL, NULL,
+                                          *wcroot, *local_relpath,
+                                          scratch_pool, scratch_pool);
+      if (err)
+        {
+          if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND
+              && !SVN_WC__ERR_IS_NOT_CURRENT_WC(err))
+            return svn_error_trace(err);
+
+          svn_error_clear(err);
+          retry_if_dir = TRUE; /* The symlink is unversioned. */
+        }
+      else
+        {
+          /* The symlink is versioned, or obstructs a versioned node.
+           * Ignore non-conflicted not-present/excluded nodes.
+           * This allows the symlink to redirect the wcroot query to a
+           * directory, regardless of 'invisible' nodes in this WC. */
+          retry_if_dir = ((status == svn_wc__db_status_not_present ||
+                           status == svn_wc__db_status_excluded ||
+                           status == svn_wc__db_status_server_excluded)
+                          && !conflicted);
+        }
+
+      if (retry_if_dir)
+        {
+          svn_node_kind_t resolved_kind;
+
+          SVN_ERR(svn_io_check_resolved_path(original_abspath,
+                                             &resolved_kind,
+                                             scratch_pool));
+          if (resolved_kind == svn_node_dir)
+            {
+              local_abspath = original_abspath;
+              goto try_symlink_as_dir;
+            }
+        }
+    }
+
   /* We've found the appropriate WCROOT for the requested path. Stash
      it into that path's directory.  */
   apr_hash_set(db->dir_data,

Modified: subversion/branches/revprop-packing/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/mod_authz_svn/mod_authz_svn.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/revprop-packing/subversion/mod_authz_svn/mod_authz_svn.c Mon Mar  5 09:25:25 2012
@@ -48,10 +48,11 @@
 #include "private/svn_fspath.h"
 
 
-extern module AP_MODULE_DECLARE_DATA authz_svn_module;
-
 #ifdef APLOG_USE_MODULE
 APLOG_USE_MODULE(authz_svn);
+#else
+/* This is part of the APLOG_USE_MODULE() macro in httpd-2.3 */
+extern module AP_MODULE_DECLARE_DATA authz_svn_module;
 #endif
 
 typedef struct authz_svn_config_rec {

Modified: subversion/branches/revprop-packing/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/mod_dav_svn/dav_svn.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/branches/revprop-packing/subversion/mod_dav_svn/dav_svn.h Mon Mar  5 09:25:25 2012
@@ -385,6 +385,9 @@ const char *dav_svn__get_root_dir(reques
 /* Return the data compression level to be used over the wire. */
 int dav_svn__get_compression_level(void);
 
+/* Return the hook script environment parsed from the configuration. */
+apr_hash_t *dav_svn__get_hooks_env(request_rec *r);
+
 /** For HTTP protocol v2, these are the new URIs and URI stubs
     returned to the client in our OPTIONS response.  They all depend
     on the 'special uri', which is configurable in httpd.conf.  **/

Modified: subversion/branches/revprop-packing/subversion/mod_dav_svn/liveprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/mod_dav_svn/liveprops.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/mod_dav_svn/liveprops.c (original)
+++ subversion/branches/revprop-packing/subversion/mod_dav_svn/liveprops.c Mon Mar  5 09:25:25 2012
@@ -282,6 +282,9 @@ insert_prop_internal(const dav_resource 
   int global_ns;
   svn_error_t *serr;
 
+  /* ### TODO proper errors */
+  static const char *const error_value = "###error###";
+
   /*
   ** Almost none of the SVN provider properties are defined if the
   ** resource does not exist.  We do need to return the one VCC
@@ -378,14 +381,14 @@ insert_prop_internal(const dav_resource 
                                            scratch_pool);
             if (serr != NULL)
               {
-                ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+                ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err,
                               resource->info->r,
                               "Can't get created-rev of '%s': "
                               "%s",
                               resource->info->repos_path,
                               serr->message);
                 svn_error_clear(serr);
-                value = "###error###";
+                value = error_value;
                 break;
               }
           }
@@ -401,14 +404,14 @@ insert_prop_internal(const dav_resource 
                                 scratch_pool);
         if (serr)
           {
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err,
                           resource->info->r,
                           "Can't get author of r%ld: "
                           "%s",
                           committed_rev,
                           serr->message);
             svn_error_clear(serr);
-            value = "###error###";
+            value = error_value;
             break;
           }
 
@@ -436,8 +439,14 @@ insert_prop_internal(const dav_resource 
                                   resource->info->repos_path, scratch_pool);
         if (serr != NULL)
           {
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err,
+                          resource->info->r,
+                          "Can't get filesize of '%s': "
+                          "%s",
+                          resource->info->repos_path,
+                          serr->message);
             svn_error_clear(serr);
-            value = "0";  /* ### what to do? */
+            value = error_value;
             break;
           }
 
@@ -494,7 +503,7 @@ insert_prop_internal(const dav_resource 
                    there's no point even checking.  No matter what the
                    error is, we can't claim to have a mime type for
                    this resource. */
-                ap_log_rerror(APLOG_MARK, APLOG_WARNING, serr->apr_err, 
+                ap_log_rerror(APLOG_MARK, APLOG_WARNING, serr->apr_err,
                               resource->info->r, "%s", serr->message);
                 svn_error_clear(serr);
                 return DAV_PROP_INSERT_NOTDEF;
@@ -549,7 +558,7 @@ insert_prop_internal(const dav_resource 
                                      scratch_pool);
           if (serr != NULL)
             {
-              ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+              ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err,
                             resource->info->r,
                             "Can't get youngest revision in '%s': "
                             "%s",
@@ -557,7 +566,7 @@ insert_prop_internal(const dav_resource 
                                         scratch_pool),
                             serr->message);
               svn_error_clear(serr);
-              value = "###error###";
+              value = error_value;
               break;
             }
           s = dav_svn__build_uri(resource->info->repos,
@@ -629,14 +638,14 @@ insert_prop_internal(const dav_resource 
                                          scratch_pool);
           if (serr != NULL)
             {
-              ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+              ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err,
                             resource->info->r,
                             "Can't get created-rev of '%s': "
                             "%s",
                             resource->info->repos_path,
                             serr->message);
               svn_error_clear(serr);
-              value = "###error###";
+              value = error_value;
               break;
             }
 
@@ -677,14 +686,14 @@ insert_prop_internal(const dav_resource 
                                         scratch_pool);
           if (serr != NULL)
             {
-              ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+              ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err,
                             resource->info->r,
-                            "Can't get fetch or compute md5 checksum of '%s': "
+                            "Can't fetch or compute MD5 checksum of '%s': "
                             "%s",
                             resource->info->repos_path,
                             serr->message);
               svn_error_clear(serr);
-              value = "###error###";
+              value = error_value;
               break;
             }
 
@@ -705,14 +714,14 @@ insert_prop_internal(const dav_resource 
       serr = svn_fs_get_uuid(resource->info->repos->fs, &value, scratch_pool);
       if (serr != NULL)
         {
-          ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+          ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err,
                         resource->info->r,
                         "Can't fetch UUID of '%s': "
                         "%s",
                         svn_fs_path(resource->info->repos->fs, scratch_pool),
                         serr->message);
           svn_error_clear(serr);
-          value = "###error###";
+          value = error_value;
           break;
         }
       break;
@@ -730,14 +739,14 @@ insert_prop_internal(const dav_resource 
                                     resource->info->repos_path, scratch_pool);
         if (serr != NULL)
           {
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err,
                           resource->info->r,
                           "Can't fetch proplist of '%s': "
                           "%s",
                           resource->info->repos_path,
                           serr->message);
             svn_error_clear(serr);
-            value = "###error###";
+            value = error_value;
             break;
           }
 

Modified: subversion/branches/revprop-packing/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/mod_dav_svn/mod_dav_svn.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/revprop-packing/subversion/mod_dav_svn/mod_dav_svn.c Mon Mar  5 09:25:25 2012
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 
 #include <apr_strings.h>
+#include <apr_hash.h>
 
 #include <httpd.h>
 #include <http_config.h>
@@ -94,6 +95,7 @@ typedef struct dir_conf_t {
   const char *activities_db;         /* path to activities database(s) */
   enum conf_flag txdelta_cache;      /* whether to enable txdelta caching */
   enum conf_flag fulltext_cache;     /* whether to enable fulltext caching */
+  apr_hash_t *hooks_env;             /* environment for hook scripts */
 } dir_conf_t;
 
 
@@ -193,6 +195,7 @@ create_dir_config(apr_pool_t *p, char *d
     conf->root_dir = svn_urlpath__canonicalize(dir, p);
   conf->bulk_updates = CONF_FLAG_ON;
   conf->v2_protocol = CONF_FLAG_ON;
+  conf->hooks_env = apr_hash_make(p);
 
   return conf;
 }
@@ -222,6 +225,7 @@ merge_dir_config(apr_pool_t *p, void *ba
   newconf->txdelta_cache = INHERIT_VALUE(parent, child, txdelta_cache);
   newconf->fulltext_cache = INHERIT_VALUE(parent, child, fulltext_cache);
   newconf->root_dir = INHERIT_VALUE(parent, child, root_dir);
+  newconf->hooks_env = INHERIT_VALUE(parent, child, hooks_env);
 
   if (parent->fs_path)
     ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL,
@@ -528,6 +532,47 @@ SVNUseUTF8_cmd(cmd_parms *cmd, void *con
   return NULL;
 }
 
+static const char *
+SVNHooksEnv_cmd(cmd_parms *cmd, void *config, const char *arg1)
+{
+  apr_array_header_t *var;
+
+  var = svn_cstring_split(arg1, "=", TRUE, cmd->pool);
+  if (var && var->nelts >= 2)
+    {
+      dir_conf_t *conf = config;
+      const char *name;
+      const char *val;
+
+      name = apr_pstrdup(apr_hash_pool_get(conf->hooks_env),
+                         APR_ARRAY_IDX(var, 0, const char *));
+
+      /* Special case for values which contain '='. */
+      if (var->nelts > 2)
+        {
+          svn_stringbuf_t *buf;
+          int i;
+
+          buf = svn_stringbuf_create(APR_ARRAY_IDX(var, 1, const char *),
+                                     cmd->pool);
+          for (i = 2; i < var->nelts; i++)
+            {
+              svn_stringbuf_appendbyte(buf, '=');
+              svn_stringbuf_appendcstr(buf, APR_ARRAY_IDX(var, i, const char *));
+            }
+
+          val = apr_pstrdup(apr_hash_pool_get(conf->hooks_env), buf->data);
+        }
+      else
+        val = apr_pstrdup(apr_hash_pool_get(conf->hooks_env),
+                          APR_ARRAY_IDX(var, 1, const char *));
+
+      apr_hash_set(conf->hooks_env, name, APR_HASH_KEY_STRING, val);
+    }
+
+  return NULL;
+}
+
 
 /** Accessor functions for the module's configuration state **/
 
@@ -805,6 +850,15 @@ dav_svn__get_compression_level(void)
   return svn__compression_level;
 }
 
+apr_hash_t *
+dav_svn__get_hooks_env(request_rec *r)
+{
+  dir_conf_t *conf;
+
+  conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
+  return conf->hooks_env;
+}
+
 static void
 merge_xml_filter_insert(request_rec *r)
 {
@@ -1044,6 +1098,12 @@ static const command_rec cmds[] =
                SVNUseUTF8_cmd, NULL,
                RSRC_CONF,
                "use UTF-8 as native character encoding (default is ASCII)."),
+
+  /* per directory/location */
+  AP_INIT_ITERATE("SVNHooksEnv", SVNHooksEnv_cmd, NULL,
+                  ACCESS_CONF|RSRC_CONF,
+                  "Set the environment of hook scripts via any number of "
+                  "VAR=VAL arguments (the default hook environment is empty)."),
   { NULL }
 };
 

Modified: subversion/branches/revprop-packing/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/mod_dav_svn/repos.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/revprop-packing/subversion/mod_dav_svn/repos.c Mon Mar  5 09:25:25 2012
@@ -1917,8 +1917,6 @@ parse_querystring(request_rec *r, const 
   return NULL;
 }
 
-
-
 static dav_error *
 get_resource(request_rec *r,
              const char *root_path,
@@ -2188,6 +2186,9 @@ get_resource(request_rec *r,
                                          "in repos object",
                                          HTTP_INTERNAL_SERVER_ERROR, r);
         }
+
+      /* Configure the hooks environment, if not empty. */
+      svn_repos_hooks_setenv(repos->repos, dav_svn__get_hooks_env(r));
     }
 
   /* cache the filesystem object */
@@ -3263,7 +3264,7 @@ deliver(const dav_resource *resource, ap
               if (dirent->kind == svn_node_file && dirent->special)
                 {
                   svn_node_kind_t resolved_kind;
-                  const char *link_path = 
+                  const char *link_path =
                     svn_dirent_join(fs_parent_path, key, resource->pool);
 
                   serr = svn_io_check_resolved_path(link_path, &resolved_kind,
@@ -3276,7 +3277,7 @@ deliver(const dav_resource *resource, ap
                                                 resource->pool);
                   if (resolved_kind != svn_node_dir)
                     continue;
-                  
+
                   dirent->kind = svn_node_dir;
                 }
               else if (dirent->kind != svn_node_dir)