Modified: subversion/branches/remove-log-addressing/subversion/libsvn_subr/cache-membuffer.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/cache-membuffer.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/cache-membuffer.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/cache-membuffer.c Tue Aug 26 13:00:03 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/remove-log-addressing/subversion/libsvn_subr/config_file.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/config_file.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/config_file.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/config_file.c Tue Aug 26 13:00:03 2014 @@ -940,6 +940,15 @@ svn_config_ensure(const char *config_dir "### HTTP operation." NL "### http-chunked-requests Whether to use chunked transfer" NL "### encoding for HTTP requests body." NL + "### http-pipelining Whether to use HTTP pipelining " NL + "### or send requests one by one." NL + "### Pipelining is enabled by default." NL + "### The only known case where it should" + NL + "### be disabled is when the server" NL + "### triggers SSL renegotiations in the"NL + "### middle of HTTP traffic, resulting" NL + "### in SSL communication errors." NL "### neon-debug-mask Debug mask for Neon HTTP library" NL "### ssl-authority-files List of files, each of a trusted CA" NL Modified: subversion/branches/remove-log-addressing/subversion/libsvn_subr/debug.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/debug.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/debug.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/debug.c Tue Aug 26 13:00:03 2014 @@ -80,7 +80,7 @@ static void debug_vprintf(const char *fmt, va_list ap) { FILE *output = debug_output; - char prefix[80], buffer[1000]; + char prefix[80], buffer[4096]; char *s = buffer; int n; Modified: subversion/branches/remove-log-addressing/subversion/libsvn_subr/deprecated.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/deprecated.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/deprecated.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/deprecated.c Tue Aug 26 13:00:03 2014 @@ -1387,6 +1387,19 @@ svn_utf_cstring_from_utf8_ex(const char return svn_utf_cstring_from_utf8_ex2(dest, src, topage, pool); } +/*** From error.c ***/ +void +svn_handle_error(svn_error_t *err, FILE *stream, svn_boolean_t fatal) +{ + svn_handle_error2(err, stream, fatal, "svn: "); +} + +void +svn_handle_warning(FILE *stream, svn_error_t *err) +{ + svn_handle_warning2(stream, err, "svn: "); +} + /*** From subst.c ***/ svn_error_t * Modified: subversion/branches/remove-log-addressing/subversion/libsvn_subr/dso.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/dso.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/dso.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/dso.c Tue Aug 26 13:00:03 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/remove-log-addressing/subversion/libsvn_subr/error.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/error.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/error.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/error.c Tue Aug 26 13:00:03 2014 @@ -537,12 +537,6 @@ print_error(svn_error_t *err, FILE *stre } void -svn_handle_error(svn_error_t *err, FILE *stream, svn_boolean_t fatal) -{ - svn_handle_error2(err, stream, fatal, "svn: "); -} - -void svn_handle_error2(svn_error_t *err, FILE *stream, svn_boolean_t fatal, @@ -613,13 +607,6 @@ svn_handle_error2(svn_error_t *err, } } - -void -svn_handle_warning(FILE *stream, svn_error_t *err) -{ - svn_handle_warning2(stream, err, "svn: "); -} - void svn_handle_warning2(FILE *stream, const svn_error_t *err, const char *prefix) { Modified: subversion/branches/remove-log-addressing/subversion/libsvn_subr/io.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/io.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/io.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/io.c Tue Aug 26 13:00:03 2014 @@ -1154,8 +1154,13 @@ svn_io_make_dir_recursively(const char * SVN_ERR(cstring_from_utf8(&path_apr, path, pool)); apr_err = apr_dir_make_recursive(path_apr, APR_OS_DEFAULT, pool); - WIN32_RETRY_LOOP(apr_err, apr_dir_make_recursive(path_apr, - APR_OS_DEFAULT, pool)); +#ifdef WIN32 + /* Don't retry on ERROR_ACCESS_DENIED, as that typically signals a + permanent error */ + if (apr_err == APR_FROM_OS_ERROR(ERROR_SHARING_VIOLATION)) + WIN32_RETRY_LOOP(apr_err, apr_dir_make_recursive(path_apr, + APR_OS_DEFAULT, pool)); +#endif if (apr_err) return svn_error_wrap_apr(apr_err, _("Can't make directory '%s'"), @@ -4083,7 +4088,13 @@ dir_make(const char *path, apr_fileperms #endif status = apr_dir_make(path_apr, perm, pool); - WIN32_RETRY_LOOP(status, apr_dir_make(path_apr, perm, pool)); + +#ifdef WIN32 + /* Don't retry on ERROR_ACCESS_DENIED, as that typically signals a + permanent error */ + if (status == APR_FROM_OS_ERROR(ERROR_SHARING_VIOLATION)) + WIN32_RETRY_LOOP(status, apr_dir_make(path_apr, perm, pool)); +#endif if (status) return svn_error_wrap_apr(status, _("Can't create directory '%s'"), Modified: subversion/branches/remove-log-addressing/subversion/libsvn_subr/mutex.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/mutex.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/mutex.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/mutex.c Tue Aug 26 13:00:03 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,50 +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())) - return svn_error_create(SVN_ERR_INVALID_UNLOCK, NULL, - _("Tried to release a non-locked mutex")); - } - - /* 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) - { - if (mutex->count <= 0) - return svn_error_create(SVN_ERR_INVALID_UNLOCK, NULL, - _("Tried to release a non-locked mutex")); - - --mutex->count; - } #endif } Modified: subversion/branches/remove-log-addressing/subversion/libsvn_subr/named_atomic.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/named_atomic.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/named_atomic.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/named_atomic.c Tue Aug 26 13:00:03 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 */ @@ -444,17 +444,21 @@ svn_atomic_namespace__create(svn_atomic_ * with our data file) */ if (new_ns->data->count > MAX_ATOMIC_COUNT) - return svn_error_create(SVN_ERR_CORRUPTED_ATOMIC_STORAGE, 0, - _("Number of atomics in namespace is too large.")); - - /* Cache the number of existing, complete entries. There can't be - * incomplete ones from other processes because we hold the mutex. - * Our process will also not access this information since we are - * either being called from within svn_atomic__init_once or by - * svn_atomic_namespace__create for a new object. - */ - new_ns->min_used = new_ns->data->count; - *ns = new_ns; + { + err = svn_error_create(SVN_ERR_CORRUPTED_ATOMIC_STORAGE, 0, + _("Number of atomics in namespace is too large.")); + } + else + { + /* Cache the number of existing, complete entries. There can't be + * incomplete ones from other processes because we hold the mutex. + * Our process will also not access this information since we are + * either being called from within svn_atomic__init_once or by + * svn_atomic_namespace__create for a new object. + */ + new_ns->min_used = new_ns->data->count; + *ns = new_ns; + } } /* Unlock to allow other processes may access the shared memory as well. Modified: subversion/branches/remove-log-addressing/subversion/libsvn_subr/object_pool.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/object_pool.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/object_pool.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/object_pool.c Tue Aug 26 13:00:03 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/remove-log-addressing/subversion/libsvn_subr/root_pools.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/root_pools.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/root_pools.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/root_pools.c Tue Aug 26 13:00:03 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/remove-log-addressing/subversion/libsvn_subr/string.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/string.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/string.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/string.c Tue Aug 26 13:00:03 2014 @@ -1068,16 +1068,6 @@ svn__strtoul(const char* buffer, const c return result; } -long -svn__strtol(const char* buffer, const char** end) -{ - if (*buffer == '-') - return -(long)svn__strtoul(buffer+1, end); - else - return (long)svn__strtoul(buffer, end); -} - - /* "Precalculated" itoa values for 2 places (including leading zeros). * For maximum performance, make sure all table entries are word-aligned. */ Modified: subversion/branches/remove-log-addressing/subversion/libsvn_subr/utf.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/utf.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/utf.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/utf.c Tue Aug 26 13:00:03 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/remove-log-addressing/subversion/libsvn_wc/adm_crawler.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_wc/adm_crawler.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_wc/adm_crawler.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_wc/adm_crawler.c Tue Aug 26 13:00:03 2014 @@ -69,6 +69,8 @@ restore_file(svn_wc__db_t *db, const char *local_abspath, svn_boolean_t use_commit_times, svn_boolean_t mark_resolved_text_conflict, + svn_cancel_func_t cancel_func, + void *cancel_baton, apr_pool_t *scratch_pool) { svn_skel_t *work_item; @@ -86,12 +88,14 @@ restore_file(svn_wc__db_t *db, /* Run the work item immediately. */ SVN_ERR(svn_wc__wq_run(db, local_abspath, - NULL, NULL, /* ### nice to have cancel_func/baton */ + cancel_func, cancel_baton, scratch_pool)); /* Remove any text conflict */ if (mark_resolved_text_conflict) - SVN_ERR(svn_wc__mark_resolved_text_conflict(db, local_abspath, scratch_pool)); + SVN_ERR(svn_wc__mark_resolved_text_conflict(db, local_abspath, + cancel_func, cancel_baton, + scratch_pool)); return SVN_NO_ERROR; } @@ -102,6 +106,7 @@ svn_wc_restore(svn_wc_context_t *wc_ctx, svn_boolean_t use_commit_times, apr_pool_t *scratch_pool) { + /* ### If ever revved: Add cancel func. */ svn_wc__db_status_t status; svn_node_kind_t kind; svn_node_kind_t disk_kind; @@ -138,6 +143,7 @@ svn_wc_restore(svn_wc_context_t *wc_ctx, if (kind == svn_node_file || kind == svn_node_symlink) SVN_ERR(restore_file(wc_ctx->db, local_abspath, use_commit_times, FALSE /*mark_resolved_text_conflict*/, + NULL, NULL /* cancel func, baton */, scratch_pool)); else SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, scratch_pool)); @@ -157,6 +163,8 @@ restore_node(svn_wc__db_t *db, const char *local_abspath, svn_node_kind_t kind, svn_boolean_t use_commit_times, + svn_cancel_func_t cancel_func, + void *cancel_baton, svn_wc_notify_func2_t notify_func, void *notify_baton, apr_pool_t *scratch_pool) @@ -166,6 +174,7 @@ restore_node(svn_wc__db_t *db, /* Recreate file from text-base; mark any text conflict as resolved */ SVN_ERR(restore_file(db, local_abspath, use_commit_times, TRUE /*mark_resolved_text_conflict*/, + cancel_func, cancel_baton, scratch_pool)); } else if (kind == svn_node_dir) @@ -399,8 +408,9 @@ report_revisions_and_depths(svn_wc__db_t if (dirent_kind == svn_node_none) { SVN_ERR(restore_node(db, this_abspath, wrk_kind, - use_commit_times, notify_func, - notify_baton, iterpool)); + use_commit_times, + cancel_func, cancel_baton, + notify_func, notify_baton, iterpool)); } } } @@ -734,6 +744,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t { SVN_ERR(restore_node(wc_ctx->db, local_abspath, wrk_kind, use_commit_times, + cancel_func, cancel_baton, notify_func, notify_baton, scratch_pool)); } Modified: subversion/branches/remove-log-addressing/subversion/libsvn_wc/conflicts.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_wc/conflicts.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_wc/conflicts.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_wc/conflicts.c Tue Aug 26 13:00:03 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,68 +1047,7 @@ 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, @@ -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; @@ -1273,10 +1152,12 @@ generate_propconflict(svn_boolean_t *con const svn_string_t *incoming_new_val, svn_wc_conflict_resolver_func2_t conflict_func, void *conflict_baton, + svn_cancel_func_t cancel_func, + void *cancel_baton, 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; @@ -1293,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); @@ -1312,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) @@ -1322,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) @@ -1388,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; @@ -1395,18 +1284,22 @@ 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, working_val, incoming_new_val, options, scratch_pool)); - SVN_ERR(svn_diff_mem_string_output_merge2(mergestream, diff, + SVN_ERR(svn_diff_mem_string_output_merge3(mergestream, diff, conflict_base_val, working_val, incoming_new_val, NULL, NULL, NULL, NULL, - svn_diff_conflict_display_modified_latest, scratch_pool)); + 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; } } @@ -1425,8 +1318,8 @@ generate_propconflict(svn_boolean_t *con 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; @@ -1472,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:" @@ -1481,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; @@ -1534,6 +1427,8 @@ merge_showing_conflicts(const char **cho const char *detranslated_target, const char *right_abspath, svn_io_file_del_t delete_when, + svn_cancel_func_t cancel_func, + void *cancel_baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool) { @@ -1562,12 +1457,12 @@ merge_showing_conflicts(const char **cho left_abspath, detranslated_target, right_abspath, diff3_options, scratch_pool)); - SVN_ERR(svn_diff_file_output_merge2(chosen_stream, diff, + SVN_ERR(svn_diff_file_output_merge3(chosen_stream, diff, left_abspath, detranslated_target, right_abspath, NULL, NULL, NULL, NULL, /* markers */ - style, + style, cancel_func, cancel_baton, scratch_pool)); SVN_ERR(svn_stream_close(chosen_stream)); @@ -1603,8 +1498,10 @@ 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, apr_pool_t *result_pool, apr_pool_t *scratch_pool) { @@ -1651,6 +1548,7 @@ eval_text_conflict_func_result(svn_skel_ right_abspath, /* ### why not same as other caller? */ svn_io_file_del_none, + cancel_func, cancel_baton, scratch_pool, scratch_pool)); remove_source = TRUE; *is_resolved = TRUE; @@ -1665,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; } @@ -1777,10 +1675,12 @@ 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, + svn_cancel_func_t cancel_func, + void *cancel_baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool) { @@ -1793,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:" @@ -1808,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)); } @@ -1824,8 +1724,9 @@ 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)); *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool); } @@ -1847,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, @@ -1859,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; @@ -1872,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; } @@ -1887,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, @@ -1897,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)->reason = local_change; - (*desc)->action = incoming_change; + (*desc)->reason = reason; + (*desc)->action = action; return SVN_NO_ERROR; } @@ -2020,6 +1963,7 @@ svn_wc__conflict_invoke_resolver(svn_wc_ ? svn_hash_gets(their_props, propname) : NULL, resolver_func, resolver_baton, + cancel_func, cancel_baton, iterpool)); if (conflict_remains) @@ -2038,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, @@ -2055,6 +1999,7 @@ svn_wc__conflict_invoke_resolver(svn_wc_ db, local_abspath, desc, merge_options, resolver_func, resolver_baton, + cancel_func, cancel_baton, scratch_pool, scratch_pool)); if (was_resolved) @@ -2068,6 +2013,8 @@ svn_wc__conflict_invoke_resolver(svn_wc_ scratch_pool)); } SVN_ERR(svn_wc__mark_resolved_text_conflict(db, local_abspath, + cancel_func, + cancel_baton, scratch_pool)); } } @@ -2075,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, @@ -2083,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 @@ -2121,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; @@ -2140,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; @@ -2166,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); @@ -2201,12 +2154,13 @@ read_prop_conflict_descs(apr_array_heade else 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; @@ -2218,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) @@ -2225,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) @@ -2244,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); @@ -2278,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; } @@ -2288,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 *); @@ -2309,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; @@ -2467,6 +2429,7 @@ resolve_text_conflict_on_node(svn_boolea conflict_new, /* ### why not same as other caller? */ svn_io_file_del_on_pool_cleanup, + cancel_func, cancel_baton, scratch_pool, scratch_pool)); } else @@ -2891,6 +2854,8 @@ resolve_tree_conflict_on_node(svn_boolea svn_error_t * svn_wc__mark_resolved_text_conflict(svn_wc__db_t *db, const char *local_abspath, + svn_cancel_func_t cancel_func, + void *cancel_baton, apr_pool_t *scratch_pool) { svn_boolean_t ignored_result; @@ -2899,7 +2864,7 @@ svn_wc__mark_resolved_text_conflict(svn_ &ignored_result, db, local_abspath, svn_wc_conflict_choose_merged, NULL, - NULL, NULL, + cancel_func, cancel_baton, scratch_pool)); } @@ -2962,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); @@ -2980,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/remove-log-addressing/subversion/libsvn_wc/conflicts.h URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_wc/conflicts.h?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_wc/conflicts.h (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_wc/conflicts.h Tue Aug 26 13:00:03 2014 @@ -432,6 +432,8 @@ svn_wc__conflict_invoke_resolver(svn_wc_ svn_error_t * svn_wc__mark_resolved_text_conflict(svn_wc__db_t *db, const char *local_abspath, + svn_cancel_func_t cancel_func, + void *cancel_baton, apr_pool_t *scratch_pool); /* Mark as resolved any prop conflicts on the node at DB/LOCAL_ABSPATH. */ Modified: subversion/branches/remove-log-addressing/subversion/libsvn_wc/deprecated.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_wc/deprecated.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_wc/deprecated.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_wc/deprecated.c Tue Aug 26 13:00:03 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/remove-log-addressing/subversion/libsvn_wc/diff_editor.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_wc/diff_editor.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_wc/diff_editor.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_wc/diff_editor.c Tue Aug 26 13:00:03 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/remove-log-addressing/subversion/libsvn_wc/diff_local.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_wc/diff_local.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_wc/diff_local.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_wc/diff_local.c Tue Aug 26 13:00:03 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/remove-log-addressing/subversion/libsvn_wc/entries.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_wc/entries.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_wc/entries.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_wc/entries.c Tue Aug 26 13:00:03 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, Modified: subversion/branches/remove-log-addressing/subversion/libsvn_wc/externals.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_wc/externals.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_wc/externals.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_wc/externals.c Tue Aug 26 13:00:03 2014 @@ -417,8 +417,6 @@ struct edit_baton /* Introducing a new file external */ svn_boolean_t added; - svn_wc_conflict_resolver_func2_t conflict_func; - void *conflict_baton; svn_cancel_func_t cancel_func; void *cancel_baton; svn_wc_notify_func2_t notify_func; @@ -991,8 +989,6 @@ svn_wc__get_file_external_editor(const s const char *recorded_url, const svn_opt_revision_t *recorded_peg_rev, const svn_opt_revision_t *recorded_rev, - svn_wc_conflict_resolver_func2_t conflict_func, - void *conflict_baton, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, @@ -1041,8 +1037,6 @@ svn_wc__get_file_external_editor(const s else eb->recorded_revision = SVN_INVALID_REVNUM; /* Not fixed/HEAD */ - eb->conflict_func = conflict_func; - eb->conflict_baton = conflict_baton; eb->cancel_func = cancel_func; eb->cancel_baton = cancel_baton; eb->notify_func = notify_func; Modified: subversion/branches/remove-log-addressing/subversion/libsvn_wc/info.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_wc/info.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_wc/info.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_wc/info.c Tue Aug 26 13:00:03 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); @@ -310,16 +310,10 @@ 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); - } + SVN_ERR(svn_wc__read_conflicts(&wc_info->conflicts, db, + local_abspath, + TRUE /* ### create tempfiles */, + result_pool, scratch_pool)); else wc_info->conflicts = NULL; @@ -540,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; @@ -572,14 +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->node_kind, iterpool)) continue; - info->wc_info->conflicts = svn_wc__cd3_array_to_cd2_array(conflicts, - iterpool); + info->wc_info->conflicts = conflicts; SVN_ERR(receiver(receiver_baton, this_abspath, info, iterpool)); } svn_pool_destroy(iterpool); Modified: subversion/branches/remove-log-addressing/subversion/libsvn_wc/merge.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_wc/merge.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_wc/merge.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_wc/merge.c Tue Aug 26 13:00:03 2014 @@ -392,6 +392,8 @@ do_text_merge(svn_boolean_t *contains_co const char *target_label, const char *left_label, const char *right_label, + svn_cancel_func_t cancel_func, + void *cancel_baton, apr_pool_t *pool) { svn_diff_t *diff; @@ -416,13 +418,14 @@ do_text_merge(svn_boolean_t *contains_co ostream = svn_stream_from_aprfile2(result_f, TRUE, pool); - SVN_ERR(svn_diff_file_output_merge2(ostream, diff, + SVN_ERR(svn_diff_file_output_merge3(ostream, diff, left, detranslated_target, right, left_marker, target_marker, right_marker, "=======", /* separator */ svn_diff_conflict_display_modified_original_latest, + cancel_func, cancel_baton, pool)); SVN_ERR(svn_stream_close(ostream)); @@ -871,6 +874,7 @@ merge_text_file(svn_skel_t **work_items, target_label, left_label, right_label, + cancel_func, cancel_baton, pool)); SVN_ERR(svn_io_file_close(result_f, pool));
