subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1231318 [19/35] - in /subversion/branches/revprop-packing: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ build/win32/ contrib/client-side/emacs/ contrib/server-side/mod_dontdothat/ notes/ notes/http-and-webdav/ not...
Date Fri, 13 Jan 2012 21:40:38 GMT
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=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/svn_string.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/svn_string.c Fri Jan 13 21:40:26 2012
@@ -28,7 +28,6 @@
 #include <apr.h>
 
 #include <string.h>      /* for memcpy(), memcmp(), strlen() */
-#include <apr_lib.h>     /* for apr_isspace() */
 #include <apr_fnmatch.h>
 #include "svn_string.h"  /* loads "svn_types.h" and <apr_pools.h> */
 #include "svn_ctype.h"
@@ -133,6 +132,19 @@ create_string(const char *data, apr_size
   return new_string;
 }
 
+static char empty_buffer[1] = {0};
+  
+svn_string_t *
+svn_string_create_empty(apr_pool_t *pool)
+{
+  svn_string_t *new_string = apr_palloc(pool, sizeof(*new_string));
+  new_string->data = empty_buffer;
+  new_string->len = 0;
+
+  return new_string;
+}
+
+
 svn_string_t *
 svn_string_ncreate(const char *bytes, apr_size_t size, apr_pool_t *pool)
 {
@@ -286,6 +298,17 @@ create_stringbuf(char *data, apr_size_t 
 }
 
 svn_stringbuf_t *
+svn_stringbuf_create_empty(apr_pool_t *pool)
+{
+  /* 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 
+   * (a simple (char *)"" will cause SEGFAULTs). */
+
+  return create_stringbuf(empty_buffer, 0, 0, pool);
+}
+
+svn_stringbuf_t *
 svn_stringbuf_create_ensure(apr_size_t blocksize, apr_pool_t *pool)
 {
   void *mem;
@@ -619,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)
     {
@@ -644,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;
@@ -695,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;
@@ -724,8 +787,8 @@ svn_cstring_join(const apr_array_header_
                  const char *separator,
                  apr_pool_t *pool)
 {
-  svn_stringbuf_t *new_str = svn_stringbuf_create("", pool);
-  int sep_len = strlen(separator);
+  svn_stringbuf_t *new_str = svn_stringbuf_create_empty(pool);
+  size_t sep_len = strlen(separator);
   int i;
 
   for (i = 0; i < strings->nelts; i++)

Propchange: subversion/branches/revprop-packing/subversion/libsvn_subr/svn_temp_serializer.c
            ('svn:mergeinfo' removed)

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/target.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/target.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/target.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/target.c Fri Jan 13 21:40:26 2012
@@ -46,7 +46,7 @@ svn_path_condense_targets(const char **p
   int i, j, num_condensed = targets->nelts;
   svn_boolean_t *removed;
   apr_array_header_t *abs_targets;
-  int basedir_len;
+  size_t basedir_len;
   const char *first_target;
   svn_boolean_t first_target_is_url;
 
@@ -303,18 +303,12 @@ svn_path_remove_redundancies(apr_array_h
           if (is_url != keeper_is_url)
             continue;
 
-          /* Quit here if we find this path already in the keepers. */
-          if (strcmp(keeper, abs_path) == 0)
-            {
-              keep_me = FALSE;
-              break;
-            }
-
-          /* Quit here if this path is a child of one of the keepers. */
+          /* Quit here if this path is the same as or a child of one of the
+             keepers. */
           if (is_url)
-            child_relpath = svn_uri__is_child(keeper, abs_path, temp_pool);
+            child_relpath = svn_uri_skip_ancestor(keeper, abs_path, temp_pool);
           else
-            child_relpath = svn_dirent_is_child(keeper, abs_path, temp_pool);
+            child_relpath = svn_dirent_skip_ancestor(keeper, abs_path);
           if (child_relpath)
             {
               keep_me = FALSE;

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=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/utf.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/utf.c Fri Jan 13 21:40:26 2012
@@ -42,6 +42,7 @@
 #include "private/svn_utf_private.h"
 #include "private/svn_dep_compat.h"
 #include "private/svn_string_private.h"
+#include "private/svn_mutex.h"
 
 
 
@@ -53,9 +54,7 @@ static const char *SVN_UTF_UTON_XLATE_HA
 
 static const char *SVN_APR_UTF8_CHARSET = "UTF-8";
 
-#if APR_HAS_THREADS
-static apr_thread_mutex_t *xlate_handle_mutex = NULL;
-#endif
+static svn_mutex__t *xlate_handle_mutex = NULL;
 
 /* The xlate handle cache is a global hash table with linked lists of xlate
  * handles.  In multi-threaded environments, a thread "borrows" an xlate
@@ -99,10 +98,6 @@ xlate_cleanup(void *arg)
 {
   /* We set the cache variables to NULL so that translation works in other
      cleanup functions, even if it isn't cached then. */
-#if APR_HAS_THREADS
-  apr_thread_mutex_destroy(xlate_handle_mutex);
-  xlate_handle_mutex = NULL;
-#endif
   xlate_handle_hash = NULL;
 
   /* ensure no stale objects get accessed */
@@ -125,27 +120,24 @@ xlate_handle_node_cleanup(void *arg)
 void
 svn_utf_initialize(apr_pool_t *pool)
 {
-  apr_pool_t *subpool;
-#if APR_HAS_THREADS
-  apr_thread_mutex_t *mutex;
-#endif
-
   if (!xlate_handle_hash)
     {
       /* We create our own subpool, which we protect with the mutex.
          We can't use the pool passed to us by the caller, since we will
          use it for xlate handle allocations, possibly in multiple threads,
          and pool allocation is not thread-safe. */
-      subpool = svn_pool_create(pool);
-#if APR_HAS_THREADS
-      if (apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, subpool)
-          == APR_SUCCESS)
-        xlate_handle_mutex = mutex;
-      else
-        return;
-#endif
+      apr_pool_t *subpool = svn_pool_create(pool);
+      svn_mutex__t *mutex;
+      svn_error_t *err = svn_mutex__init(&mutex, TRUE, subpool);
+      if (err)
+        {
+          svn_error_clear(err);
+          return;
+        }
 
+      xlate_handle_mutex = mutex;
       xlate_handle_hash = apr_hash_make(subpool);
+
       apr_pool_cleanup_register(subpool, NULL, xlate_cleanup,
                                 apr_pool_cleanup_null);
     }
@@ -202,91 +194,17 @@ atomic_swap(void * volatile * mem, void 
 #endif
 }
 
-/* Set *RET to a handle node for converting from FROMPAGE to TOPAGE,
-   creating the handle node if it doesn't exist in USERDATA_KEY.
-   If a node is not cached and 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 if svn_utf_initialize()
-   hasn't been called or USERDATA_KEY is NULL.  Else, allocate them
-   in the pool of xlate_handle_hash. */
+/* 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 *
-get_xlate_handle_node(xlate_handle_node_t **ret,
-                      const char *topage, const char *frompage,
-                      const char *userdata_key, apr_pool_t *pool)
+xlate_alloc_handle(xlate_handle_node_t **ret,
+                   const char *topage, const char *frompage,
+                   apr_pool_t *pool)
 {
-  xlate_handle_node_t **old_node_p;
-  xlate_handle_node_t *old_node = NULL;
   apr_status_t apr_err;
   apr_xlate_t *handle;
-  svn_error_t *err = NULL;
-
-  /* If we already have a handle, just return it. */
-  if (userdata_key)
-    {
-      if (xlate_handle_hash)
-        {
-          /* 1st level: global, static items */
-          if (userdata_key == SVN_UTF_NTOU_XLATE_HANDLE)
-            old_node = atomic_swap(&xlat_ntou_static_handle, NULL);
-          else if (userdata_key == SVN_UTF_UTON_XLATE_HANDLE)
-            old_node = atomic_swap(&xlat_uton_static_handle, NULL);
-
-          if (old_node && old_node->valid)
-            {
-              *ret = old_node;
-              return SVN_NO_ERROR;
-            }
-
-          /* 2nd level: hash lookup */
-#if APR_HAS_THREADS
-          apr_err = apr_thread_mutex_lock(xlate_handle_mutex);
-          if (apr_err != APR_SUCCESS)
-            return svn_error_create(apr_err, NULL,
-                                    _("Can't lock charset translation mutex"));
-#endif
-          old_node_p = apr_hash_get(xlate_handle_hash, userdata_key,
-                                    APR_HASH_KEY_STRING);
-          if (old_node_p)
-            old_node = *old_node_p;
-          if (old_node)
-            {
-              /* Ensure that the handle is still valid. */
-              if (old_node->valid)
-                {
-                  /* Remove from the list. */
-                  *old_node_p = old_node->next;
-                  old_node->next = NULL;
-#if APR_HAS_THREADS
-                  apr_err = apr_thread_mutex_unlock(xlate_handle_mutex);
-                  if (apr_err != APR_SUCCESS)
-                    return svn_error_create(apr_err, NULL,
-                                            _("Can't unlock charset "
-                                              "translation mutex"));
-#endif
-                  *ret = old_node;
-                  return SVN_NO_ERROR;
-                }
-            }
-        }
-      else
-        {
-          void *p;
-          /* We fall back on a per-pool cache instead. */
-          apr_pool_userdata_get(&p, userdata_key, pool);
-          old_node = p;
-          /* Ensure that the handle is still valid. */
-          if (old_node && old_node->valid)
-            {
-              *ret = old_node;
-              return SVN_NO_ERROR;
-            }
-        }
-    }
-
-  /* Note that we still have the mutex locked (if it is initialized), so we
-     can use the global pool for creating the new xlate handle. */
 
   /* The error handling doesn't support the following cases, since we don't
      use them currently.  Catch this here. */
@@ -295,10 +213,6 @@ get_xlate_handle_node(xlate_handle_node_
                  && (frompage != SVN_APR_LOCALE_CHARSET
                      || topage != SVN_APR_LOCALE_CHARSET));
 
-  /* Use the correct pool for creating the handle. */
-  if (userdata_key && xlate_handle_hash)
-    pool = apr_hash_pool_get(xlate_handle_hash);
-
   /* Try to create a handle. */
 #if defined(WIN32)
   apr_err = svn_subr__win32_xlate_open((win32_xlate_t **)&handle, topage,
@@ -327,8 +241,7 @@ get_xlate_handle_node(xlate_handle_node_
                               _("Can't create a character converter from "
                                 "'%s' to '%s'"), frompage, topage);
 
-      err = svn_error_create(apr_err, NULL, errstr);
-      goto cleanup;
+      return svn_error_create(apr_err, NULL, errstr);
     }
 
   /* Allocate and initialize the node. */
@@ -350,76 +263,178 @@ get_xlate_handle_node(xlate_handle_node_
     apr_pool_cleanup_register(pool, *ret, xlate_handle_node_cleanup,
                               apr_pool_cleanup_null);
 
- cleanup:
-  /* Don't need the lock anymore. */
-#if APR_HAS_THREADS
+  return SVN_NO_ERROR;
+}
+
+/* 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 *
+get_xlate_handle_node_internal(xlate_handle_node_t **ret,
+                               const char *topage, const char *frompage,
+                               const char *userdata_key, apr_pool_t *pool)
+{
+  /* If we already have a handle, just return it. */
   if (userdata_key && xlate_handle_hash)
     {
-      apr_status_t unlock_err = apr_thread_mutex_unlock(xlate_handle_mutex);
-      if (unlock_err != APR_SUCCESS)
-        return svn_error_create(unlock_err, NULL,
-                                _("Can't unlock charset translation mutex"));
+      xlate_handle_node_t *old_node = NULL;
+
+      /* 2nd level: hash lookup */
+      xlate_handle_node_t **old_node_p = apr_hash_get(xlate_handle_hash, 
+                                                      userdata_key,
+                                                      APR_HASH_KEY_STRING);
+      if (old_node_p)
+        old_node = *old_node_p;
+      if (old_node)
+        {
+          /* Ensure that the handle is still valid. */
+          if (old_node->valid)
+            {
+              /* Remove from the list. */
+              *old_node_p = old_node->next;
+              old_node->next = NULL;
+              *ret = old_node;
+              return SVN_NO_ERROR;
+            }
+        }
+    }
+
+  /* Note that we still have the mutex locked (if it is initialized), so we
+     can use the global pool for creating the new xlate handle. */
+
+  /* Use the correct pool for creating the handle. */
+  pool = apr_hash_pool_get(xlate_handle_hash);
+
+  return xlate_alloc_handle(ret, topage, frompage, pool);
+}
+
+/* Set *RET to a handle node for converting from FROMPAGE to TOPAGE,
+   creating the handle node if it doesn't exist in USERDATA_KEY.
+   If a node is not cached and 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 if svn_utf_initialize()
+   hasn't been called or USERDATA_KEY is NULL.  Else, allocate them
+   in the pool of xlate_handle_hash. */
+static svn_error_t *
+get_xlate_handle_node(xlate_handle_node_t **ret,
+                      const char *topage, const char *frompage,
+                      const char *userdata_key, apr_pool_t *pool)
+{
+  xlate_handle_node_t *old_node = NULL;
+
+  /* If we already have a handle, just return it. */
+  if (userdata_key)
+    {
+      if (xlate_handle_hash)
+        {
+          /* 1st level: global, static items */
+          if (userdata_key == SVN_UTF_NTOU_XLATE_HANDLE)
+            old_node = atomic_swap(&xlat_ntou_static_handle, NULL);
+          else if (userdata_key == SVN_UTF_UTON_XLATE_HANDLE)
+            old_node = atomic_swap(&xlat_uton_static_handle, NULL);
+
+          if (old_node && old_node->valid)
+            {
+              *ret = old_node;
+              return SVN_NO_ERROR;
+            }
+        }
+      else
+        {
+          void *p;
+          /* We fall back on a per-pool cache instead. */
+          apr_pool_userdata_get(&p, userdata_key, pool);
+          old_node = p;
+          /* Ensure that the handle is still valid. */
+          if (old_node && old_node->valid)
+            {
+              *ret = old_node;
+              return SVN_NO_ERROR;
+            }
+
+          return xlate_alloc_handle(ret, topage, frompage, pool);
+        }
     }
-#endif
 
-  return err;
+  SVN_MUTEX__WITH_LOCK(xlate_handle_mutex,
+                       get_xlate_handle_node_internal(ret,
+                                                      topage,
+                                                      frompage,
+                                                      userdata_key,
+                                                      pool));
+
+  return SVN_NO_ERROR;
+}
+
+/* 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 *
+put_xlate_handle_node_internal(xlate_handle_node_t *node,
+                               const char *userdata_key)
+{
+  xlate_handle_node_t **node_p = apr_hash_get(xlate_handle_hash,
+                                              userdata_key,
+                                              APR_HASH_KEY_STRING);
+  if (node_p == NULL)
+    {
+      userdata_key = apr_pstrdup(apr_hash_pool_get(xlate_handle_hash),
+                                  userdata_key);
+      node_p = apr_palloc(apr_hash_pool_get(xlate_handle_hash),
+                          sizeof(*node_p));
+      *node_p = NULL;
+      apr_hash_set(xlate_handle_hash, userdata_key,
+                    APR_HASH_KEY_STRING, node_p);
+    }
+  node->next = *node_p;
+  *node_p = node;
+  
+  return SVN_NO_ERROR;
 }
 
 /* Put back NODE into the xlate handle cache for use by other calls.
    If there is no global cache, store the handle in POOL.
-   Ignore errors related to locking/unlocking the mutex.
-   ### Mutex errors here are very weird. Should we handle them "correctly"
-   ### even if that complicates error handling in the routines below? */
-static void
+   Ignore errors related to locking/unlocking the mutex. */
+static svn_error_t *
 put_xlate_handle_node(xlate_handle_node_t *node,
                       const char *userdata_key,
                       apr_pool_t *pool)
 {
   assert(node->next == NULL);
   if (!userdata_key)
-    return;
+    return SVN_NO_ERROR;
 
   /* push previous global node to the hash */
   if (xlate_handle_hash)
     {
-      xlate_handle_node_t **node_p;
-
       /* 1st level: global, static items */
       if (userdata_key == SVN_UTF_NTOU_XLATE_HANDLE)
         node = atomic_swap(&xlat_ntou_static_handle, node);
       else if (userdata_key == SVN_UTF_UTON_XLATE_HANDLE)
         node = atomic_swap(&xlat_uton_static_handle, node);
       if (node == NULL)
-        return;
+        return SVN_NO_ERROR;
 
-#if APR_HAS_THREADS
-      if (apr_thread_mutex_lock(xlate_handle_mutex) != APR_SUCCESS)
-        SVN_ERR_MALFUNCTION_NO_RETURN();
-#endif
-      node_p = apr_hash_get(xlate_handle_hash, userdata_key,
-                            APR_HASH_KEY_STRING);
-      if (node_p == NULL)
-        {
-          userdata_key = apr_pstrdup(apr_hash_pool_get(xlate_handle_hash),
-                                     userdata_key);
-          node_p = apr_palloc(apr_hash_pool_get(xlate_handle_hash),
-                              sizeof(*node_p));
-          *node_p = NULL;
-          apr_hash_set(xlate_handle_hash, userdata_key,
-                       APR_HASH_KEY_STRING, node_p);
-        }
-      node->next = *node_p;
-      *node_p = node;
-#if APR_HAS_THREADS
-      if (apr_thread_mutex_unlock(xlate_handle_mutex) != APR_SUCCESS)
-        SVN_ERR_MALFUNCTION_NO_RETURN();
-#endif
+      SVN_MUTEX__WITH_LOCK(xlate_handle_mutex,
+                           put_xlate_handle_node_internal(node, 
+                                                          userdata_key));
     }
   else
     {
       /* Store it in the per-pool cache. */
       apr_pool_userdata_set(node, userdata_key, apr_pool_cleanup_null, pool);
     }
+    
+  return SVN_NO_ERROR;
 }
 
 /* Return the apr_xlate handle for converting native characters to UTF-8. */
@@ -720,9 +735,11 @@ svn_utf_stringbuf_to_utf8(svn_stringbuf_
         *dest = svn_stringbuf_dup(src, pool);
     }
 
-  put_xlate_handle_node(node, SVN_UTF_NTOU_XLATE_HANDLE, pool);
-
-  return err;
+  return svn_error_compose_create(err,
+                                  put_xlate_handle_node
+                                     (node, 
+                                      SVN_UTF_NTOU_XLATE_HANDLE,
+                                      pool));
 }
 
 
@@ -752,9 +769,11 @@ svn_utf_string_to_utf8(const svn_string_
         *dest = svn_string_dup(src, pool);
     }
 
-  put_xlate_handle_node(node, SVN_UTF_NTOU_XLATE_HANDLE, pool);
-
-  return err;
+  return svn_error_compose_create(err,
+                                  put_xlate_handle_node
+                                     (node, 
+                                      SVN_UTF_NTOU_XLATE_HANDLE,
+                                      pool));
 }
 
 
@@ -795,8 +814,11 @@ svn_utf_cstring_to_utf8(const char **des
 
   SVN_ERR(get_ntou_xlate_handle_node(&node, pool));
   err = convert_cstring(dest, src, node, pool);
-  put_xlate_handle_node(node, SVN_UTF_NTOU_XLATE_HANDLE, pool);
-  SVN_ERR(err);
+  SVN_ERR(svn_error_compose_create(err,
+                                   put_xlate_handle_node
+                                      (node, 
+                                       SVN_UTF_NTOU_XLATE_HANDLE,
+                                       pool)));
   return check_cstring_utf8(*dest, pool);
 }
 
@@ -815,8 +837,12 @@ svn_utf_cstring_to_utf8_ex2(const char *
   SVN_ERR(get_xlate_handle_node(&node, SVN_APR_UTF8_CHARSET, frompage,
                                 convset_key, pool));
   err = convert_cstring(dest, src, node, pool);
-  put_xlate_handle_node(node, convset_key, pool);
-  SVN_ERR(err);
+  SVN_ERR(svn_error_compose_create(err,
+                                   put_xlate_handle_node
+                                      (node, 
+                                       SVN_UTF_NTOU_XLATE_HANDLE,
+                                       pool)));
+
   return check_cstring_utf8(*dest, pool);
 }
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/win32_xlate.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/win32_xlate.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/win32_xlate.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/win32_xlate.c Fri Jan 13 21:40:26 2012
@@ -185,7 +185,7 @@ svn_subr__win32_xlate_to_stringbuf(win32
 
   if (src_length == 0)
   {
-    *dest = svn_stringbuf_create("", pool);
+    *dest = svn_stringbuf_create_empty(pool);
     return APR_SUCCESS;
   }
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/xml.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/xml.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/xml.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/xml.c Fri Jan 13 21:40:26 2012
@@ -115,7 +115,7 @@ xml_escape_cdata(svn_stringbuf_t **outst
   const char *p = data, *q;
 
   if (*outstr == NULL)
-    *outstr = svn_stringbuf_create("", pool);
+    *outstr = svn_stringbuf_create_empty(pool);
 
   while (1)
     {
@@ -277,7 +277,7 @@ svn_xml_fuzzy_escape(const char *string,
   if (q == end)
     return string;
 
-  outstr = svn_stringbuf_create("", pool);
+  outstr = svn_stringbuf_create_empty(pool);
   while (1)
     {
       q = p;
@@ -479,7 +479,7 @@ svn_xml_make_header2(svn_stringbuf_t **s
 {
 
   if (*str == NULL)
-    *str = svn_stringbuf_create("", pool);
+    *str = svn_stringbuf_create_empty(pool);
   svn_stringbuf_appendcstr(*str, "<?xml version=\"1.0\"");
   if (encoding)
     {
@@ -646,7 +646,7 @@ void svn_xml_make_close_tag(svn_stringbu
                             const char *tagname)
 {
   if (*str == NULL)
-    *str = svn_stringbuf_create("", pool);
+    *str = svn_stringbuf_create_empty(pool);
 
   svn_stringbuf_appendcstr(*str, "</");
   svn_stringbuf_appendcstr(*str, tagname);

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/adm_crawler.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/adm_crawler.c Fri Jan 13 21:40:26 2012
@@ -102,7 +102,7 @@ svn_wc_restore(svn_wc_context_t *wc_ctx,
                apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_node_kind_t disk_kind;
 
   SVN_ERR(svn_io_check_path(local_abspath, &disk_kind, scratch_pool));
@@ -131,7 +131,7 @@ svn_wc_restore(svn_wc_context_t *wc_ctx,
   if (status != svn_wc__db_status_normal
       && status != svn_wc__db_status_copied
       && status != svn_wc__db_status_moved_here
-      && !(kind == svn_wc__db_kind_dir
+      && !(kind == svn_kind_dir
            && (status == svn_wc__db_status_added
                || status == svn_wc__db_status_incomplete)))
     {
@@ -141,7 +141,7 @@ svn_wc_restore(svn_wc_context_t *wc_ctx,
                                                       scratch_pool));
     }
 
-  if (kind == svn_wc__db_kind_file || kind == svn_wc__db_kind_symlink)
+  if (kind == svn_kind_file || kind == svn_kind_symlink)
     SVN_ERR(restore_file(wc_ctx->db, local_abspath, use_commit_times, FALSE,
                          scratch_pool));
   else
@@ -160,19 +160,19 @@ svn_wc_restore(svn_wc_context_t *wc_ctx,
 static svn_error_t *
 restore_node(svn_wc__db_t *db,
              const char *local_abspath,
-             svn_wc__db_kind_t kind,
+             svn_kind_t kind,
              svn_boolean_t use_commit_times,
              svn_wc_notify_func2_t notify_func,
              void *notify_baton,
              apr_pool_t *scratch_pool)
 {
-  if (kind == svn_wc__db_kind_file || kind == svn_wc__db_kind_symlink)
+  if (kind == svn_kind_file || kind == svn_kind_symlink)
     {
       /* Recreate file from text-base */
       SVN_ERR(restore_file(db, local_abspath, use_commit_times, TRUE,
                            scratch_pool));
     }
-  else if (kind == svn_wc__db_kind_dir)
+  else if (kind == svn_kind_dir)
     {
       /* Recreating a directory is just a mkdir */
       SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, scratch_pool));
@@ -373,7 +373,7 @@ report_revisions_and_depths(svn_wc__db_t
           && apr_hash_get(dirents, child, APR_HASH_KEY_STRING) == NULL)
         {
           svn_wc__db_status_t wrk_status;
-          svn_wc__db_kind_t wrk_kind;
+          svn_kind_t wrk_kind;
 
           SVN_ERR(svn_wc__db_read_info(&wrk_status, &wrk_kind, NULL, NULL,
                                        NULL, NULL, NULL, NULL, NULL, NULL,
@@ -391,7 +391,7 @@ report_revisions_and_depths(svn_wc__db_t
           if (wrk_status == svn_wc__db_status_normal
               || wrk_status == svn_wc__db_status_copied
               || wrk_status == svn_wc__db_status_moved_here
-              || (wrk_kind == svn_wc__db_kind_dir
+              || (wrk_kind == svn_kind_dir
                   && (wrk_status == svn_wc__db_status_added
                       || wrk_status == svn_wc__db_status_incomplete)))
             {
@@ -420,9 +420,8 @@ report_revisions_and_depths(svn_wc__db_t
         }
       else
         {
-          const char *childname = svn_relpath__is_child(dir_repos_relpath,
-                                                        ths->repos_relpath,
-                                                        NULL);
+          const char *childname
+            = svn_relpath_skip_ancestor(dir_repos_relpath, ths->repos_relpath);
 
           if (childname == NULL || strcmp(childname, child) != 0)
             {
@@ -435,8 +434,8 @@ report_revisions_and_depths(svn_wc__db_t
         ths->depth = svn_depth_infinity;
 
       /*** Files ***/
-      if (ths->kind == svn_wc__db_kind_file ||
-               ths->kind == svn_wc__db_kind_symlink)
+      if (ths->kind == svn_kind_file ||
+               ths->kind == svn_kind_symlink)
         {
           if (report_everything)
             {
@@ -489,7 +488,7 @@ report_revisions_and_depths(svn_wc__db_t
         } /* end file case */
 
       /*** Directories (in recursive mode) ***/
-      else if (ths->kind == svn_wc__db_kind_dir
+      else if (ths->kind == svn_kind_dir
                && (depth > svn_depth_files
                    || depth == svn_depth_unknown))
         {
@@ -562,7 +561,7 @@ report_revisions_and_depths(svn_wc__db_t
                    || (dir_depth == svn_depth_immediates
                        && ths->depth != svn_depth_empty)
                    || (ths->depth < svn_depth_infinity
-                       && depth == svn_depth_infinity))
+                       && SVN_DEPTH_IS_RECURSIVE(depth)))
             {
               /* ... or perhaps just a differing revision, lock token,
                  incomplete subdir, the mere presence of the directory
@@ -642,7 +641,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
   svn_revnum_t target_rev = SVN_INVALID_REVNUM;
   svn_boolean_t start_empty;
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t target_kind;
+  svn_kind_t target_kind;
   const char *repos_relpath, *repos_root_url;
   svn_depth_t target_depth;
   svn_wc__db_lock_t *target_lock;
@@ -715,7 +714,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
       && disk_kind == svn_node_none)
     {
       svn_wc__db_status_t wrk_status;
-      svn_wc__db_kind_t wrk_kind;
+      svn_kind_t wrk_kind;
       err = svn_wc__db_read_info(&wrk_status, &wrk_kind, NULL, NULL, NULL,
                                  NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                  NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -729,7 +728,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
         {
           svn_error_clear(err);
           wrk_status = svn_wc__db_status_not_present;
-          wrk_kind = svn_wc__db_kind_file;
+          wrk_kind = svn_kind_file;
         }
       else
         SVN_ERR(err);
@@ -743,7 +742,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
       if (wrk_status == svn_wc__db_status_normal
           || wrk_status == svn_wc__db_status_copied
           || wrk_status == svn_wc__db_status_moved_here
-          || (wrk_kind == svn_wc__db_kind_dir
+          || (wrk_kind == svn_kind_dir
               && (wrk_status == svn_wc__db_status_added
                   || wrk_status == svn_wc__db_status_incomplete)))
         {
@@ -768,7 +767,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
     SVN_ERR(reporter->set_path(report_baton, "", target_rev, report_depth,
                                start_empty, NULL, scratch_pool));
   }
-  if (target_kind == svn_wc__db_kind_dir)
+  if (target_kind == svn_kind_dir)
     {
       if (depth != svn_depth_empty)
         {
@@ -795,8 +794,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
         }
     }
 
-  else if (target_kind == svn_wc__db_kind_file ||
-           target_kind == svn_wc__db_kind_symlink)
+  else if (target_kind == svn_kind_file || target_kind == svn_kind_symlink)
     {
       const char *parent_abspath, *base;
       svn_wc__db_status_t parent_status;
@@ -1207,7 +1205,7 @@ svn_wc__internal_transmit_prop_deltas(sv
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   int i;
   apr_array_header_t *propmods;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
 
   SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, FALSE, iterpool));
 
@@ -1222,7 +1220,7 @@ svn_wc__internal_transmit_prop_deltas(sv
 
       svn_pool_clear(iterpool);
 
-      if (kind == svn_wc__db_kind_file)
+      if (kind == svn_kind_file)
         SVN_ERR(editor->change_file_prop(baton, p->name, p->value,
                                          iterpool));
       else

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/adm_files.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/adm_files.c Fri Jan 13 21:40:26 2012
@@ -196,7 +196,7 @@ svn_wc__text_base_path_to_read(const cha
                                apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   const svn_checksum_t *checksum;
 
   SVN_ERR(svn_wc__db_read_pristine_info(&status, &kind, NULL, NULL, NULL, NULL,
@@ -205,7 +205,7 @@ svn_wc__text_base_path_to_read(const cha
                                         scratch_pool, scratch_pool));
 
   /* Sanity */
-  if (kind != svn_wc__db_kind_file)
+  if (kind != svn_kind_file)
     return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
                              _("Can only get the pristine contents of files; "
                                "'%s' is not a file"),
@@ -249,7 +249,7 @@ svn_wc__get_pristine_contents(svn_stream
                               apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   const svn_checksum_t *sha1_checksum;
 
   if (size)
@@ -261,7 +261,7 @@ svn_wc__get_pristine_contents(svn_stream
                                         scratch_pool, scratch_pool));
 
   /* Sanity */
-  if (kind != svn_wc__db_kind_file)
+  if (kind != svn_kind_file)
     return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
                              _("Can only get the pristine contents of files; "
                                "'%s' is not a file"),
@@ -428,7 +428,8 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
                             apr_pool_t *scratch_pool)
 {
   int format;
-  const char *repos_relpath;
+  const char *repos_relpath = svn_uri_skip_ancestor(repos_root_url, url,
+                                                    scratch_pool);
   svn_wc__db_status_t status;
   const char *db_repos_relpath, *db_repos_root_url, *db_repos_uuid;
   svn_revnum_t db_revision;
@@ -437,15 +438,11 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
   SVN_ERR_ASSERT(url != NULL);
   SVN_ERR_ASSERT(repos_root_url != NULL);
   SVN_ERR_ASSERT(repos_uuid != NULL);
-  SVN_ERR_ASSERT(svn_uri__is_ancestor(repos_root_url, url));
+  SVN_ERR_ASSERT(repos_relpath != NULL);
 
   SVN_ERR(svn_wc__internal_check_wc(&format, db, local_abspath, TRUE,
                                     scratch_pool));
 
-  repos_relpath = svn_uri__is_child(repos_root_url, url, scratch_pool);
-  if (repos_relpath == NULL)
-    repos_relpath = "";
-
   /* Early out: we know we're not dealing with an existing wc, so
      just create one. */
   if (format == 0)
@@ -503,7 +500,7 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
       /* ### comparing URLs, should they be canonicalized first? */
       if (strcmp(db_repos_uuid, repos_uuid)
           || strcmp(db_repos_root_url, repos_root_url)
-          || !svn_relpath__is_ancestor(db_repos_relpath, repos_relpath))
+          || !svn_relpath_skip_ancestor(db_repos_relpath, repos_relpath))
         {
           const char *copyfrom_root_url, *copyfrom_repos_relpath;
 

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=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/adm_ops.c Fri Jan 13 21:40:26 2012
@@ -123,7 +123,7 @@ process_committed_leaf(svn_wc__db_t *db,
                        apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   const svn_checksum_t *copied_checksum;
   svn_revnum_t new_changed_rev = new_revnum;
   svn_boolean_t have_base;
@@ -145,7 +145,7 @@ process_committed_leaf(svn_wc__db_t *db,
   {
     const char *adm_abspath;
 
-    if (kind == svn_wc__db_kind_dir)
+    if (kind == svn_kind_dir)
       adm_abspath = local_abspath;
     else
       adm_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
@@ -174,9 +174,10 @@ process_committed_leaf(svn_wc__db_t *db,
     }
 
   SVN_ERR_ASSERT(status == svn_wc__db_status_normal
+                 || status == svn_wc__db_status_incomplete
                  || status == svn_wc__db_status_added);
 
-  if (kind != svn_wc__db_kind_dir)
+  if (kind != svn_kind_dir)
     {
       /* If we sent a delta (meaning: post-copy modification),
          then this file will appear in the queue and so we should have
@@ -249,7 +250,7 @@ svn_wc__process_committed_internal(svn_w
                                    const svn_wc_committed_queue_t *queue,
                                    apr_pool_t *scratch_pool)
 {
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
 
   /* NOTE: be wary of making crazy semantic changes in this function, since
      svn_wc_process_committed4() calls this.  */
@@ -265,7 +266,7 @@ svn_wc__process_committed_internal(svn_w
      have been deleted */
   SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, TRUE, scratch_pool));
 
-  if (recurse && kind == svn_wc__db_kind_dir)
+  if (recurse && kind == svn_kind_dir)
     {
       const apr_array_header_t *children;
       apr_pool_t *iterpool = svn_pool_create(scratch_pool);
@@ -301,7 +302,7 @@ svn_wc__process_committed_internal(svn_w
             continue;
 
           sha1_checksum = NULL;
-          if (kind != svn_wc__db_kind_dir && queue != NULL)
+          if (kind != svn_kind_dir && queue != NULL)
             {
               const committed_queue_item_t *cqi;
 
@@ -594,6 +595,168 @@ erase_unversioned_from_wc(const char *pa
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_wc__delete_many(svn_wc_context_t *wc_ctx,
+                    const apr_array_header_t *targets,
+                    svn_boolean_t keep_local,
+                    svn_boolean_t delete_unversioned_target,
+                    svn_cancel_func_t cancel_func,
+                    void *cancel_baton,
+                    svn_wc_notify_func2_t notify_func,
+                    void *notify_baton,
+                    apr_pool_t *scratch_pool)
+{
+  svn_wc__db_t *db = wc_ctx->db;
+  svn_error_t *err;
+  svn_wc__db_status_t status;
+  svn_kind_t kind;
+  svn_boolean_t conflicted;
+  const apr_array_header_t *conflicts;
+  apr_array_header_t *versioned_targets;
+  const char *local_abspath;
+  int i;
+  apr_pool_t *iterpool;
+
+  iterpool = svn_pool_create(scratch_pool);
+  versioned_targets = apr_array_make(scratch_pool, targets->nelts,
+                                     sizeof(const char *));
+  for (i = 0; i < targets->nelts; i++)
+    {
+      svn_pool_clear(iterpool);
+
+      local_abspath = APR_ARRAY_IDX(targets, i, const char *);
+      err = svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL, &conflicted,
+                                 NULL, NULL, NULL, NULL, NULL, NULL,
+                                 db, local_abspath, iterpool, iterpool);
+
+      if (err)
+        {
+          if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+            {
+              svn_error_clear(err);
+              if (delete_unversioned_target && !keep_local)
+                SVN_ERR(erase_unversioned_from_wc(local_abspath, FALSE,
+                                                  cancel_func, cancel_baton,
+                                                  iterpool));
+              continue;
+            }
+         else
+          return svn_error_trace(err);
+        }
+
+      APR_ARRAY_PUSH(versioned_targets, const char *) = local_abspath;
+
+      switch (status)
+        {
+          /* svn_wc__db_status_server_excluded handled by
+           * svn_wc__db_op_delete_many */
+          case svn_wc__db_status_excluded:
+          case svn_wc__db_status_not_present:
+            return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+                                     _("'%s' cannot be deleted"),
+                                     svn_dirent_local_style(local_abspath,
+                                                            iterpool));
+
+          /* Explicitly ignore other statii */
+          default:
+            break;
+        }
+
+      if (status == svn_wc__db_status_normal
+          && kind == svn_kind_dir)
+        {
+          svn_boolean_t is_wcroot;
+          SVN_ERR(svn_wc__db_is_wcroot(&is_wcroot, db, local_abspath,
+                                       iterpool));
+
+          if (is_wcroot)
+            return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
+                                     _("'%s' is the root of a working copy and "
+                                       "cannot be deleted"),
+                                     svn_dirent_local_style(local_abspath,
+                                                            iterpool));
+        }
+
+      /* Verify if we have a write lock on the parent of this node as we might
+         be changing the childlist of that directory. */
+      SVN_ERR(svn_wc__write_check(db, svn_dirent_dirname(local_abspath,
+                                                         iterpool),
+                                  iterpool));
+
+      /* Read conflicts, to allow deleting the markers after updating the DB */
+      if (!keep_local && conflicted)
+        SVN_ERR(svn_wc__db_read_conflicts(&conflicts, db, local_abspath,
+                                          scratch_pool, iterpool));
+
+    }
+
+  if (versioned_targets->nelts == 0)
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_wc__db_op_delete_many(db, versioned_targets,
+                                    cancel_func, cancel_baton,
+                                    notify_func, notify_baton, scratch_pool));
+
+  if (!keep_local && conflicted && conflicts != NULL)
+    {
+      svn_pool_clear(iterpool);
+
+      /* Do we have conflict markers that should be removed? */
+      for (i = 0; i < conflicts->nelts; i++)
+        {
+          const svn_wc_conflict_description2_t *desc;
+
+          desc = APR_ARRAY_IDX(conflicts, i,
+                               const svn_wc_conflict_description2_t*);
+
+          if (desc->kind == svn_wc_conflict_kind_text)
+            {
+              if (desc->base_abspath != NULL)
+                {
+                  SVN_ERR(svn_io_remove_file2(desc->base_abspath, TRUE,
+                                              iterpool));
+                }
+              if (desc->their_abspath != NULL)
+                {
+                  SVN_ERR(svn_io_remove_file2(desc->their_abspath, TRUE,
+                                              iterpool));
+                }
+              if (desc->my_abspath != NULL)
+                {
+                  SVN_ERR(svn_io_remove_file2(desc->my_abspath, TRUE,
+                                              iterpool));
+                }
+            }
+          else if (desc->kind == svn_wc_conflict_kind_property
+                   && desc->their_abspath != NULL)
+            {
+              SVN_ERR(svn_io_remove_file2(desc->their_abspath, TRUE,
+                                          iterpool));
+            }
+        }
+    }
+
+  /* By the time we get here, the db knows that all targets are now
+   * unversioned. */
+  if (!keep_local)
+    {
+      for (i = 0; i < versioned_targets->nelts; i++)
+        {
+          svn_pool_clear(iterpool);
+
+          local_abspath = APR_ARRAY_IDX(versioned_targets, i, const char *);
+          SVN_ERR(erase_unversioned_from_wc(local_abspath, TRUE,
+                                            cancel_func, cancel_baton,
+                                            iterpool));
+        }
+    }
+
+  svn_pool_destroy(iterpool);
+
+  return SVN_NO_ERROR;
+}
 
 svn_error_t *
 svn_wc__delete_internal(svn_wc_context_t *wc_ctx,
@@ -611,7 +774,7 @@ svn_wc__delete_internal(svn_wc_context_t
   svn_wc__db_t *db = wc_ctx->db;
   svn_error_t *err;
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_boolean_t conflicted;
   const apr_array_header_t *conflicts;
 
@@ -650,7 +813,7 @@ svn_wc__delete_internal(svn_wc_context_t
     }
 
   if (status == svn_wc__db_status_normal
-      && kind == svn_wc__db_kind_dir)
+      && kind == svn_kind_dir)
     {
       svn_boolean_t is_wcroot;
       SVN_ERR(svn_wc__db_is_wcroot(&is_wcroot, db, local_abspath, pool));
@@ -788,7 +951,7 @@ check_can_add_to_parent(const char **rep
 {
   const char *parent_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
   svn_wc__db_status_t parent_status;
-  svn_wc__db_kind_t parent_kind;
+  svn_kind_t parent_kind;
   svn_error_t *err;
 
   SVN_ERR(svn_wc__write_check(db, parent_abspath, scratch_pool));
@@ -821,7 +984,7 @@ check_can_add_to_parent(const char **rep
                           svn_dirent_local_style(local_abspath,
                                                  scratch_pool));
     }
-  else if (parent_kind != svn_wc__db_kind_dir)
+  else if (parent_kind != svn_kind_dir)
     return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
                              _("Can't schedule an addition of '%s'"
                                " below a not-directory node"),
@@ -1165,7 +1328,7 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
                                          repos_relpath,
                                          repos_root_url, repos_uuid,
                                          copyfrom_rev,
-                                         NULL /* children */, depth,
+                                         NULL /* children */, FALSE, depth,
                                          NULL /* conflicts */,
                                          NULL /* work items */,
                                          scratch_pool));
@@ -1297,11 +1460,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. */
@@ -1354,7 +1517,7 @@ revert_restore_handle_copied_dirs(svn_bo
       if (cancel_func)
         SVN_ERR(cancel_func(cancel_baton));
 
-      if (child_info->kind != svn_wc__db_kind_file)
+      if (child_info->kind != svn_kind_file)
         continue;
 
       svn_pool_clear(iterpool);
@@ -1384,7 +1547,7 @@ revert_restore_handle_copied_dirs(svn_bo
       if (cancel_func)
         SVN_ERR(cancel_func(cancel_baton));
 
-      if (child_info->kind != svn_wc__db_kind_dir)
+      if (child_info->kind != svn_kind_dir)
         continue;
 
       svn_pool_clear(iterpool);
@@ -1439,7 +1602,7 @@ revert_restore(svn_wc__db_t *db,
 {
   svn_error_t *err;
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_node_kind_t on_disk;
   svn_boolean_t notify_required;
   const char *conflict_old;
@@ -1453,7 +1616,7 @@ revert_restore(svn_wc__db_t *db,
   svn_boolean_t special;
 #endif
   svn_boolean_t copied_here;
-  svn_wc__db_kind_t reverted_kind;
+  svn_kind_t reverted_kind;
 
   if (cancel_func)
     SVN_ERR(cancel_func(cancel_baton));
@@ -1497,7 +1660,7 @@ revert_restore(svn_wc__db_t *db,
            * ### trying to restore anything to disk.
            * ### 'status' should be status_unknown but that doesn't exist. */
           status = svn_wc__db_status_normal;
-          kind = svn_wc__db_kind_unknown;
+          kind = svn_kind_unknown;
           recorded_size = SVN_INVALID_FILESIZE;
           recorded_mod_time = 0;
         }
@@ -1538,12 +1701,12 @@ revert_restore(svn_wc__db_t *db,
   if (copied_here)
     {
       /* The revert target itself is the op-root of a copy. */
-      if (reverted_kind == svn_wc__db_kind_file && on_disk == svn_node_file)
+      if (reverted_kind == svn_kind_file && on_disk == svn_node_file)
         {
           SVN_ERR(svn_io_remove_file2(local_abspath, TRUE, scratch_pool));
           on_disk = svn_node_none;
         }
-      else if (reverted_kind == svn_wc__db_kind_dir && on_disk == svn_node_dir)
+      else if (reverted_kind == svn_kind_dir && on_disk == svn_node_dir)
         {
           svn_boolean_t removed;
 
@@ -1565,13 +1728,13 @@ revert_restore(svn_wc__db_t *db,
       && status != svn_wc__db_status_excluded
       && status != svn_wc__db_status_not_present)
     {
-      if (on_disk == svn_node_dir && kind != svn_wc__db_kind_dir)
+      if (on_disk == svn_node_dir && kind != svn_kind_dir)
         {
           SVN_ERR(svn_io_remove_dir2(local_abspath, FALSE,
                                      cancel_func, cancel_baton, scratch_pool));
           on_disk = svn_node_none;
         }
-      else if (on_disk == svn_node_file && kind != svn_wc__db_kind_file)
+      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;
@@ -1696,10 +1859,10 @@ revert_restore(svn_wc__db_t *db,
       && status != svn_wc__db_status_excluded
       && status != svn_wc__db_status_not_present)
     {
-      if (kind == svn_wc__db_kind_dir)
+      if (kind == svn_kind_dir)
         SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, scratch_pool));
 
-      if (kind == svn_wc__db_kind_file)
+      if (kind == svn_kind_file)
         {
           svn_skel_t *work_item;
 
@@ -1730,7 +1893,7 @@ revert_restore(svn_wc__db_t *db,
                                      scratch_pool),
                 scratch_pool);
 
-  if (depth == svn_depth_infinity && kind == svn_wc__db_kind_dir)
+  if (depth == svn_depth_infinity && kind == svn_kind_dir)
     {
       apr_pool_t *iterpool = svn_pool_create(scratch_pool);
       const apr_array_header_t *children;
@@ -1946,11 +2109,11 @@ revert_partial(svn_wc__db_t *db,
       /* For svn_depth_files: don't revert non-files.  */
       if (depth == svn_depth_files)
         {
-          svn_wc__db_kind_t kind;
+          svn_kind_t kind;
 
           SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, TRUE,
                                        iterpool));
-          if (kind != svn_wc__db_kind_file)
+          if (kind != svn_kind_file)
             continue;
         }
 
@@ -2092,7 +2255,7 @@ svn_wc__internal_remove_from_revision_co
   svn_error_t *err;
   svn_boolean_t left_something = FALSE;
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
 
   /* ### This whole function should be rewritten to run inside a transaction,
      ### to allow a stable cancel behavior.
@@ -2116,7 +2279,7 @@ svn_wc__internal_remove_from_revision_co
                                NULL, NULL, NULL, NULL,
                                db, local_abspath, scratch_pool, scratch_pool));
 
-  if (kind == svn_wc__db_kind_file || kind == svn_wc__db_kind_symlink)
+  if (kind == svn_kind_file || kind == svn_kind_symlink)
     {
       svn_boolean_t text_modified_p = FALSE;
 
@@ -2140,7 +2303,7 @@ svn_wc__internal_remove_from_revision_co
       /* Remove NAME from DB */
       SVN_ERR(svn_wc__db_op_remove_node(db, local_abspath,
                                         SVN_INVALID_REVNUM,
-                                        svn_wc__db_kind_unknown,
+                                        svn_kind_unknown,
                                         scratch_pool));
 
       /* If we were asked to destroy the working file, do so unless
@@ -2172,7 +2335,7 @@ svn_wc__internal_remove_from_revision_co
           const char *node_name = APR_ARRAY_IDX(children, i, const char*);
           const char *node_abspath;
           svn_wc__db_status_t node_status;
-          svn_wc__db_kind_t node_kind;
+          svn_kind_t node_kind;
 
           svn_pool_clear(iterpool);
 
@@ -2187,7 +2350,7 @@ svn_wc__internal_remove_from_revision_co
                                        iterpool, iterpool));
 
           if (node_status == svn_wc__db_status_normal
-              && node_kind == svn_wc__db_kind_dir)
+              && node_kind == svn_kind_dir)
             {
               svn_boolean_t is_root;
 
@@ -2206,7 +2369,7 @@ svn_wc__internal_remove_from_revision_co
                  versioned nodes */
               SVN_ERR(svn_wc__db_op_remove_node(db, node_abspath,
                                                 SVN_INVALID_REVNUM,
-                                                svn_wc__db_kind_unknown,
+                                                svn_kind_unknown,
                                                 iterpool));
 
               continue;
@@ -2250,7 +2413,7 @@ svn_wc__internal_remove_from_revision_co
           {
             SVN_ERR(svn_wc__db_op_remove_node(db, local_abspath,
                                               SVN_INVALID_REVNUM,
-                                              svn_wc__db_kind_unknown,
+                                              svn_kind_unknown,
                                               iterpool));
           }
         else

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/ambient_depth_filter_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/ambient_depth_filter_editor.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/ambient_depth_filter_editor.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/ambient_depth_filter_editor.c Fri Jan 13 21:40:26 2012
@@ -117,7 +117,7 @@ struct dir_baton
    obtaining information for the ambient depth editor */
 static svn_error_t *
 ambient_read_info(svn_wc__db_status_t *status,
-                  svn_wc__db_kind_t *kind,
+                  svn_kind_t *kind,
                   svn_depth_t *depth,
                   svn_wc__db_t *db,
                   const char *local_abspath,
@@ -136,7 +136,7 @@ ambient_read_info(svn_wc__db_status_t *s
     {
       svn_error_clear(err);
 
-      *kind = svn_wc__db_kind_unknown;
+      *kind = svn_kind_unknown;
       if (status)
         *status = svn_wc__db_status_normal;
       if (depth)
@@ -186,7 +186,7 @@ make_dir_baton(struct dir_baton **d_p,
     {
       svn_boolean_t exclude;
       svn_wc__db_status_t status;
-      svn_wc__db_kind_t kind;
+      svn_kind_t kind;
       svn_boolean_t exists = TRUE;
 
       if (!added)
@@ -197,10 +197,10 @@ make_dir_baton(struct dir_baton **d_p,
       else
         {
           status = svn_wc__db_status_not_present;
-          kind = svn_wc__db_kind_unknown;
+          kind = svn_kind_unknown;
         }
 
-      exists = (kind != svn_wc__db_kind_unknown);
+      exists = (kind != svn_kind_unknown);
 
       if (pb->ambient_depth == svn_depth_empty
           || pb->ambient_depth == svn_depth_files)
@@ -246,7 +246,7 @@ make_file_baton(struct file_baton **f_p,
   struct file_baton *f = apr_pcalloc(pool, sizeof(*f));
   struct edit_baton *eb = pb->edit_baton;
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   const char *abspath;
 
   SVN_ERR_ASSERT(path);
@@ -268,7 +268,7 @@ make_file_baton(struct file_baton **f_p,
   else
     {
       status = svn_wc__db_status_not_present;
-      kind = svn_wc__db_kind_unknown;
+      kind = svn_kind_unknown;
     }
 
   if (pb->ambient_depth == svn_depth_empty)
@@ -281,7 +281,7 @@ make_file_baton(struct file_baton **f_p,
       if (status == svn_wc__db_status_not_present
           || status == svn_wc__db_status_server_excluded
           || status == svn_wc__db_status_excluded
-          || kind == svn_wc__db_kind_unknown)
+          || kind == svn_kind_unknown)
         {
           f->ambiently_excluded = TRUE;
           *f_p = f;
@@ -340,7 +340,7 @@ open_root(void *edit_baton,
   if (! *eb->target)
     {
       /* For an update with a NULL target, this is equivalent to open_dir(): */
-      svn_wc__db_kind_t kind;
+      svn_kind_t kind;
       svn_wc__db_status_t status;
       svn_depth_t depth;
 
@@ -349,7 +349,7 @@ open_root(void *edit_baton,
                                 eb->db, eb->anchor_abspath,
                                 pool));
 
-      if (kind != svn_wc__db_kind_unknown
+      if (kind != svn_kind_unknown
           && status != svn_wc__db_status_not_present
           && status != svn_wc__db_status_excluded
           && status != svn_wc__db_status_server_excluded)
@@ -380,7 +380,7 @@ delete_entry(const char *path,
       /* If the entry we want to delete doesn't exist, that's OK.
          It's probably an old server that doesn't understand
          depths. */
-      svn_wc__db_kind_t kind;
+      svn_kind_t kind;
       svn_wc__db_status_t status;
       const char *abspath;
 
@@ -389,7 +389,7 @@ delete_entry(const char *path,
       SVN_ERR(ambient_read_info(&status, &kind, NULL,
                                 eb->db, abspath, pool));
 
-      if (kind == svn_wc__db_kind_unknown
+      if (kind == svn_kind_unknown
           || status == svn_wc__db_status_not_present
           || status == svn_wc__db_status_excluded
           || status == svn_wc__db_status_server_excluded)
@@ -458,7 +458,7 @@ open_directory(const char *path,
   struct edit_baton *eb = pb->edit_baton;
   struct dir_baton *b;
   const char *local_abspath;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_wc__db_status_t status;
   svn_depth_t depth;
 
@@ -480,7 +480,7 @@ open_directory(const char *path,
   SVN_ERR(ambient_read_info(&status, &kind, &depth,
                             eb->db, local_abspath, pool));
 
-  if (kind != svn_wc__db_kind_unknown
+  if (kind != svn_kind_unknown
       && status != svn_wc__db_status_not_present
       && status != svn_wc__db_status_excluded
       && status != svn_wc__db_status_server_excluded)

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/cleanup.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/cleanup.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/cleanup.c Fri Jan 13 21:40:26 2012
@@ -76,7 +76,7 @@ repair_timestamps(svn_wc__db_t *db,
                   void *cancel_baton,
                   apr_pool_t *scratch_pool)
 {
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_wc__db_status_t status;
 
   if (cancel_func)
@@ -95,15 +95,15 @@ repair_timestamps(svn_wc__db_t *db,
       || status == svn_wc__db_status_not_present)
     return SVN_NO_ERROR;
 
-  if (kind == svn_wc__db_kind_file
-      || kind == svn_wc__db_kind_symlink)
+  if (kind == svn_kind_file
+      || kind == svn_kind_symlink)
     {
       svn_boolean_t modified;
       SVN_ERR(svn_wc__internal_file_modified_p(&modified,
                                                db, local_abspath, FALSE,
                                                scratch_pool));
     }
-  else if (kind == svn_wc__db_kind_dir)
+  else if (kind == svn_kind_dir)
     {
       apr_pool_t *iterpool = svn_pool_create(scratch_pool);
       const apr_array_header_t *children;

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/conflicts.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/conflicts.c Fri Jan 13 21:40:26 2012
@@ -180,7 +180,7 @@ resolve_conflict_on_node(svn_wc__db_t *d
   const char *conflict_new = NULL;
   const char *conflict_working = NULL;
   const char *prop_reject_file = NULL;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   int i;
   const apr_array_header_t *conflicts;
   const char *conflict_dir_abspath;
@@ -208,7 +208,7 @@ resolve_conflict_on_node(svn_wc__db_t *d
         prop_reject_file = desc->their_abspath;
     }
 
-  if (kind == svn_wc__db_kind_dir)
+  if (kind == svn_kind_dir)
     conflict_dir_abspath = local_abspath;
   else
     conflict_dir_abspath = svn_dirent_dirname(local_abspath, pool);
@@ -503,7 +503,7 @@ recursive_resolve_conflict(svn_wc__db_t 
       const char *name = APR_ARRAY_IDX(children, i, const char *);
       const char *child_abspath;
       svn_wc__db_status_t status;
-      svn_wc__db_kind_t kind;
+      svn_kind_t kind;
       svn_boolean_t conflicted;
 
       svn_pool_clear(iterpool);
@@ -526,10 +526,10 @@ recursive_resolve_conflict(svn_wc__db_t 
         continue;
 
       apr_hash_set(visited, name, APR_HASH_KEY_STRING, name);
-      if (kind == svn_wc__db_kind_dir && depth < svn_depth_immediates)
+      if (kind == svn_kind_dir && depth < svn_depth_immediates)
         continue;
 
-      if (kind == svn_wc__db_kind_dir)
+      if (kind == svn_kind_dir)
         SVN_ERR(recursive_resolve_conflict(db,
                                            child_abspath,
                                            conflicted,
@@ -603,7 +603,7 @@ svn_wc_resolved_conflict5(svn_wc_context
                           void *notify_baton,
                           apr_pool_t *scratch_pool)
 {
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_boolean_t conflicted;
   /* ### the underlying code does NOT support resolving individual
      ### properties. bail out if the caller tries it.  */
@@ -621,7 +621,7 @@ svn_wc_resolved_conflict5(svn_wc_context
 
   /* When the implementation still used the entry walker, depth
      unknown was translated to infinity. */
-  if (kind != svn_wc__db_kind_dir)
+  if (kind != svn_kind_dir)
     depth = svn_depth_empty;
   else if (depth == svn_depth_unknown)
     depth = svn_depth_infinity;

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/conflicts.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/conflicts.h?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/conflicts.h (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/conflicts.h Fri Jan 13 21:40:26 2012
@@ -222,12 +222,12 @@ svn_error_t *
 svn_wc__conflict_skel_add_tree_conflict(
   svn_skel_t *skel,
   svn_wc_conflict_reason_t local_change,
-  svn_wc__db_kind_t original_local_kind,
+  svn_kind_t original_local_kind,
   const svn_checksum_t *original_checksum,
-  svn_wc__db_kind_t mine_local_kind,
+  svn_kind_t mine_local_kind,
   const svn_checksum_t *mine_checksum,
   svn_wc_conflict_action_t incoming_change,
-  svn_wc__db_kind_t incoming_kind,
+  svn_kind_t incoming_kind,
   const svn_checksum_t *incoming_checksum,
   apr_pool_t *result_pool,
   apr_pool_t *scratch_pool);

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/copy.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/copy.c Fri Jan 13 21:40:26 2012
@@ -183,7 +183,7 @@ copy_pristine_text_if_necessary(svn_wc__
    versioned file itself.
 
    This also works for versioned symlinks that are stored in the db as
-   svn_wc__db_kind_file with svn:special set. */
+   svn_kind_file with svn:special set. */
 static svn_error_t *
 copy_versioned_file(svn_wc__db_t *db,
                     const char *src_abspath,
@@ -410,7 +410,7 @@ copy_versioned_dir(svn_wc__db_t *db,
     {
       const char *child_name, *child_src_abspath, *child_dst_abspath;
       svn_wc__db_status_t child_status;
-      svn_wc__db_kind_t child_kind;
+      svn_kind_t child_kind;
       svn_boolean_t op_root;
       svn_boolean_t conflicted;
       const svn_checksum_t *checksum;
@@ -435,25 +435,26 @@ 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
           || child_status == svn_wc__db_status_added)
         {
           /* We have more work to do than just changing the DB */
-          if (child_kind == svn_wc__db_kind_file)
+          if (child_kind == svn_kind_file)
             {
               svn_boolean_t skip = FALSE;
 
               /* We should skip this node if this child is a file external
-                 (issue #3589) */
+                 (issues #3589, #4000) */
               if (child_status == svn_wc__db_status_normal)
                 {
                   SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, NULL, NULL,
                                                    NULL, NULL, NULL, NULL,
                                                    NULL, NULL, NULL, NULL,
                                                    NULL, NULL, &skip,
-                                                   db, src_abspath,
+                                                   db, child_src_abspath,
                                                    scratch_pool,
                                                    scratch_pool));
                 }
@@ -470,7 +471,7 @@ copy_versioned_dir(svn_wc__db_t *db,
                                             NULL, NULL,
                                             iterpool));
             }
-          else if (child_kind == svn_wc__db_kind_dir)
+          else if (child_kind == svn_kind_dir)
             SVN_ERR(copy_versioned_dir(db,
                                        child_src_abspath, child_dst_abspath,
                                        dst_op_root_abspath, tmpdir_abspath,
@@ -496,6 +497,15 @@ copy_versioned_dir(svn_wc__db_t *db,
           /* Don't recurse on children while all we do is creating not-present
              children */
         }
+      else if (child_status == svn_wc__db_status_incomplete)
+        {
+          /* Should go ahead and copy incomplete to incomplete? Try to
+             copy as much as possible, or give up early? */
+          return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
+                                   _("Cannot handle status of '%s'"),
+                                   svn_dirent_local_style(src_abspath,
+                                                          iterpool));
+        }
       else
         {
           SVN_ERR_ASSERT(child_status == svn_wc__db_status_server_excluded);
@@ -589,7 +599,7 @@ copy_or_move(svn_wc_context_t *wc_ctx,
              apr_pool_t *scratch_pool)
 {
   svn_wc__db_t *db = wc_ctx->db;
-  svn_wc__db_kind_t src_db_kind;
+  svn_kind_t src_db_kind;
   const char *dstdir_abspath;
   svn_boolean_t conflicted;
   const svn_checksum_t *checksum;
@@ -770,8 +780,8 @@ copy_or_move(svn_wc_context_t *wc_ctx,
                                          dst_abspath,
                                          scratch_pool, scratch_pool));
 
-  if (src_db_kind == svn_wc__db_kind_file
-      || src_db_kind == svn_wc__db_kind_symlink)
+  if (src_db_kind == svn_kind_file
+      || src_db_kind == svn_kind_symlink)
     {
       SVN_ERR(copy_versioned_file(db, src_abspath, dst_abspath, dst_abspath,
                                   tmpdir_abspath, checksum,
@@ -948,7 +958,7 @@ remove_all_conflict_markers(svn_wc__db_t
                             svn_dirent_join(wc_dir_abspath, name, iterpool),
                             iterpool));
         }
-      if (info->kind == svn_wc__db_kind_dir)
+      if (info->kind == svn_kind_dir)
         {
           svn_pool_clear(iterpool);
           SVN_ERR(remove_all_conflict_markers(
@@ -975,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 */,
@@ -982,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
@@ -990,7 +1005,7 @@ svn_wc_move(svn_wc_context_t *wc_ctx,
     SVN_ERR(svn_io_file_rename(src_abspath, dst_abspath, scratch_pool));
 
   {
-    svn_wc__db_kind_t kind;
+    svn_kind_t kind;
     svn_boolean_t conflicted;
 
     SVN_ERR(svn_wc__db_read_info(NULL, &kind, NULL, NULL, NULL, NULL, NULL,
@@ -1001,7 +1016,7 @@ svn_wc_move(svn_wc_context_t *wc_ctx,
                                  db, src_abspath,
                                  scratch_pool, scratch_pool));
 
-    if (kind == svn_wc__db_kind_dir)
+    if (kind == svn_kind_dir)
       SVN_ERR(remove_all_conflict_markers(db, src_abspath, dst_abspath,
                                           scratch_pool));
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/crop.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/crop.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/crop.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/crop.c Fri Jan 13 21:40:26 2012
@@ -98,7 +98,7 @@ crop_children(svn_wc__db_t *db,
       const char *child_name = APR_ARRAY_IDX(children, i, const char *);
       const char *child_abspath;
       svn_wc__db_status_t child_status;
-      svn_wc__db_kind_t kind;
+      svn_kind_t kind;
       svn_depth_t child_depth;
 
       svn_pool_clear(iterpool);
@@ -117,18 +117,18 @@ crop_children(svn_wc__db_t *db,
           child_status == svn_wc__db_status_excluded ||
           child_status == svn_wc__db_status_not_present)
         {
-          svn_depth_t remove_below = (kind == svn_wc__db_kind_dir)
+          svn_depth_t remove_below = (kind == svn_kind_dir)
                                             ? svn_depth_immediates
                                             : svn_depth_files;
           if (new_depth < remove_below)
             SVN_ERR(svn_wc__db_op_remove_node(db, local_abspath,
                                               SVN_INVALID_REVNUM,
-                                              svn_wc__db_kind_unknown,
+                                              svn_kind_unknown,
                                               iterpool));
 
           continue;
         }
-      else if (kind == svn_wc__db_kind_file)
+      else if (kind == svn_kind_file)
         {
           /* We currently crop on a directory basis. So don't worry about
              svn_depth_exclude here. And even we permit excluding a single
@@ -148,7 +148,7 @@ crop_children(svn_wc__db_t *db,
             continue;
 
         }
-      else if (kind == svn_wc__db_kind_dir)
+      else if (kind == svn_kind_dir)
         {
           if (new_depth < svn_depth_immediates)
             {
@@ -209,7 +209,7 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
 {
   svn_boolean_t is_root, is_switched;
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_revnum_t revision;
   const char *repos_relpath, *repos_root, *repos_uuid;
 
@@ -318,7 +318,7 @@ svn_wc_crop_tree2(svn_wc_context_t *wc_c
 {
   svn_wc__db_t *db = wc_ctx->db;
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_depth_t dir_depth;
 
   /* Only makes sense when the depth is restrictive. */
@@ -335,7 +335,7 @@ svn_wc_crop_tree2(svn_wc_context_t *wc_c
                                db, local_abspath,
                                scratch_pool, scratch_pool));
 
-  if (kind != svn_wc__db_kind_dir)
+  if (kind != svn_kind_dir)
     return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
       _("Can only crop directories"));
 

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=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/deprecated.c Fri Jan 13 21:40:26 2012
@@ -930,10 +930,10 @@ svn_wc_add3(const char *path,
   /* Make sure the caller gets the new access baton in the set. */
   if (svn_wc__adm_retrieve_internal2(wc_db, local_abspath, pool) == NULL)
     {
-      svn_wc__db_kind_t kind;
+      svn_kind_t kind;
 
       SVN_ERR(svn_wc__db_read_kind(&kind, wc_db, local_abspath, FALSE, pool));
-      if (kind == svn_wc__db_kind_dir)
+      if (kind == svn_kind_dir)
         {
           svn_wc_adm_access_t *adm_access;
 
@@ -3426,6 +3426,14 @@ svn_wc_get_switch_editor(svn_revnum_t *t
 }
 
 
+svn_error_t *
+svn_wc_external_item_create(const svn_wc_external_item2_t **item,
+                            apr_pool_t *pool)
+{
+  *item = apr_pcalloc(pool, sizeof(svn_wc_external_item2_t));
+  return SVN_NO_ERROR;
+}
+
 svn_wc_external_item_t *
 svn_wc_external_item_dup(const svn_wc_external_item_t *item,
                          apr_pool_t *pool)

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=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/diff_editor.c Fri Jan 13 21:40:26 2012
@@ -839,7 +839,7 @@ walk_local_nodes_diff(struct edit_baton 
       const char *name = APR_ARRAY_IDX(children, i, const char*);
       const char *child_abspath, *child_path;
       svn_wc__db_status_t status;
-      svn_wc__db_kind_t kind;
+      svn_kind_t kind;
 
       svn_pool_clear(iterpool);
 
@@ -875,12 +875,12 @@ walk_local_nodes_diff(struct edit_baton 
 
       switch (kind)
         {
-        case svn_wc__db_kind_file:
-        case svn_wc__db_kind_symlink:
+        case svn_kind_file:
+        case svn_kind_symlink:
           SVN_ERR(file_diff(eb, child_abspath, child_path, iterpool));
           break;
 
-        case svn_wc__db_kind_dir:
+        case svn_kind_dir:
           /* ### TODO: Don't know how to do replaced dirs. How do I get
              information about what is being replaced? If it was a
              directory then the directory elements are also going to be
@@ -1080,7 +1080,7 @@ report_wc_directory_as_added(struct edit
       const char *name = APR_ARRAY_IDX(children, i, const char *);
       const char *child_abspath, *child_path;
       svn_wc__db_status_t status;
-      svn_wc__db_kind_t kind;
+      svn_kind_t kind;
 
       svn_pool_clear(iterpool);
 
@@ -1111,13 +1111,13 @@ report_wc_directory_as_added(struct edit
 
       switch (kind)
         {
-        case svn_wc__db_kind_file:
-        case svn_wc__db_kind_symlink:
+        case svn_kind_file:
+        case svn_kind_symlink:
           SVN_ERR(report_wc_file_as_added(eb, child_abspath, child_path,
                                           iterpool));
           break;
 
-        case svn_wc__db_kind_dir:
+        case svn_kind_dir:
           if (depth > svn_depth_files || depth == svn_depth_unknown)
             {
               svn_depth_t depth_below_here = depth;
@@ -1187,7 +1187,7 @@ delete_entry(const char *path,
   const char *name = svn_dirent_basename(path, NULL);
   const char *local_abspath = svn_dirent_join(pb->local_abspath, name, pool);
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
 
   /* Mark this node as compared in the parent directory's baton. */
   apr_hash_set(pb->compared, apr_pstrdup(pb->pool, path),
@@ -1207,8 +1207,8 @@ delete_entry(const char *path,
   SVN_ERR(get_empty_file(pb->eb, &empty_file));
   switch (kind)
     {
-    case svn_wc__db_kind_file:
-    case svn_wc__db_kind_symlink:
+    case svn_kind_file:
+    case svn_kind_symlink:
       /* A delete is required to change working-copy into requested
          revision, so diff should show this as an add. Thus compare
          the empty file against the current working copy.  If
@@ -1245,7 +1245,7 @@ delete_entry(const char *path,
           SVN_ERR(report_wc_file_as_added(eb, local_abspath, path, pool));
         }
       break;
-    case svn_wc__db_kind_dir:
+    case svn_kind_dir:
       /* A delete is required to change working-copy into requested
          revision, so diff should show this as an add. */
       SVN_ERR(report_wc_directory_as_added(eb,
@@ -1880,6 +1880,9 @@ 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);
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(anchor_abspath));
 
@@ -1923,11 +1926,27 @@ svn_wc_get_diff_editor6(const svn_delta_
                                                 inner_baton,
                                                 result_pool));
 
-  return svn_delta_get_cancellation_editor(cancel_func,
-                                           cancel_baton,
-                                           inner_editor,
-                                           inner_baton,
-                                           editor,
-                                           edit_baton,
-                                           result_pool);
+  SVN_ERR(svn_delta_get_cancellation_editor(cancel_func,
+                                            cancel_baton,
+                                            inner_editor,
+                                            inner_baton,
+                                            editor,
+                                            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 = 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));
+
+  return SVN_NO_ERROR;
 }

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/diff_local.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/diff_local.c Fri Jan 13 21:40:26 2012
@@ -138,7 +138,7 @@ file_diff(struct diff_baton *eb,
   const char *empty_file;
   const char *original_repos_relpath;
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_revnum_t revision;
   const svn_checksum_t *checksum;
   svn_boolean_t op_root;
@@ -167,7 +167,7 @@ file_diff(struct diff_baton *eb,
 
       if (replaced && base_replace /* && !have_more_work */)
         {
-          svn_wc__db_kind_t base_kind;
+          svn_kind_t base_kind;
           SVN_ERR(svn_wc__db_base_get_info(&base_status, &base_kind,
                                            &base_revision,
                                            NULL, NULL, NULL, NULL, NULL, NULL,
@@ -560,14 +560,14 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
              apr_pool_t *scratch_pool)
 {
   struct diff_baton eb = { 0 };
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_boolean_t get_all;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
   SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, local_abspath, FALSE,
                                scratch_pool));
 
-  if (kind == svn_wc__db_kind_dir)
+  if (kind == svn_kind_dir)
       eb.anchor_abspath = local_abspath;
   else
     eb.anchor_abspath = svn_dirent_dirname(local_abspath, scratch_pool);



Mime
View raw message