subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1621377 [2/4] - in /subversion/branches/authzperf: ./ build/ notes/ notes/api-errata/1.8/ notes/api-errata/1.9/ notes/wc-ng/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/binding...
Date Fri, 29 Aug 2014 19:58:42 GMT
Modified: subversion/branches/authzperf/subversion/libsvn_fs_x/id.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_x/id.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_x/id.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_x/id.c Fri Aug 29 19:58:40 2014
@@ -264,7 +264,7 @@ svn_fs_x__id_check_related(const svn_fs_
   /* Items from different txns are unrelated. */
   if (   svn_fs_x__is_txn(id_a->noderev_id.change_set)
       && svn_fs_x__is_txn(id_b->noderev_id.change_set)
-      && id_a->noderev_id.change_set != id_a->noderev_id.change_set)
+      && id_a->noderev_id.change_set != id_b->noderev_id.change_set)
     return FALSE;
 
   /* related if they trace back to the same node creation */

Modified: subversion/branches/authzperf/subversion/libsvn_fs_x/index.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_x/index.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_x/index.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_x/index.c Fri Aug 29 19:58:40 2014
@@ -638,10 +638,9 @@ encode_l2p_page(apr_array_header_t *entr
         }
       else
         {
-          apr_uintptr_t idx
-            = (apr_uintptr_t)apr_hash_get(containers, &entry->offset,
-                                          sizeof(entry->offset));
-          if (idx == 0)
+          void *void_idx = apr_hash_get(containers, &entry->offset,
+                                        sizeof(entry->offset));
+          if (void_idx == NULL)
             {
               apr_uint64_t value = entry->offset + container_count;
               SVN_ERR(svn_spillbuf__write(buffer, (const char *)encoded,
@@ -649,6 +648,7 @@ encode_l2p_page(apr_array_header_t *entr
             }
           else
             {
+              apr_uintptr_t idx = (apr_uintptr_t)void_idx;
               apr_uint64_t value = entry->sub_item;
               SVN_ERR(svn_spillbuf__write(buffer, (const char *)encoded,
                                           encode_uint(encoded, idx), pool));

Modified: subversion/branches/authzperf/subversion/libsvn_fs_x/noderevs.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_x/noderevs.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_x/noderevs.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_x/noderevs.c Fri Aug 29 19:58:40 2014
@@ -210,6 +210,7 @@ store_id(apr_array_header_t *ids,
 {
   binary_id_t bin_id = { { 0 } };
   int idx;
+  void *idx_void;
 
   if (id == NULL)
     return 0;
@@ -218,7 +219,8 @@ store_id(apr_array_header_t *ids,
   bin_id.copy_id = *svn_fs_x__id_copy_id(id);
   bin_id.noderev_id = *svn_fs_x__id_noderev_id(id);
 
-  idx = (int)(apr_uintptr_t)apr_hash_get(dict, &bin_id, sizeof(bin_id));
+  idx_void = apr_hash_get(dict, &bin_id, sizeof(bin_id));
+  idx = (int)(apr_uintptr_t)idx_void;
   if (idx == 0)
     {
       APR_ARRAY_PUSH(ids, binary_id_t) = bin_id;
@@ -240,6 +242,7 @@ store_representation(apr_array_header_t 
 {
   binary_representation_t binary_rep = { 0 };
   int idx;
+  void *idx_void;
 
   if (rep == NULL)
     return 0;
@@ -251,8 +254,8 @@ store_representation(apr_array_header_t 
   binary_rep.size = rep->size;
   binary_rep.expanded_size = rep->expanded_size;
 
-  idx = (int)(apr_uintptr_t)apr_hash_get(dict, &binary_rep,
-                                         sizeof(binary_rep));
+  idx_void = apr_hash_get(dict, &binary_rep, sizeof(binary_rep));
+  idx = (int)(apr_uintptr_t)idx_void;
   if (idx == 0)
     {
       APR_ARRAY_PUSH(reps, binary_representation_t) = binary_rep;

Modified: subversion/branches/authzperf/subversion/libsvn_fs_x/string_table.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_x/string_table.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_x/string_table.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_x/string_table.c Fri Aug 29 19:58:40 2014
@@ -284,12 +284,13 @@ svn_fs_x__string_table_builder_add(strin
   string = apr_pstrmemdup(builder->pool, string, len);
   if (len > MAX_SHORT_STRING_LEN)
     {
+      void *idx_void;
       svn_string_t item;
       item.data = string;
       item.len = len;
-      
-      result
-        = (apr_uintptr_t)apr_hash_get(table->long_string_dict, string, len);
+
+      idx_void = apr_hash_get(table->long_string_dict, string, len);
+      result = (apr_uintptr_t)idx_void;
       if (result)
         return result - 1
              + LONG_STRING_MASK

Modified: subversion/branches/authzperf/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_x/tree.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_x/tree.c Fri Aug 29 19:58:40 2014
@@ -2460,7 +2460,7 @@ typedef enum copy_type_t
   copy_type_plain_add,
 
   /* add with history */
-  copy_type_add_with_history,
+  copy_type_add_with_history
 } copy_type_t;
 
 /* Copy the node at FROM_PATH under FROM_ROOT to TO_PATH under

Modified: subversion/branches/authzperf/subversion/libsvn_ra_serf/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_ra_serf/replay.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_ra_serf/replay.c Fri Aug 29 19:58:40 2014
@@ -61,7 +61,7 @@ typedef enum replay_state_e {
   REPLAY_CLOSE_DIRECTORY,
   REPLAY_CHANGE_DIRECTORY_PROP,
   REPLAY_CHANGE_FILE_PROP,
-  REPLAY_APPLY_TEXTDELTA,
+  REPLAY_APPLY_TEXTDELTA
 } replay_state_e;
 
 #define S_ SVN_XML_NAMESPACE

Modified: subversion/branches/authzperf/subversion/libsvn_ra_svn/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_ra_svn/cyrus_auth.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_ra_svn/cyrus_auth.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_ra_svn/cyrus_auth.c Fri Aug 29 19:58:40 2014
@@ -93,7 +93,7 @@ static svn_error_t *
 sasl_mutex_alloc_cb_internal(svn_mutex__t **mutex)
 {
   if (apr_is_empty_array(free_mutexes))
-    return svn_mutex__init(mutex, TRUE, FALSE, sasl_pool);
+    return svn_mutex__init(mutex, TRUE, sasl_pool);
   else
     *mutex = *((svn_mutex__t**)apr_array_pop(free_mutexes));
 
@@ -179,7 +179,7 @@ svn_ra_svn__sasl_common_init(apr_pool_t 
                  sasl_mutex_unlock_cb,
                  sasl_mutex_free_cb);
   free_mutexes = apr_array_make(sasl_pool, 0, sizeof(svn_mutex__t *));
-  SVN_ERR(svn_mutex__init(&array_mutex, TRUE, FALSE, sasl_pool));
+  SVN_ERR(svn_mutex__init(&array_mutex, TRUE, sasl_pool));
 
 #endif /* APR_HAS_THREADS */
 

Modified: subversion/branches/authzperf/subversion/libsvn_subr/cache-inprocess.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/cache-inprocess.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/cache-inprocess.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/cache-inprocess.c Fri Aug 29 19:58:40 2014
@@ -680,7 +680,7 @@ svn_cache__create_inprocess(svn_cache__t
   /* The sentinel doesn't need a pool.  (We're happy to crash if we
    * accidentally try to treat it like a real page.) */
 
-  SVN_ERR(svn_mutex__init(&cache->mutex, thread_safe, FALSE, pool));
+  SVN_ERR(svn_mutex__init(&cache->mutex, thread_safe, pool));
 
   cache->cache_pool = pool;
 

Modified: subversion/branches/authzperf/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/cache-membuffer.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/cache-membuffer.c Fri Aug 29 19:58:40 2014
@@ -1817,7 +1817,7 @@ svn_cache__membuffer_cache_create(svn_me
        */
 #  if USE_SIMPLE_MUTEX
 
-      SVN_ERR(svn_mutex__init(&c[seg].lock, thread_safe, FALSE, pool));
+      SVN_ERR(svn_mutex__init(&c[seg].lock, thread_safe, pool));
 
 #  else
 
@@ -1840,8 +1840,7 @@ svn_cache__membuffer_cache_create(svn_me
       /* Since a simple mutex already guarantees fully serialized access,
          we need this mutex only when we use multple-reader-1-writer locks. */
       SVN_ERR(svn_mutex__init(&c[seg].counter_mutex,
-                              thread_safe && !USE_SIMPLE_MUTEX, FALSE,
-                              pool));
+                              thread_safe && !USE_SIMPLE_MUTEX, pool));
     }
 
   /* done here
@@ -3132,7 +3131,7 @@ svn_cache__create_membuffer_cache(svn_ca
   cache->priority = priority;
   cache->key_len = klen;
 
-  SVN_ERR(svn_mutex__init(&cache->mutex, thread_safe, FALSE, result_pool));
+  SVN_ERR(svn_mutex__init(&cache->mutex, thread_safe, result_pool));
 
   /* for performance reasons, we don't actually store the full prefix but a
    * hash value of it

Modified: subversion/branches/authzperf/subversion/libsvn_subr/dso.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/dso.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/dso.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/dso.c Fri Aug 29 19:58:40 2014
@@ -55,7 +55,7 @@ svn_dso_initialize2(void)
 
   dso_pool = svn_pool_create(NULL);
 
-  SVN_ERR(svn_mutex__init(&dso_mutex, TRUE, TRUE, dso_pool));
+  SVN_ERR(svn_mutex__init(&dso_mutex, TRUE, dso_pool));
 
   dso_cache = apr_hash_make(dso_pool);
   return SVN_NO_ERROR;

Modified: subversion/branches/authzperf/subversion/libsvn_subr/mutex.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/mutex.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/mutex.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/mutex.c Fri Aug 29 19:58:40 2014
@@ -35,37 +35,21 @@
  */
 struct svn_mutex__t
 {
-  /* If TRUE, perform extra checks to detect attempts at recursive locking. */
-  svn_boolean_t checked;
-
 #if APR_HAS_THREADS
 
   apr_thread_mutex_t *mutex;
 
-  /* The owner of this lock, if locked or NULL, otherwise.  Since NULL might
-   * be a valid owner ID on some systems, checking for NULL may not be 100%
-   * accurate.  Be sure to only produce false negatives in that case.
-   * We can't use apr_os_thread_t directly here as there is no portable way
-   * to access them atomically.  Instead, we assume that it can always be
-   * cast safely to a pointer.
-   * This value will only be modified while the lock is being held.  So,
-   * setting and resetting it is never racy (but reading it may be).
-   * Only used when CHECKED is set. */
-  volatile void *owner;
-
 #else
 
-  /* If there is no multi-threading support, simply count lock attempts. */
-  int count;
+  /* Truly empty structs are not allowed. */
+  int dummy;
 
 #endif
-
 };
 
 svn_error_t *
 svn_mutex__init(svn_mutex__t **mutex_p,
                 svn_boolean_t mutex_required,
-                svn_boolean_t checked,
                 apr_pool_t *result_pool)
 {
   /* always initialize the mutex pointer, even though it is not
@@ -85,7 +69,6 @@ svn_mutex__init(svn_mutex__t **mutex_p,
         return svn_error_wrap_apr(status, _("Can't create mutex"));
 #endif
 
-      mutex->checked = checked;
       *mutex_p = mutex;
     }
 
@@ -98,64 +81,9 @@ svn_mutex__lock(svn_mutex__t *mutex)
   if (mutex)
     {
 #if APR_HAS_THREADS
-      apr_status_t status;
-      void *current_thread;
-      void *lock_owner;
-
-      /* Detect recursive locking attempts. */
-      if (mutex->checked)
-        {
-          /* "us" */
-          current_thread = (void *)apr_os_thread_current();
-
-          /* Get the current owner value without actually modifying it
-             (idempotent replacement of NULL by NULL).  We need the atomic
-             operation here since other threads may be writing to this
-             variable while we read it (in which case LOCK_OWNER and
-             CURRENT_THREAD will differ). */
-          lock_owner = apr_atomic_casptr(&mutex->owner, NULL, NULL);
-
-          /* If this matches, svn_mutex__unlock did not reset the owner
-             since this thread acquired the lock:  Because there is no
-             exit condition between that reset and the actual mutex unlock,
-             and because no other thread would set the owner to this value,
-             this thread has simply not released the mutex. */
-          if (lock_owner &&
-              apr_os_thread_equal((apr_os_thread_t)lock_owner,
-                                  (apr_os_thread_t)current_thread))
-            return svn_error_create(SVN_ERR_RECURSIVE_LOCK, NULL, 
-                                    _("Recursive locks are not supported"));
-        }
-
-      /* Acquire the mutex.  In the meantime, other threads may acquire and
-         release the same lock.  Once we got the lock, however, it is in a
-         defined state. */
-      status = apr_thread_mutex_lock(mutex->mutex);
+      apr_status_t status = apr_thread_mutex_lock(mutex->mutex);
       if (status)
         return svn_error_wrap_apr(status, _("Can't lock mutex"));
-
-      /* We own the lock now. */
-      if (mutex->checked)
-        {
-          /* It must have been released by the previous owner as part of
-             the mutex unlock. */
-          SVN_ERR_ASSERT(apr_atomic_casptr(&mutex->owner, NULL, NULL) == NULL);
-
-          /* Set "us" as the new owner. */
-          apr_atomic_casptr(&mutex->owner, current_thread, NULL);
-        }
-#else
-      if (mutex->checked)
-        {
-          /* We want non-threaded systems to detect the same coding errors
-             as threaded systems.  No further sync required. */
-          if (mutex->count)
-            return svn_error_create(SVN_ERR_RECURSIVE_LOCK, NULL, 
-                                    _("Recursive locks are not supported"));
-
-          /* Update lock counter. */
-          ++mutex->count;
-        }
 #endif
     }
 
@@ -169,49 +97,9 @@ svn_mutex__unlock(svn_mutex__t *mutex,
   if (mutex)
     {
 #if APR_HAS_THREADS
-      apr_status_t status;
-
-      /* We will soon no longer be the owner of this lock.  So, reset the
-         OWNER value.  This makes no difference to the recursion check in
-         *other* threads; they are known not to hold this mutex and will
-         not assume that they do after we set the OWNER to NULL.  And the
-         current thread is known not to attempt a recursive lock right now;
-         it cannot be in two places at the same time. */
-      if (mutex->checked)
-        {
-          /* Reading the current OWNER value is faster and more reliable
-             than asking APR for the current thread id (APR might return
-             different but equivalent IDs for the same thread). */
-          void *lock_owner = apr_atomic_casptr(&mutex->owner, NULL, NULL);
-
-          /* Check for double unlock. */
-          if (lock_owner == NULL)
-            {
-              /* There seems to be no guarantee that NULL is _not_ a valid
-                 thread ID.  Double check to be sure. */
-              if (!apr_os_thread_equal((apr_os_thread_t)lock_owner,
-                                       apr_os_thread_current()))
-                SVN_ERR_MALFUNCTION();
-            }
-
-          /* Now, set it to NULL. */
-          apr_atomic_casptr(&mutex->owner, NULL,  lock_owner);
-        }
-
-      /* Release the actual mutex. */
-      status = apr_thread_mutex_unlock(mutex->mutex);
+      apr_status_t status = apr_thread_mutex_unlock(mutex->mutex);
       if (status && !err)
         return svn_error_wrap_apr(status, _("Can't unlock mutex"));
-#else
-      /* Update lock counter. */
-      if (mutex->checked)
-        {
-          /* Trying to release a non-locked mutex? */
-          if (mutex->count <= 0)
-            SVN_ERR_MALFUNCTION();
-
-          --mutex->count;
-        }
 #endif
     }
 

Modified: subversion/branches/authzperf/subversion/libsvn_subr/named_atomic.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/named_atomic.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/named_atomic.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/named_atomic.c Fri Aug 29 19:58:40 2014
@@ -266,7 +266,7 @@ init_thread_mutex(void *baton, apr_pool_
   /* let the mutex live as long as the APR */
   apr_pool_t *global_pool = svn_pool_create(NULL);
 
-  return svn_mutex__init(&thread_mutex, USE_THREAD_MUTEX, TRUE, global_pool);
+  return svn_mutex__init(&thread_mutex, USE_THREAD_MUTEX, global_pool);
 }
 #endif /* APR_HAS_MMAP */
 

Modified: subversion/branches/authzperf/subversion/libsvn_subr/object_pool.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/object_pool.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/object_pool.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/object_pool.c Fri Aug 29 19:58:40 2014
@@ -329,7 +329,7 @@ svn_object_pool__create(svn_object_pool_
    * cleanup and to prevent threading issues with the allocator
    */
   result = apr_pcalloc(pool, sizeof(*result));
-  SVN_ERR(svn_mutex__init(&result->mutex, thread_safe, FALSE, pool));
+  SVN_ERR(svn_mutex__init(&result->mutex, thread_safe, pool));
 
   result->pool = pool;
   result->objects = svn_hash__make(result->pool);

Modified: subversion/branches/authzperf/subversion/libsvn_subr/root_pools.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/root_pools.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/root_pools.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/root_pools.c Fri Aug 29 19:58:40 2014
@@ -48,7 +48,7 @@ svn_root_pools__create(svn_root_pools__t
 
   /* construct result object */
   svn_root_pools__t *result = apr_pcalloc(pool, sizeof(*result));
-  SVN_ERR(svn_mutex__init(&result->mutex, TRUE, FALSE, pool));
+  SVN_ERR(svn_mutex__init(&result->mutex, TRUE, pool));
   result->unused_pools = apr_array_make(pool, 16, sizeof(apr_pool_t *));
 
   /* done */

Modified: subversion/branches/authzperf/subversion/libsvn_subr/sorts.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/sorts.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/sorts.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/sorts.c Fri Aug 29 19:58:40 2014
@@ -244,14 +244,48 @@ svn_sort__array_lookup(const apr_array_h
    * hit location) first.  This speeds up linear scans. */
   if (hint)
     {
-      idx = *hint;
-      *hint = ++idx;
-      if (idx >= 0 && idx < array->nelts)
+      /* We intend to insert right behind *HINT.
+       * Exit this function early, if we actually can. */
+      idx = *hint + 1;
+      if (idx >= array->nelts)
         {
+          /* We intend to insert after the last entry.
+           * That is only allowed if that last entry is smaller than KEY.
+           * In that case, there will be no current entry, i.e. we must
+           * return NULL. */
+          apr_size_t offset;
+
+          *hint = array->nelts;
+          if (array->nelts == 0)
+            return NULL;
+
+          offset = (array->nelts - 1) * array->elt_size;
+          if (compare_func(array->elts + offset, key) < 0)
+            return NULL;
+        }
+      else if (idx > 0)
+        {
+          /* Intend to insert at a position inside the array, i.e. not
+           * at one of the boundaries.  The predecessor must be smaller
+           * and the current entry at IDX must be larger than KEY. */
+		  void *previous;
+
+          *hint = idx;
+		  previous = array->elts + (idx-1) * array->elt_size;
           result = array->elts + idx * array->elt_size;
-          if (!compare_func(result, key))
+          if (compare_func(previous, key) && !compare_func(result, key))
             return result;
         }
+      else if (idx <= 0)
+        {
+          /* Intend to insert at the beginning of an non-empty array.
+           * That requires the first entry to be larger than KEY. */
+          *hint = 0;
+          if (!compare_func(array->elts, key))
+            return array->elts;
+        }
+
+      /* The HINT did not help. */
     }
 
   idx = bsearch_lower_bound(key, array->elts, array->nelts, array->elt_size,

Modified: subversion/branches/authzperf/subversion/libsvn_subr/utf.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/utf.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/utf.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/utf.c Fri Aug 29 19:58:40 2014
@@ -132,7 +132,7 @@ svn_utf_initialize2(svn_boolean_t assume
          and pool allocation is not thread-safe. */
       apr_pool_t *subpool = svn_pool_create(pool);
       svn_mutex__t *mutex;
-      svn_error_t *err = svn_mutex__init(&mutex, TRUE, FALSE, subpool);
+      svn_error_t *err = svn_mutex__init(&mutex, TRUE, subpool);
       if (err)
         {
           svn_error_clear(err);

Modified: subversion/branches/authzperf/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_wc/conflicts.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_wc/conflicts.c Fri Aug 29 19:58:40 2014
@@ -508,7 +508,7 @@ svn_wc__conflict_skel_add_prop_conflict(
 }
 
 /* A map for svn_wc_conflict_reason_t values. */
-static const svn_token_map_t local_change_map[] =
+static const svn_token_map_t reason_map[] =
 {
   { "edited",           svn_wc_conflict_reason_edited },
   { "obstructed",       svn_wc_conflict_reason_obstructed },
@@ -522,7 +522,7 @@ static const svn_token_map_t local_chang
   { NULL }
 };
 
-static const svn_token_map_t incoming_change_map[] =
+static const svn_token_map_t action_map[] =
 {
   { "edited",           svn_wc_conflict_action_edit },
   { "added",            svn_wc_conflict_action_add },
@@ -535,8 +535,8 @@ svn_error_t *
 svn_wc__conflict_skel_add_tree_conflict(svn_skel_t *conflict_skel,
                                         svn_wc__db_t *db,
                                         const char *wri_abspath,
-                                        svn_wc_conflict_reason_t local_change,
-                                        svn_wc_conflict_action_t incoming_change,
+                                        svn_wc_conflict_reason_t reason,
+                                        svn_wc_conflict_action_t action,
                                         const char *move_src_op_root_abspath,
                                         apr_pool_t *result_pool,
                                         apr_pool_t *scratch_pool)
@@ -549,12 +549,12 @@ svn_wc__conflict_skel_add_tree_conflict(
 
   SVN_ERR_ASSERT(!tree_conflict); /* ### Use proper error? */
 
-  SVN_ERR_ASSERT(local_change == svn_wc_conflict_reason_moved_away
+  SVN_ERR_ASSERT(reason == svn_wc_conflict_reason_moved_away
                  || !move_src_op_root_abspath); /* ### Use proper error? */
 
   tree_conflict = svn_skel__make_empty_list(result_pool);
 
-  if (local_change == svn_wc_conflict_reason_moved_away
+  if (reason == svn_wc_conflict_reason_moved_away
       && move_src_op_root_abspath)
     {
       const char *move_src_op_root_relpath;
@@ -568,13 +568,11 @@ svn_wc__conflict_skel_add_tree_conflict(
                             result_pool);
     }
 
-  svn_skel__prepend_str(
-                svn_token__to_word(incoming_change_map, incoming_change),
-                tree_conflict, result_pool);
-
-  svn_skel__prepend_str(
-                svn_token__to_word(local_change_map, local_change),
-                tree_conflict, result_pool);
+  svn_skel__prepend_str(svn_token__to_word(action_map, action),
+                        tree_conflict, result_pool);
+
+  svn_skel__prepend_str(svn_token__to_word(reason_map, reason),
+                        tree_conflict, result_pool);
 
   /* Tree conflicts have no marker files */
   markers = svn_skel__make_empty_list(result_pool);
@@ -930,8 +928,8 @@ svn_wc__conflict_read_prop_conflict(cons
 }
 
 svn_error_t *
-svn_wc__conflict_read_tree_conflict(svn_wc_conflict_reason_t *local_change,
-                                    svn_wc_conflict_action_t *incoming_change,
+svn_wc__conflict_read_tree_conflict(svn_wc_conflict_reason_t *reason,
+                                    svn_wc_conflict_action_t *action,
                                     const char **move_src_op_root_abspath,
                                     svn_wc__db_t *db,
                                     const char *wri_abspath,
@@ -956,28 +954,28 @@ svn_wc__conflict_read_tree_conflict(svn_
   c = c->next; /* Skip markers */
 
   {
-    int value = svn_token__from_mem(local_change_map, c->data, c->len);
+    int value = svn_token__from_mem(reason_map, c->data, c->len);
 
-    if (local_change)
+    if (reason)
       {
         if (value != SVN_TOKEN_UNKNOWN)
-          *local_change = value;
+          *reason = value;
         else
-          *local_change = svn_wc_conflict_reason_edited;
+          *reason = svn_wc_conflict_reason_edited;
       }
 
       is_moved_away = (value == svn_wc_conflict_reason_moved_away);
     }
   c = c->next;
 
-  if (incoming_change)
+  if (action)
     {
-      int value = svn_token__from_mem(incoming_change_map, c->data, c->len);
+      int value = svn_token__from_mem(action_map, c->data, c->len);
 
       if (value != SVN_TOKEN_UNKNOWN)
-        *incoming_change = value;
+        *action = value;
       else
-        *incoming_change = svn_wc_conflict_action_edit;
+        *action = svn_wc_conflict_action_edit;
     }
 
   c = c->next;
@@ -1049,69 +1047,8 @@ svn_wc__conflict_read_markers(const apr_
 
 /* --------------------------------------------------------------------
  */
-/* Helper for svn_wc__conflict_create_markers */
-static svn_skel_t *
-prop_conflict_skel_new(apr_pool_t *result_pool)
-{
-  svn_skel_t *operation = svn_skel__make_empty_list(result_pool);
-  svn_skel_t *result = svn_skel__make_empty_list(result_pool);
-
-  svn_skel__prepend(operation, result);
-  return result;
-}
-
-
-/* Helper for prop_conflict_skel_add */
-static void
-prepend_prop_value(const svn_string_t *value,
-                   svn_skel_t *skel,
-                   apr_pool_t *result_pool)
-{
-  svn_skel_t *value_skel = svn_skel__make_empty_list(result_pool);
-
-  if (value != NULL)
-    {
-      const void *dup = apr_pmemdup(result_pool, value->data, value->len);
-
-      svn_skel__prepend(svn_skel__mem_atom(dup, value->len, result_pool),
-                        value_skel);
-    }
-
-  svn_skel__prepend(value_skel, skel);
-}
 
 
-/* Helper for svn_wc__conflict_create_markers */
-static svn_error_t *
-prop_conflict_skel_add(
-  svn_skel_t *skel,
-  const char *prop_name,
-  const svn_string_t *original_value,
-  const svn_string_t *mine_value,
-  const svn_string_t *incoming_value,
-  const svn_string_t *incoming_base_value,
-  apr_pool_t *result_pool,
-  apr_pool_t *scratch_pool)
-{
-  svn_skel_t *prop_skel = svn_skel__make_empty_list(result_pool);
-
-  /* ### check that OPERATION has been filled in.  */
-
-  /* See notes/wc-ng/conflict-storage  */
-  prepend_prop_value(incoming_base_value, prop_skel, result_pool);
-  prepend_prop_value(incoming_value, prop_skel, result_pool);
-  prepend_prop_value(mine_value, prop_skel, result_pool);
-  prepend_prop_value(original_value, prop_skel, result_pool);
-  svn_skel__prepend_str(apr_pstrdup(result_pool, prop_name), prop_skel,
-                        result_pool);
-  svn_skel__prepend_str(SVN_WC__CONFLICT_KIND_PROP, prop_skel, result_pool);
-
-  /* Now we append PROP_SKEL to the end of the provided conflict SKEL.  */
-  svn_skel__append(skel, prop_skel);
-
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_wc__conflict_create_markers(svn_skel_t **work_items,
                                 svn_wc__db_t *db,
@@ -1140,10 +1077,8 @@ svn_wc__conflict_create_markers(svn_skel
 
       /* Ok, currently we have to do a few things for property conflicts:
          - Create a marker file
-         - Create a WQ item that sets the marker name
-         - Create a WQ item that fills the marker with the expected data
-
-         This can be simplified once we really store conflict_skel in wc.db */
+         - Store the name in the conflict_skel
+         - Create a WQ item that fills the marker with the expected data */
 
       SVN_ERR(svn_io_check_path(local_abspath, &kind, scratch_pool));
 
@@ -1175,65 +1110,9 @@ svn_wc__conflict_create_markers(svn_skel
         svn_skel__prepend_str(marker_relpath, prop_conflict->children->next,
                             result_pool);
       }
-
-      /* Store the data in the WQ item in the same format used as 1.7.
-         Once we store the data in DB it is easier to just read it back
-         from the workqueue */
-      {
-        svn_skel_t *prop_data;
-        apr_hash_index_t *hi;
-        apr_hash_t *old_props;
-        apr_hash_t *mine_props;
-        apr_hash_t *their_original_props;
-        apr_hash_t *their_props;
-        apr_hash_t *conflicted_props;
-
-        SVN_ERR(svn_wc__conflict_read_prop_conflict(NULL,
-                                                    &mine_props,
-                                                    &their_original_props,
-                                                    &their_props,
-                                                    &conflicted_props,
-                                                    db, local_abspath,
-                                                    conflict_skel,
-                                                    scratch_pool,
-                                                    scratch_pool));
-
-        if (operation == svn_wc_operation_merge)
-          SVN_ERR(svn_wc__db_read_pristine_props(&old_props, db, local_abspath,
-                                                 scratch_pool, scratch_pool));
-        else
-          old_props = their_original_props;
-
-        prop_data = prop_conflict_skel_new(result_pool);
-
-        for (hi = apr_hash_first(scratch_pool, conflicted_props);
-             hi;
-             hi = apr_hash_next(hi))
-          {
-            const char *propname = apr_hash_this_key(hi);
-
-            SVN_ERR(prop_conflict_skel_add(
-                            prop_data, propname,
-                            old_props
-                                    ? svn_hash_gets(old_props, propname)
-                                    : NULL,
-                            mine_props
-                                    ? svn_hash_gets(mine_props, propname)
-                                    : NULL,
-                            their_props
-                                    ? svn_hash_gets(their_props, propname)
-                                      : NULL,
-                            their_original_props
-                                    ? svn_hash_gets(their_original_props, propname)
-                                      : NULL,
-                            result_pool, scratch_pool));
-          }
-
-        SVN_ERR(svn_wc__wq_build_prej_install(work_items,
-                                              db, local_abspath,
-                                              prop_data,
-                                              scratch_pool, scratch_pool));
-      }
+      SVN_ERR(svn_wc__wq_build_prej_install(work_items,
+                                            db, local_abspath,
+                                            scratch_pool, scratch_pool));
     }
 
   return SVN_NO_ERROR;
@@ -1278,7 +1157,7 @@ generate_propconflict(svn_boolean_t *con
                       apr_pool_t *scratch_pool)
 {
   svn_wc_conflict_result_t *result = NULL;
-  svn_wc_conflict_description3_t *cdesc;
+  svn_wc_conflict_description2_t *cdesc;
   const char *dirpath = svn_dirent_dirname(local_abspath, scratch_pool);
   svn_node_kind_t kind;
   const svn_string_t *new_value = NULL;
@@ -1295,7 +1174,7 @@ generate_propconflict(svn_boolean_t *con
                              svn_dirent_local_style(local_abspath,
                                                     scratch_pool));
 
-  cdesc = svn_wc_conflict_description_create_prop3(
+  cdesc = svn_wc_conflict_description_create_prop2(
                 local_abspath,
                 (kind == svn_node_dir) ? svn_node_dir : svn_node_file,
                 propname, scratch_pool);
@@ -1314,6 +1193,7 @@ generate_propconflict(svn_boolean_t *con
                                   svn_io_file_del_on_pool_cleanup,
                                   scratch_pool));
       cdesc->my_abspath = svn_dirent_join(dirpath, file_name, scratch_pool);
+      cdesc->prop_value_working = working_val;
     }
 
   if (incoming_new_val)
@@ -1324,7 +1204,11 @@ generate_propconflict(svn_boolean_t *con
                                   incoming_new_val->len,
                                   svn_io_file_del_on_pool_cleanup,
                                   scratch_pool));
-      cdesc->their_abspath = svn_dirent_join(dirpath, file_name, scratch_pool);
+
+      /* ### For property conflicts, cd2 stores prop_reject_abspath in
+       * ### their_abspath, and stores theirs_abspath in merged_file. */
+      cdesc->merged_file = svn_dirent_join(dirpath, file_name, scratch_pool);
+      cdesc->prop_value_incoming_new = incoming_new_val;
     }
 
   if (!base_val && !incoming_old_val)
@@ -1390,6 +1274,9 @@ generate_propconflict(svn_boolean_t *con
                                   svn_io_file_del_on_pool_cleanup, scratch_pool));
       cdesc->base_abspath = svn_dirent_join(dirpath, file_name, scratch_pool);
 
+      cdesc->prop_value_base = base_val;
+      cdesc->prop_value_incoming_old = incoming_old_val;
+
       if (working_val && incoming_new_val)
         {
           svn_stream_t *mergestream;
@@ -1397,8 +1284,7 @@ generate_propconflict(svn_boolean_t *con
           svn_diff_file_options_t *options =
             svn_diff_file_options_create(scratch_pool);
 
-          SVN_ERR(svn_stream_open_unique(&mergestream,
-                                         &cdesc->prop_reject_abspath,
+          SVN_ERR(svn_stream_open_unique(&mergestream, &cdesc->prop_reject_abspath,
                                          NULL, svn_io_file_del_on_pool_cleanup,
                                          scratch_pool, scratch_pool));
           SVN_ERR(svn_diff_mem_string_diff3(&diff, conflict_base_val,
@@ -1410,26 +1296,30 @@ generate_propconflict(svn_boolean_t *con
                    svn_diff_conflict_display_modified_latest,
                    cancel_func, cancel_baton, scratch_pool));
           SVN_ERR(svn_stream_close(mergestream));
+
+          /* ### For property conflicts, cd2 stores prop_reject_abspath in
+           * ### their_abspath, and stores theirs_abspath in merged_file. */
+          cdesc->their_abspath = cdesc->prop_reject_abspath;
         }
     }
 
   if (!incoming_old_val && incoming_new_val)
-    cdesc->incoming_change = svn_wc_conflict_action_add;
+    cdesc->action = svn_wc_conflict_action_add;
   else if (incoming_old_val && !incoming_new_val)
-    cdesc->incoming_change = svn_wc_conflict_action_delete;
+    cdesc->action = svn_wc_conflict_action_delete;
   else
-    cdesc->incoming_change = svn_wc_conflict_action_edit;
+    cdesc->action = svn_wc_conflict_action_edit;
 
   if (base_val && !working_val)
-    cdesc->local_change = svn_wc_conflict_reason_deleted;
+    cdesc->reason = svn_wc_conflict_reason_deleted;
   else if (!base_val && working_val)
-    cdesc->local_change = svn_wc_conflict_reason_obstructed;
+    cdesc->reason = svn_wc_conflict_reason_obstructed;
   else
-    cdesc->local_change = svn_wc_conflict_reason_edited;
+    cdesc->reason = svn_wc_conflict_reason_edited;
 
   /* Invoke the interactive conflict callback. */
-  SVN_ERR(conflict_func(&result, svn_wc__cd3_to_cd2(cdesc, scratch_pool),
-                        conflict_baton, scratch_pool, scratch_pool));
+  SVN_ERR(conflict_func(&result, cdesc, conflict_baton, scratch_pool,
+                        scratch_pool));
   if (result == NULL)
     {
       *conflict_remains = TRUE;
@@ -1475,7 +1365,7 @@ generate_propconflict(svn_boolean_t *con
         {
           svn_stringbuf_t *merged_stringbuf;
 
-          if (!cdesc->merged_abspath && !result->merged_file)
+          if (!cdesc->merged_file && !result->merged_file)
             return svn_error_create
                 (SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
                  NULL, _("Conflict callback violated API:"
@@ -1484,7 +1374,7 @@ generate_propconflict(svn_boolean_t *con
           SVN_ERR(svn_stringbuf_from_file2(&merged_stringbuf,
                                            result->merged_file ?
                                                 result->merged_file :
-                                                cdesc->merged_abspath,
+                                                cdesc->merged_file,
                                            scratch_pool));
           new_value = svn_stringbuf__morph_into_string(merged_stringbuf);
           *conflict_remains = FALSE;
@@ -1608,7 +1498,7 @@ eval_text_conflict_func_result(svn_skel_
                                const apr_array_header_t *merge_options,
                                const char *left_abspath,
                                const char *right_abspath,
-                               const char *merged_abspath,
+                               const char *merged_file,
                                const char *detranslated_target,
                                svn_cancel_func_t cancel_func,
                                void *cancel_baton,
@@ -1673,7 +1563,7 @@ eval_text_conflict_func_result(svn_skel_
            good to use". */
       case svn_wc_conflict_choose_merged:
         {
-          install_from_abspath = merged_abspath;
+          install_from_abspath = merged_file;
           *is_resolved = TRUE;
           break;
         }
@@ -1785,7 +1675,7 @@ resolve_text_conflict(svn_skel_t **work_
                       svn_boolean_t *was_resolved,
                       svn_wc__db_t *db,
                       const char *local_abspath,
-                      svn_wc_conflict_description3_t *cdesc,
+                      svn_wc_conflict_description2_t *cdesc,
                       const apr_array_header_t *merge_options,
                       svn_wc_conflict_resolver_func2_t conflict_func,
                       void *conflict_baton,
@@ -1803,8 +1693,8 @@ resolve_text_conflict(svn_skel_t **work_
   /* Give the conflict resolution callback a chance to clean
      up the conflicts before we mark the file 'conflicted' */
 
-  SVN_ERR(conflict_func(&result, svn_wc__cd3_to_cd2(cdesc, scratch_pool),
-                        conflict_baton, scratch_pool, scratch_pool));
+  SVN_ERR(conflict_func(&result, cdesc, conflict_baton, scratch_pool,
+                        scratch_pool));
   if (result == NULL)
     return svn_error_create(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
                             _("Conflict callback violated API:"
@@ -1818,7 +1708,7 @@ resolve_text_conflict(svn_skel_t **work_
                                     merged-file first: */
                                 result->merged_file
                                   ? result->merged_file
-                                  : cdesc->merged_abspath,
+                                  : cdesc->merged_file,
                                 result_pool, scratch_pool));
     }
 
@@ -1834,7 +1724,7 @@ resolve_text_conflict(svn_skel_t **work_
                                              /* ### Sure this is an abspath? */
                                              result->merged_file
                                                ? result->merged_file
-                                               : cdesc->merged_abspath,
+                                               : cdesc->merged_file,
                                              cdesc->my_abspath,
                                              cancel_func, cancel_baton,
                                              result_pool, scratch_pool));
@@ -1858,7 +1748,7 @@ resolve_text_conflict(svn_skel_t **work_
  * Allocate results in RESULT_POOL.  SCRATCH_POOL is used for temporary
  * allocations. */
 static svn_error_t *
-read_text_conflict_desc(svn_wc_conflict_description3_t **desc,
+read_text_conflict_desc(svn_wc_conflict_description2_t **desc,
                         svn_wc__db_t *db,
                         const char *local_abspath,
                         const svn_skel_t *conflict_skel,
@@ -1870,7 +1760,7 @@ read_text_conflict_desc(svn_wc_conflict_
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool)
 {
-  *desc = svn_wc_conflict_description_create_text3(local_abspath, result_pool);
+  *desc = svn_wc_conflict_description_create_text2(local_abspath, result_pool);
   (*desc)->is_binary = is_binary;
   (*desc)->mime_type = mime_type;
   (*desc)->operation = operation;
@@ -1883,7 +1773,7 @@ read_text_conflict_desc(svn_wc_conflict_
                                               db, local_abspath,
                                               conflict_skel,
                                               result_pool, scratch_pool));
-  (*desc)->merged_abspath = apr_pstrdup(result_pool, local_abspath);
+  (*desc)->merged_file = apr_pstrdup(result_pool, local_abspath);
 
   return SVN_NO_ERROR;
 }
@@ -1898,7 +1788,7 @@ read_text_conflict_desc(svn_wc_conflict_
  * Allocate results in RESULT_POOL.  SCRATCH_POOL is used for temporary
  * allocations. */
 static svn_error_t *
-read_tree_conflict_desc(svn_wc_conflict_description3_t **desc,
+read_tree_conflict_desc(svn_wc_conflict_description2_t **desc,
                         svn_wc__db_t *db,
                         const char *local_abspath,
                         const svn_skel_t *conflict_skel,
@@ -1908,27 +1798,69 @@ read_tree_conflict_desc(svn_wc_conflict_
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool)
 {
-  svn_node_kind_t tc_kind;
-  svn_wc_conflict_reason_t local_change;
-  svn_wc_conflict_action_t incoming_change;
+  svn_node_kind_t local_kind;
+  svn_wc_conflict_reason_t reason;
+  svn_wc_conflict_action_t action;
 
   SVN_ERR(svn_wc__conflict_read_tree_conflict(
-            &local_change, &incoming_change, NULL,
+            &reason, &action, NULL,
             db, local_abspath, conflict_skel, scratch_pool, scratch_pool));
 
-  if (left_version)
-    tc_kind = left_version->node_kind;
-  else if (right_version)
-    tc_kind = right_version->node_kind;
+  if (reason == svn_wc_conflict_reason_missing)
+    local_kind = svn_node_none;
+  else if (reason == svn_wc_conflict_reason_unversioned ||
+           reason == svn_wc_conflict_reason_obstructed)
+    SVN_ERR(svn_io_check_path(local_abspath, &local_kind, scratch_pool));
+  else if (operation == svn_wc_operation_merge)
+    {
+      /* ### If the merge replaced the node, this will read the kind of
+       * ### the merge-right node, which is not necessarily the node
+       * ### kind of the tree conflict victim.
+       * ### This needs the BASE node kind if the node was not replaced
+       * ### at the time the merge was run. But if the node was already
+       * ### replaced before the merge, it needs the kind of the replacing
+       * ### node. Ideally, we'd store the victim node kind in conflict
+       * ### storage instead of guessing it here...
+       */
+      /* Read the tree conflict victim's node kind from the working copy,
+         or if it doesn't exist directly from disk. */
+      SVN_ERR(svn_wc__db_read_kind(&local_kind, db, local_abspath,
+                                   TRUE /* allow missing */,
+                                   FALSE /* show deleted */,
+                                   FALSE /* show hidden */, scratch_pool));
+
+      if (local_kind == svn_node_unknown || local_kind == svn_node_none)
+        SVN_ERR(svn_io_check_path(local_abspath, &local_kind, scratch_pool));
+    }
+  else if (operation == svn_wc_operation_update ||
+           operation == svn_wc_operation_switch)
+    {
+      /* For updates, the left version corresponds to the pre-update state. */
+      if (left_version)
+        local_kind = left_version->node_kind;
+      else
+        {
+          /* No left version is available, so the conflict was flagged
+           * because of a locally added node which was not part of the
+           * BASE tree before the update. */
+          SVN_ERR(svn_wc__db_read_kind(&local_kind, db, local_abspath,
+                                       TRUE /* allow missing */,
+                                       TRUE /* show deleted */,
+                                       FALSE /* show hidden */, scratch_pool));
+          if (local_kind == svn_node_unknown || local_kind == svn_node_none)
+            SVN_ERR(svn_io_check_path(local_abspath, &local_kind,
+                                      scratch_pool));
+        }
+    }
   else
-    tc_kind = svn_node_file; /* Avoid assertion */
+    SVN_ERR_MALFUNCTION();
 
-  *desc = svn_wc_conflict_description_create_tree3(local_abspath, tc_kind,
+  *desc = svn_wc_conflict_description_create_tree2(local_abspath, local_kind,
                                                    operation,
                                                    left_version, right_version,
                                                    result_pool);
-  (*desc)->local_change = local_change;
-  (*desc)->incoming_change = incoming_change;
+  (*desc)->reason = reason;
+  (*desc)->action = action;
 
   return SVN_NO_ERROR;
 }
@@ -2050,7 +1982,7 @@ svn_wc__conflict_invoke_resolver(svn_wc_
     {
       svn_skel_t *work_items;
       svn_boolean_t was_resolved;
-      svn_wc_conflict_description3_t *desc;
+      svn_wc_conflict_description2_t *desc;
       apr_hash_t *props;
 
       SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath,
@@ -2090,7 +2022,7 @@ svn_wc__conflict_invoke_resolver(svn_wc_
   if (tree_conflicted)
     {
       svn_wc_conflict_result_t *result;
-      svn_wc_conflict_description3_t *desc;
+      svn_wc_conflict_description2_t *desc;
 
       SVN_ERR(read_tree_conflict_desc(&desc,
                                       db, local_abspath, conflict_skel,
@@ -2098,8 +2030,8 @@ svn_wc__conflict_invoke_resolver(svn_wc_
                                       scratch_pool, scratch_pool));
 
       /* Tell the resolver func about this conflict. */
-      SVN_ERR(resolver_func(&result, svn_wc__cd3_to_cd2(desc, scratch_pool),
-                            resolver_baton, scratch_pool, scratch_pool));
+      SVN_ERR(resolver_func(&result, desc, resolver_baton, scratch_pool,
+                            scratch_pool));
 
       /* Ignore the result. We cannot apply it here since this code runs
        * during an update or merge operation. Tree conflicts are always
@@ -2136,6 +2068,7 @@ read_prop_conflict_descs(apr_array_heade
                          apr_pool_t *scratch_pool)
 {
   const char *prop_reject_file;
+  apr_hash_t *base_props;
   apr_hash_t *my_props;
   apr_hash_t *their_old_props;
   apr_hash_t *their_props;
@@ -2155,23 +2088,28 @@ read_prop_conflict_descs(apr_array_heade
   if ((! create_tempfiles) || apr_hash_count(conflicted_props) == 0)
     {
       /* Legacy prop conflict with only a .reject file. */
-      svn_wc_conflict_description3_t *desc;
+      svn_wc_conflict_description2_t *desc;
 
-      desc  = svn_wc_conflict_description_create_prop3(local_abspath,
+      desc  = svn_wc_conflict_description_create_prop2(local_abspath,
                                                        node_kind,
                                                        "", result_pool);
 
+      /* ### For property conflicts, cd2 stores prop_reject_abspath in
+       * ### their_abspath, and stores theirs_abspath in merged_file. */
       desc->prop_reject_abspath = apr_pstrdup(result_pool, prop_reject_file);
+      desc->their_abspath = desc->prop_reject_abspath;
 
       desc->operation = operation;
       desc->src_left_version = left_version;
       desc->src_right_version = right_version;
 
-      APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description3_t *) = desc;
+      APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description2_t *) = desc;
 
       return SVN_NO_ERROR;
     }
 
+  SVN_ERR(svn_wc__db_base_get_props(&base_props, db, local_abspath,
+                                    result_pool, scratch_pool));
   iterpool = svn_pool_create(scratch_pool);
   for (hi = apr_hash_first(scratch_pool, conflicted_props);
        hi;
@@ -2181,11 +2119,11 @@ read_prop_conflict_descs(apr_array_heade
       svn_string_t *old_value;
       svn_string_t *my_value;
       svn_string_t *their_value;
-      svn_wc_conflict_description3_t *desc;
+      svn_wc_conflict_description2_t *desc;
 
       svn_pool_clear(iterpool);
 
-      desc = svn_wc_conflict_description_create_prop3(local_abspath,
+      desc = svn_wc_conflict_description_create_prop2(local_abspath,
                                                       node_kind,
                                                       propname,
                                                       result_pool);
@@ -2202,26 +2140,27 @@ read_prop_conflict_descs(apr_array_heade
 
       /* Compute the incoming side of the conflict ('action'). */
       if (their_value == NULL)
-        desc->incoming_change = svn_wc_conflict_action_delete;
+        desc->action = svn_wc_conflict_action_delete;
       else if (old_value == NULL)
-        desc->incoming_change = svn_wc_conflict_action_add;
+        desc->action = svn_wc_conflict_action_add;
       else
-        desc->incoming_change = svn_wc_conflict_action_edit;
+        desc->action = svn_wc_conflict_action_edit;
 
       /* Compute the local side of the conflict ('reason'). */
       if (my_value == NULL)
-        desc->local_change = svn_wc_conflict_reason_deleted;
+        desc->reason = svn_wc_conflict_reason_deleted;
       else if (old_value == NULL)
-        desc->local_change = svn_wc_conflict_reason_added;
+        desc->reason = svn_wc_conflict_reason_added;
       else
-        desc->local_change = svn_wc_conflict_reason_edited;
+        desc->reason = svn_wc_conflict_reason_edited;
 
+      /* ### For property conflicts, cd2 stores prop_reject_abspath in
+       * ### their_abspath, and stores theirs_abspath in merged_file. */
       desc->prop_reject_abspath = apr_pstrdup(result_pool, prop_reject_file);
+      desc->their_abspath = desc->prop_reject_abspath;
+
+      desc->prop_value_base = svn_hash_gets(base_props, propname);
 
-      /* ### This should be changed. The conflict description for
-       * ### props should contain these values as svn_string_t,
-       * ### rather than in temporary files. We need to rev the
-       * ### conflict description struct for this. */
       if (my_value)
         {
           svn_stream_t *s;
@@ -2233,6 +2172,8 @@ read_prop_conflict_descs(apr_array_heade
           len = my_value->len;
           SVN_ERR(svn_stream_write(s, my_value->data, &len));
           SVN_ERR(svn_stream_close(s));
+
+          desc->prop_value_working = svn_string_dup(my_value, result_pool);
         }
 
       if (their_value)
@@ -2240,12 +2181,16 @@ read_prop_conflict_descs(apr_array_heade
           svn_stream_t *s;
           apr_size_t len;
 
-          SVN_ERR(svn_stream_open_unique(&s, &desc->their_abspath, NULL,
+          /* ### For property conflicts, cd2 stores prop_reject_abspath in
+           * ### their_abspath, and stores theirs_abspath in merged_file. */
+          SVN_ERR(svn_stream_open_unique(&s, &desc->merged_file, NULL,
                                          svn_io_file_del_on_pool_cleanup,
                                          result_pool, iterpool));
           len = their_value->len;
           SVN_ERR(svn_stream_write(s, their_value->data, &len));
           SVN_ERR(svn_stream_close(s));
+
+          desc->prop_value_incoming_new = svn_string_dup(their_value, result_pool);
         }
 
       if (old_value)
@@ -2259,9 +2204,11 @@ read_prop_conflict_descs(apr_array_heade
           len = old_value->len;
           SVN_ERR(svn_stream_write(s, old_value->data, &len));
           SVN_ERR(svn_stream_close(s));
+
+          desc->prop_value_incoming_old = svn_string_dup(old_value, result_pool);
         }
 
-      APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description3_t *) = desc;
+      APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description2_t *) = desc;
     }
   svn_pool_destroy(iterpool);
 
@@ -2293,7 +2240,7 @@ svn_wc__read_conflicts(const apr_array_h
     {
       /* Some callers expect not NULL */
       *conflicts = apr_array_make(result_pool, 0,
-                                  sizeof(svn_wc_conflict_description3_t *));;
+                                  sizeof(svn_wc_conflict_description2_t *));;
       return SVN_NO_ERROR;
     }
 
@@ -2303,7 +2250,7 @@ svn_wc__read_conflicts(const apr_array_h
                                      result_pool, scratch_pool));
 
   cflcts = apr_array_make(result_pool, 4,
-                          sizeof(svn_wc_conflict_description3_t *));
+                          sizeof(svn_wc_conflict_description2_t *));
 
   if (locations && locations->nelts > 0)
     left_version = APR_ARRAY_IDX(locations, 0, const svn_wc_conflict_version_t *);
@@ -2324,26 +2271,26 @@ svn_wc__read_conflicts(const apr_array_h
 
   if (text_conflicted)
     {
-      svn_wc_conflict_description3_t *desc;
+      svn_wc_conflict_description2_t *desc;
 
       SVN_ERR(read_text_conflict_desc(&desc,
                                       db, local_abspath, conflict_skel,
                                       FALSE /*is_binary*/, NULL /*mime_type*/,
                                       operation, left_version, right_version,
                                       result_pool, scratch_pool));
-      APR_ARRAY_PUSH(cflcts, svn_wc_conflict_description3_t *) = desc;
+      APR_ARRAY_PUSH(cflcts, svn_wc_conflict_description2_t *) = desc;
     }
 
   if (tree_conflicted)
     {
-      svn_wc_conflict_description3_t *desc;
+      svn_wc_conflict_description2_t *desc;
 
       SVN_ERR(read_tree_conflict_desc(&desc,
                                       db, local_abspath, conflict_skel,
                                       operation, left_version, right_version,
                                       result_pool, scratch_pool));
 
-      APR_ARRAY_PUSH(cflcts, const svn_wc_conflict_description3_t *) = desc;
+      APR_ARRAY_PUSH(cflcts, const svn_wc_conflict_description2_t *) = desc;
     }
 
   *conflicts = cflcts;
@@ -2980,12 +2927,12 @@ conflict_status_walker(void *baton,
 
   for (i = 0; i < conflicts->nelts; i++)
     {
-      const svn_wc_conflict_description3_t *cd;
+      const svn_wc_conflict_description2_t *cd;
       svn_boolean_t did_resolve;
       svn_wc_conflict_choice_t my_choice = cswb->conflict_choice;
       const char *merged_file = NULL;
 
-      cd = APR_ARRAY_IDX(conflicts, i, const svn_wc_conflict_description3_t *);
+      cd = APR_ARRAY_IDX(conflicts, i, const svn_wc_conflict_description2_t *);
 
       svn_pool_clear(iterpool);
 
@@ -2998,9 +2945,7 @@ conflict_status_walker(void *baton,
                                     _("No conflict-callback and no "
                                       "pre-defined conflict-choice provided"));
 
-          SVN_ERR(cswb->conflict_func(&result,
-                                      svn_wc__cd3_to_cd2(cd, scratch_pool),
-                                      cswb->conflict_baton,
+          SVN_ERR(cswb->conflict_func(&result, cd, cswb->conflict_baton,
                                       iterpool, iterpool));
 
           my_choice = result->choice;

Modified: subversion/branches/authzperf/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_wc/deprecated.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_wc/deprecated.c Fri Aug 29 19:58:40 2014
@@ -2735,11 +2735,9 @@ svn_wc__status2_from_3(svn_wc_status2_t 
 
   if (old_status->conflicted)
     {
-      const svn_wc_conflict_description3_t *tree_conflict;
       const svn_wc_conflict_description2_t *tree_conflict2;
-      SVN_ERR(svn_wc__get_tree_conflict(&tree_conflict, wc_ctx, local_abspath,
+      SVN_ERR(svn_wc__get_tree_conflict(&tree_conflict2, wc_ctx, local_abspath,
                                         scratch_pool, scratch_pool));
-      tree_conflict2 = svn_wc__cd3_to_cd2(tree_conflict, scratch_pool);
       (*status)->tree_conflict = svn_wc__cd2_to_cd(tree_conflict2, result_pool);
     }
 
@@ -4791,96 +4789,8 @@ svn_wc_read_kind(svn_node_kind_t *kind,
 }
 
 svn_wc_conflict_description2_t *
-svn_wc_conflict_description_create_text2(const char *local_abspath,
-                                         apr_pool_t *result_pool)
-{
-  svn_wc_conflict_description2_t *conflict;
-
-  SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
-
-  conflict = apr_pcalloc(result_pool, sizeof(*conflict));
-  conflict->local_abspath = apr_pstrdup(result_pool, local_abspath);
-  conflict->node_kind = svn_node_file;
-  conflict->kind = svn_wc_conflict_kind_text;
-  conflict->action = svn_wc_conflict_action_edit;
-  conflict->reason = svn_wc_conflict_reason_edited;
-  return conflict;
-}
-
-svn_wc_conflict_description2_t *
-svn_wc_conflict_description_create_prop2(const char *local_abspath,
-                                         svn_node_kind_t node_kind,
-                                         const char *property_name,
-                                         apr_pool_t *result_pool)
-{
-  svn_wc_conflict_description2_t *conflict;
-
-  SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
-
-  conflict = apr_pcalloc(result_pool, sizeof(*conflict));
-  conflict->local_abspath = apr_pstrdup(result_pool, local_abspath);
-  conflict->node_kind = node_kind;
-  conflict->kind = svn_wc_conflict_kind_property;
-  conflict->property_name = apr_pstrdup(result_pool, property_name);
-  return conflict;
-}
-
-svn_wc_conflict_description2_t *
-svn_wc_conflict_description_create_tree2(
-  const char *local_abspath,
-  svn_node_kind_t node_kind,
-  svn_wc_operation_t operation,
-  const svn_wc_conflict_version_t *src_left_version,
-  const svn_wc_conflict_version_t *src_right_version,
-  apr_pool_t *result_pool)
-{
-  svn_wc_conflict_description2_t *conflict;
-
-  SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
-
-  conflict = apr_pcalloc(result_pool, sizeof(*conflict));
-  conflict->local_abspath = apr_pstrdup(result_pool, local_abspath);
-  conflict->node_kind = node_kind;
-  conflict->kind = svn_wc_conflict_kind_tree;
-  conflict->operation = operation;
-  conflict->src_left_version = svn_wc_conflict_version_dup(src_left_version,
-                                                           result_pool);
-  conflict->src_right_version = svn_wc_conflict_version_dup(src_right_version,
-                                                            result_pool);
-  return conflict;
-}
-
-svn_wc_conflict_description2_t *
 svn_wc__conflict_description2_dup(const svn_wc_conflict_description2_t *conflict,
                                   apr_pool_t *pool)
 {
-  svn_wc_conflict_description2_t *new_conflict;
-
-  new_conflict = apr_pcalloc(pool, sizeof(*new_conflict));
-
-  /* Shallow copy all members. */
-  *new_conflict = *conflict;
-
-  if (conflict->local_abspath)
-    new_conflict->local_abspath = apr_pstrdup(pool, conflict->local_abspath);
-  if (conflict->property_name)
-    new_conflict->property_name = apr_pstrdup(pool, conflict->property_name);
-  if (conflict->mime_type)
-    new_conflict->mime_type = apr_pstrdup(pool, conflict->mime_type);
-  if (conflict->base_abspath)
-    new_conflict->base_abspath = apr_pstrdup(pool, conflict->base_abspath);
-  if (conflict->their_abspath)
-    new_conflict->their_abspath = apr_pstrdup(pool, conflict->their_abspath);
-  if (conflict->my_abspath)
-    new_conflict->my_abspath = apr_pstrdup(pool, conflict->my_abspath);
-  if (conflict->merged_file)
-    new_conflict->merged_file = apr_pstrdup(pool, conflict->merged_file);
-  if (conflict->src_left_version)
-    new_conflict->src_left_version =
-      svn_wc_conflict_version_dup(conflict->src_left_version, pool);
-  if (conflict->src_right_version)
-    new_conflict->src_right_version =
-      svn_wc_conflict_version_dup(conflict->src_right_version, pool);
-
-  return new_conflict;
+  return svn_wc_conflict_description2_dup(conflict, pool);
 }

Modified: subversion/branches/authzperf/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_wc/diff_editor.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_wc/diff_editor.c Fri Aug 29 19:58:40 2014
@@ -1059,6 +1059,14 @@ svn_wc__diff_local_only_dir(svn_wc__db_t
                             void *cancel_baton,
                             apr_pool_t *scratch_pool)
 {
+  svn_wc__db_status_t status;
+  svn_node_kind_t kind;
+  svn_boolean_t had_props;
+  svn_boolean_t props_mod;
+  const char *original_repos_relpath;
+  svn_revnum_t original_revision;
+  svn_diff_source_t *copyfrom_src = NULL;
+  apr_hash_t *pristine_props;
   const apr_array_header_t *children;
   int i;
   apr_pool_t *iterpool;
@@ -1071,6 +1079,43 @@ svn_wc__diff_local_only_dir(svn_wc__db_t
   apr_hash_t *nodes;
   apr_hash_t *conflicts;
 
+  SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL,
+                               &original_repos_relpath, NULL, NULL,
+                               &original_revision, NULL, NULL, NULL,
+                               NULL, NULL, NULL, &had_props,
+                               &props_mod, NULL, NULL, NULL,
+                               db, local_abspath,
+                               scratch_pool, scratch_pool));
+  if (original_repos_relpath)
+    {
+      copyfrom_src = svn_diff__source_create(original_revision, scratch_pool);
+      copyfrom_src->repos_relpath = original_repos_relpath;
+    }
+
+  assert(kind == svn_node_dir
+         && (status == svn_wc__db_status_normal
+             || status == svn_wc__db_status_added
+             || (status == svn_wc__db_status_deleted && diff_pristine)));
+
+  if (status == svn_wc__db_status_deleted)
+    {
+      assert(diff_pristine);
+
+      SVN_ERR(svn_wc__db_read_pristine_info(NULL, NULL, NULL, NULL, NULL,
+                                            NULL, NULL, NULL, &had_props,
+                                            &pristine_props,
+                                            db, local_abspath,
+                                            scratch_pool, scratch_pool));
+      props_mod = FALSE;
+    }
+  else if (!had_props)
+    pristine_props = apr_hash_make(scratch_pool);
+  else
+    SVN_ERR(svn_wc__db_read_pristine_props(&pristine_props,
+                                           db, local_abspath,
+                                           scratch_pool, scratch_pool));
+
   /* Report the addition of the directory's contents. */
   iterpool = svn_pool_create(scratch_pool);
 
@@ -1078,7 +1123,7 @@ svn_wc__diff_local_only_dir(svn_wc__db_t
                                 relpath,
                                 NULL,
                                 right_src,
-                                NULL /* copyfrom_src */,
+                                copyfrom_src,
                                 processor_parent_baton,
                                 processor,
                                 scratch_pool, iterpool));
@@ -1162,9 +1207,11 @@ svn_wc__diff_local_only_dir(svn_wc__db_t
                                          scratch_pool, scratch_pool));
 
       SVN_ERR(processor->dir_added(relpath,
-                                   NULL /* copyfrom_src */,
+                                   copyfrom_src,
                                    right_src,
-                                   NULL,
+                                   copyfrom_src
+                                     ? pristine_props
+                                     : NULL,
                                    right_props,
                                    pdb,
                                    processor,

Modified: subversion/branches/authzperf/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_wc/diff_local.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_wc/diff_local.c Fri Aug 29 19:58:40 2014
@@ -1,6 +1,6 @@
 /*
- * diff_pristine.c -- A simple diff walker which compares local files against
- *                    their pristine versions.
+ * diff_local.c -- A simple diff walker which compares local files against
+ *                 their pristine versions.
  *
  * ====================================================================
  *    Licensed to the Apache Software Foundation (ASF) under one

Modified: subversion/branches/authzperf/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_wc/entries.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_wc/entries.c Fri Aug 29 19:58:40 2014
@@ -464,9 +464,9 @@ read_one_entry(const svn_wc_entry_t **ne
 
           for (j = 0; j < child_conflicts->nelts; j++)
             {
-              const svn_wc_conflict_description3_t *conflict =
+              const svn_wc_conflict_description2_t *conflict =
                 APR_ARRAY_IDX(child_conflicts, j,
-                              svn_wc_conflict_description3_t *);
+                              svn_wc_conflict_description2_t *);
 
               if (conflict->kind == svn_wc_conflict_kind_tree)
                 {
@@ -1894,13 +1894,13 @@ write_entry(struct write_baton **entry_n
       skel = skel->children;
       while (skel)
         {
-          svn_wc_conflict_description3_t *conflict;
+          svn_wc_conflict_description2_t *conflict;
           svn_skel_t *new_skel;
           const char *key;
 
           /* *CONFLICT is allocated so it is safe to use a non-const pointer */
           SVN_ERR(svn_wc__deserialize_conflict(
-                             (const svn_wc_conflict_description3_t**)&conflict,
+                             (const svn_wc_conflict_description2_t**)&conflict,
                                                skel,
                                                svn_dirent_join(root_abspath,
                                                                local_relpath,
@@ -1911,7 +1911,7 @@ write_entry(struct write_baton **entry_n
 
           /* Fix dubious data stored by old clients, local adds don't have
              a repository URL. */
-          if (conflict->local_change == svn_wc_conflict_reason_added)
+          if (conflict->reason == svn_wc_conflict_reason_added)
             conflict->src_left_version = NULL;
 
           SVN_ERR(svn_wc__serialize_conflict(&new_skel, conflict,

Modified: subversion/branches/authzperf/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_wc/info.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_wc/info.c Fri Aug 29 19:58:40 2014
@@ -52,7 +52,7 @@ svn_wc_info_dup(const svn_wc_info_t *inf
       for (i = 0; i < info->conflicts->nelts; i++)
         {
           APR_ARRAY_PUSH(new_conflicts, svn_wc_conflict_description2_t *)
-            = svn_wc__conflict_description2_dup(
+            = svn_wc_conflict_description2_dup(
                 APR_ARRAY_IDX(info->conflicts, i,
                               const svn_wc_conflict_description2_t *),
                 pool);
@@ -67,22 +67,6 @@ svn_wc_info_dup(const svn_wc_info_t *inf
     new_info->moved_from_abspath = apr_pstrdup(pool, info->moved_from_abspath);
   if (info->moved_to_abspath)
     new_info->moved_to_abspath = apr_pstrdup(pool, info->moved_to_abspath);
-  if (info->conflicts2)
-    {
-      int i;
-
-      apr_array_header_t *new_conflicts
-        = apr_array_make(pool, info->conflicts2->nelts, info->conflicts2->elt_size);
-      for (i = 0; i < info->conflicts2->nelts; i++)
-        {
-          APR_ARRAY_PUSH(new_conflicts, svn_wc_conflict_description3_t *)
-            = svn_wc__conflict_description3_dup(
-                APR_ARRAY_IDX(info->conflicts2, i,
-                              const svn_wc_conflict_description3_t *),
-                pool);
-        }
-      new_info->conflicts2 = new_conflicts;
-    }
 
   return new_info;
 }
@@ -326,22 +310,12 @@ build_info_for_node(svn_wc__info2_t **in
                                 local_abspath, result_pool, scratch_pool));
 
   if (conflicted)
-    {
-      const apr_array_header_t *conflicts;
-
-      SVN_ERR(svn_wc__read_conflicts(&conflicts, db,
-                                     local_abspath,
-                                     TRUE /* ### create tempfiles */,
-                                     result_pool, scratch_pool));
-      wc_info->conflicts = svn_wc__cd3_array_to_cd2_array(conflicts,
-                                                          result_pool);
-      wc_info->conflicts2 = conflicts;
-    }
+    SVN_ERR(svn_wc__read_conflicts(&wc_info->conflicts, db,
+                                   local_abspath,
+                                   TRUE /* ### create tempfiles */,
+                                   result_pool, scratch_pool));
   else
-    {
-      wc_info->conflicts = NULL;
-      wc_info->conflicts2 = NULL;
-    }
+    wc_info->conflicts = NULL;
 
   /* lock stuff */
   if (lock != NULL)
@@ -560,7 +534,7 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
        hi = apr_hash_next(hi))
     {
       const char *this_abspath = apr_hash_this_key(hi);
-      const svn_wc_conflict_description3_t *tree_conflict;
+      const svn_wc_conflict_description2_t *tree_conflict;
       svn_wc__info2_t *info;
       const apr_array_header_t *conflicts;
 
@@ -592,15 +566,13 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
         continue;
 
       tree_conflict = APR_ARRAY_IDX(conflicts, 0,
-                                    const svn_wc_conflict_description3_t *);
+                                    const svn_wc_conflict_description2_t *);
 
       if (!depth_includes(local_abspath, depth, tree_conflict->local_abspath,
-                          tree_conflict->local_node_kind, iterpool))
+                          tree_conflict->node_kind, iterpool))
         continue;
 
-      info->wc_info->conflicts = svn_wc__cd3_array_to_cd2_array(conflicts,
-                                                                iterpool);
-      info->wc_info->conflicts2 = conflicts;
+      info->wc_info->conflicts = conflicts;
       SVN_ERR(receiver(receiver_baton, this_abspath, info, iterpool));
     }
   svn_pool_destroy(iterpool);

Modified: subversion/branches/authzperf/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_wc/props.c?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_wc/props.c Fri Aug 29 19:58:40 2014
@@ -62,36 +62,6 @@
 
 #include "svn_private_config.h"
 
-/* Forward declaration.  */
-static svn_error_t *
-prop_conflict_from_skel(const svn_string_t **conflict_desc,
-                        const svn_skel_t *skel,
-                        svn_cancel_func_t cancel_func,
-                        void *cancel_baton,
-                        apr_pool_t *result_pool,
-                        apr_pool_t *scratch_pool);
-
-/* Given a *SINGLE* property conflict in PROP_SKEL, generate a description
-   for it, and write it to STREAM, along with a trailing EOL sequence.
-
-   See prop_conflict_from_skel() for details on PROP_SKEL.  */
-static svn_error_t *
-append_prop_conflict(svn_stream_t *stream,
-                     const svn_skel_t *prop_skel,
-                     svn_cancel_func_t cancel_func,
-                     void *cancel_baton,
-                     apr_pool_t *pool)
-{
-  /* TODO:  someday, perhaps prefix each conflict_description with a
-     timestamp or something? */
-  const svn_string_t *conflict_desc;
-
-  SVN_ERR(prop_conflict_from_skel(&conflict_desc, prop_skel,
-                                  cancel_func, cancel_baton, pool, pool));
-
-  return svn_stream_puts(stream, conflict_desc->data);
-}
-
 /*---------------------------------------------------------------------*/
 
 /*** Merging propchanges into the working copy ***/
@@ -536,29 +506,20 @@ maybe_prop_value(const svn_skel_t *skel,
 }
 
 
-/* Parse a property conflict description from the provided SKEL.
-   The result includes a descriptive message (see generate_conflict_message)
-   and maybe a diff of property values containing conflict markers.
-   The result will be allocated in RESULT_POOL.
-
-   Note: SKEL is a single property conflict of the form:
-
-   ("prop" ([ORIGINAL]) ([MINE]) ([INCOMING]) ([INCOMING_BASE]))
-
-   See notes/wc-ng/conflict-storage for more information.  */
+/* Create a property rejection description for the specified property.
+   The result will be allocated in RESULT_POOL. */
 static svn_error_t *
-prop_conflict_from_skel(const svn_string_t **conflict_desc,
-                        const svn_skel_t *skel,
-                        svn_cancel_func_t cancel_func,
-                        void *cancel_baton,
-                        apr_pool_t *result_pool,
-                        apr_pool_t *scratch_pool)
+prop_conflict_new(const svn_string_t **conflict_desc,
+                  const char *propname,
+                  const svn_string_t *original,
+                  const svn_string_t *mine,
+                  const svn_string_t *incoming,
+                  const svn_string_t *incoming_base,
+                  svn_cancel_func_t cancel_func,
+                  void *cancel_baton,
+                  apr_pool_t *result_pool,
+                  apr_pool_t *scratch_pool)
 {
-  const svn_string_t *original;
-  const svn_string_t *mine;
-  const svn_string_t *incoming;
-  const svn_string_t *incoming_base;
-  const char *propname;
   svn_diff_t *diff;
   svn_diff_file_options_t *diff_opts;
   svn_stringbuf_t *buf;
@@ -566,17 +527,6 @@ prop_conflict_from_skel(const svn_string
   svn_boolean_t mine_is_binary;
   svn_boolean_t incoming_is_binary;
 
-  /* Navigate to the property name.  */
-  skel = skel->children->next;
-
-  /* We need to copy these into SCRATCH_POOL in order to nul-terminate
-     the values.  */
-  propname = apr_pstrmemdup(scratch_pool, skel->data, skel->len);
-  original = maybe_prop_value(skel->next, scratch_pool);
-  mine = maybe_prop_value(skel->next->next, scratch_pool);
-  incoming = maybe_prop_value(skel->next->next->next, scratch_pool);
-  incoming_base = maybe_prop_value(skel->next->next->next->next, scratch_pool);
-
   buf = generate_conflict_message(propname, original, mine, incoming,
                                   incoming_base, scratch_pool);
 
@@ -703,6 +653,49 @@ prop_conflict_from_skel(const svn_string
   return SVN_NO_ERROR;
 }
 
+/* Parse a property conflict description from the provided SKEL.
+   The result includes a descriptive message (see generate_conflict_message)
+   and maybe a diff of property values containing conflict markers.
+   The result will be allocated in RESULT_POOL.
+
+   Note: SKEL is a single property conflict of the form:
+
+   ("prop" ([ORIGINAL]) ([MINE]) ([INCOMING]) ([INCOMING_BASE]))
+
+   Note: This is not the same format as the property conflicts we store in
+   wc.db since 1.8. This is the legacy format used in the Workqueue in 1.7-1.8 */
+static svn_error_t *
+prop_conflict_from_skel(const svn_string_t **conflict_desc,
+                        const svn_skel_t *skel,
+                        svn_cancel_func_t cancel_func,
+                        void *cancel_baton,
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool)
+{
+  const svn_string_t *original;
+  const svn_string_t *mine;
+  const svn_string_t *incoming;
+  const svn_string_t *incoming_base;
+  const char *propname;
+
+  /* Navigate to the property name.  */
+  skel = skel->children->next;
+
+  /* We need to copy these into SCRATCH_POOL in order to nul-terminate
+     the values.  */
+  propname = apr_pstrmemdup(scratch_pool, skel->data, skel->len);
+  original = maybe_prop_value(skel->next, scratch_pool);
+  mine = maybe_prop_value(skel->next->next, scratch_pool);
+  incoming = maybe_prop_value(skel->next->next->next, scratch_pool);
+  incoming_base = maybe_prop_value(skel->next->next->next->next, scratch_pool);
+
+  return svn_error_trace(prop_conflict_new(conflict_desc,
+                                           propname,
+                                           original, mine,
+                                           incoming, incoming_base,
+                                           cancel_func, cancel_baton,
+                                           result_pool, scratch_pool));
+}
 
 /* Create a property conflict file at PREJFILE based on the property
    conflicts in CONFLICT_SKEL.  */
@@ -710,7 +703,7 @@ svn_error_t *
 svn_wc__create_prejfile(const char **tmp_prejfile_abspath,
                         svn_wc__db_t *db,
                         const char *local_abspath,
-                        const svn_skel_t *conflict_skel,
+                        const svn_skel_t *prop_conflict_data,
                         svn_cancel_func_t cancel_func,
                         void *cancel_baton,
                         apr_pool_t *result_pool,
@@ -730,12 +723,87 @@ svn_wc__create_prejfile(const char **tmp
                                  tempdir_abspath, svn_io_file_del_none,
                                  scratch_pool, iterpool));
 
-  for (scan = conflict_skel->children->next; scan != NULL; scan = scan->next)
+  if (prop_conflict_data)
     {
-      svn_pool_clear(iterpool);
+      for (scan = prop_conflict_data->children->next;
+            scan != NULL; scan = scan->next)
+        {
+          const svn_string_t *conflict_desc;
+
+          svn_pool_clear(iterpool);
+
+          SVN_ERR(prop_conflict_from_skel(&conflict_desc, scan,
+                                          cancel_func, cancel_baton,
+                                          iterpool, iterpool));
 
-      SVN_ERR(append_prop_conflict(stream, scan, cancel_func, cancel_baton,
-                                   iterpool));
+          SVN_ERR(svn_stream_puts(stream, conflict_desc->data));
+        }
+    }
+  else
+    {
+      svn_wc_operation_t operation;
+      apr_hash_index_t *hi;
+      apr_hash_t *old_props;
+      apr_hash_t *mine_props;
+      apr_hash_t *their_original_props;
+      apr_hash_t *their_props;
+      apr_hash_t *conflicted_props;
+      svn_skel_t *conflicts;
+
+      SVN_ERR(svn_wc__db_read_conflict(&conflicts, db, local_abspath,
+                                      scratch_pool, scratch_pool));
+
+      SVN_ERR(svn_wc__conflict_read_info(&operation, NULL, NULL, NULL, NULL,
+                                         db, local_abspath,
+                                         conflicts,
+                                         scratch_pool, scratch_pool));
+
+      SVN_ERR(svn_wc__conflict_read_prop_conflict(NULL,
+                                                  &mine_props,
+                                                  &their_original_props,
+                                                  &their_props,
+                                                  &conflicted_props,
+                                                  db, local_abspath,
+                                                  conflicts,
+                                                  scratch_pool,
+                                                  scratch_pool));
+
+      if (operation == svn_wc_operation_merge)
+        SVN_ERR(svn_wc__db_read_pristine_props(&old_props, db, local_abspath,
+                                                scratch_pool, scratch_pool));
+      else
+        old_props = their_original_props;
+
+      /* ### TODO: Sort conflicts? */
+      for (hi = apr_hash_first(scratch_pool, conflicted_props);
+           hi;
+           hi = apr_hash_next(hi))
+        {
+          const svn_string_t *conflict_desc;
+          const char *propname = apr_hash_this_key(hi);
+          const svn_string_t *old_value;
+          const svn_string_t *mine_value;
+          const svn_string_t *their_value;
+          const svn_string_t *their_original_value;
+
+          svn_pool_clear(iterpool);
+
+          old_value = old_props ? svn_hash_gets(old_props, propname) : NULL;
+          mine_value = mine_props ? svn_hash_gets(mine_props, propname) : NULL;
+          their_value = their_props ? svn_hash_gets(their_props, propname)
+                                    : NULL;
+          their_original_value = their_original_props
+                                    ? svn_hash_gets(their_original_props, propname)
+                                    : NULL;
+
+          SVN_ERR(prop_conflict_new(&conflict_desc,
+                                    propname, old_value, mine_value,
+                                    their_value, their_original_value,
+                                    cancel_func, cancel_baton,
+                                    iterpool, iterpool));
+
+          SVN_ERR(svn_stream_puts(stream, conflict_desc->data));
+        }
     }
 
   SVN_ERR(svn_stream_close(stream));

Modified: subversion/branches/authzperf/subversion/libsvn_wc/props.h
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_wc/props.h?rev=1621377&r1=1621376&r2=1621377&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_wc/props.h (original)
+++ subversion/branches/authzperf/subversion/libsvn_wc/props.h Fri Aug 29 19:58:40 2014
@@ -139,11 +139,15 @@ svn_wc__get_actual_props(apr_hash_t **pr
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool);
 
+/* Creates a property reject file at *TMP_PREJFILE_ABSPATH, with
+   either the property conflict data from DB (when PROP_CONFLICT_DATA
+   is NULL) or the information in PROP_CONFLICT_DATA if it isn't.
+ */
 svn_error_t *
 svn_wc__create_prejfile(const char **tmp_prejfile_abspath,
                         svn_wc__db_t *db,
                         const char *local_abspath,
-                        const svn_skel_t *conflict_skel,
+                        const svn_skel_t *prop_conflict_data,
                         svn_cancel_func_t cancel_func,
                         void *cancel_baton,
                         apr_pool_t *result_pool,



Mime
View raw message