You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by vm...@apache.org on 2012/12/24 23:47:16 UTC
svn commit: r1425690 [3/6] - in /subversion/branches/javahl-ra: ./
contrib/server-side/fsfsfixer/ notes/ subversion/include/
subversion/include/private/ subversion/libsvn_client/
subversion/libsvn_delta/ subversion/libsvn_fs_fs/ subversion/libsvn_ra/ s...
Modified: subversion/branches/javahl-ra/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_subr/cache-membuffer.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_subr/cache-membuffer.c Mon Dec 24 22:47:14 2012
@@ -108,7 +108,7 @@
*/
#define GROUP_SIZE 16
-/* For more efficient copy operations, let'a align all data items properly.
+/* For more efficient copy operations, let's align all data items properly.
* Must be a power of 2.
*/
#define ITEM_ALIGNMENT 16
@@ -281,7 +281,7 @@ static svn_error_t* assert_equal_tags(co
return SVN_NO_ERROR;
}
-/* Reoccuring code snippets.
+/* Reoccurring code snippets.
*/
#define DEBUG_CACHE_MEMBUFFER_TAG_ARG entry_tag_t *tag,
@@ -357,7 +357,7 @@ typedef struct entry_t
#endif
} entry_t;
-/* We group dictionary entries to make this GROUP-SIZE-way assicative.
+/* We group dictionary entries to make this GROUP-SIZE-way associative.
*/
typedef struct entry_group_t
{
@@ -483,7 +483,7 @@ struct svn_membuffer_t
*/
#define ALIGN_POINTER(pointer) ((void*)ALIGN_VALUE((apr_size_t)(char*)(pointer)))
-/* If locking is supported for CACHE, aquire a read lock for it.
+/* If locking is supported for CACHE, acquire a read lock for it.
*/
static svn_error_t *
read_lock_cache(svn_membuffer_t *cache)
@@ -794,7 +794,7 @@ get_group_index(svn_membuffer_t **cache,
return key[1] % segment0->group_count;
}
-/* Reduce the hit count of ENTRY and update the accumunated hit info
+/* Reduce the hit count of ENTRY and update the accumulated hit info
* in CACHE accordingly.
*/
static APR_INLINE void
@@ -806,8 +806,8 @@ let_entry_age(svn_membuffer_t *cache, en
entry->hit_count -= hits_removed;
}
-/* Returns 0 if the entry group idenified by GROUP_INDEX in CACHE has not
- * been intialized, yet. In that case, this group can not data. Otherwise,
+/* Returns 0 if the entry group identified by GROUP_INDEX in CACHE has not
+ * been initialized, yet. In that case, this group can not data. Otherwise,
* a non-zero value is returned.
*/
static APR_INLINE unsigned char
@@ -822,7 +822,7 @@ is_group_initialized(svn_membuffer_t *ca
}
/* Initializes the section of the directory in CACHE that contains
- * the entry group indentified by GROUP_INDEX. */
+ * the entry group identified by GROUP_INDEX. */
static void
initialize_group(svn_membuffer_t *cache, apr_uint32_t group_index)
{
@@ -923,7 +923,7 @@ find_entry(svn_membuffer_t *cache,
entry = &group->entries[i];
/* for the entries that don't have been removed,
- * reduce their hitcounts to put them at a relative
+ * reduce their hit counts to put them at a relative
* disadvantage the next time.
*/
for (i = 0; i < GROUP_SIZE; ++i)
@@ -959,7 +959,7 @@ move_entry(svn_membuffer_t *cache, entry
/* Move the entry to the start of the empty / insertion section
* (if it isn't there already). Size-aligned moves are legal
- * since all offsets and block sizes share this same aligment.
+ * since all offsets and block sizes share this same alignment.
* Size-aligned moves tend to be faster than non-aligned ones
* because no "odd" bytes at the end need to special treatment.
*/
@@ -1233,7 +1233,7 @@ svn_cache__membuffer_cache_create(svn_me
? MAX_ITEM_SIZE
: data_size / 4;
- /* to keep the entries small, we use 32 bit indices only
+ /* to keep the entries small, we use 32 bit indexes only
* -> we need to ensure that no more then 4G entries exist.
*
* Note, that this limit could only be exceeded in a very
@@ -1438,7 +1438,7 @@ membuffer_cache_set_internal(svn_membuff
return SVN_NO_ERROR;
}
-/* Try to insert the ITEM and use the KEY to unqiuely identify it.
+/* Try to insert the ITEM and use the KEY to uniquely identify it.
* However, there is no guarantee that it will actually be put into
* the cache. If there is already some data associated to the KEY,
* it will be removed from the cache even if the new data cannot
@@ -1753,12 +1753,13 @@ membuffer_cache_set_partial_internal(svn
{
/* Remove the old entry and try to make space for the new one.
*/
- entry = find_entry(cache, group_index, to_find, TRUE);
+ drop_entry(cache, entry);
if ( (cache->max_entry_size >= size)
&& ensure_data_insertable(cache, size))
{
/* Write the new entry.
*/
+ entry = find_entry(cache, group_index, to_find, TRUE);
entry->size = size;
entry->offset = cache->current_data;
if (size)
@@ -1816,11 +1817,11 @@ membuffer_cache_set_partial(svn_membuffe
* Because membuffer caches tend to be very large, there will be rather few
* of them (usually only one). Thus, the same instance shall be used as the
* backend to many application-visible svn_cache__t instances. This should
- * also achive global resource usage fairness.
+ * also achieve global resource usage fairness.
*
- * To accomodate items from multiple resources, the individual keys must be
- * unique over all sources. This is achived by simply adding a prefix key
- * that unambigously identifies the item's context (e.g. path to the
+ * To accommodate items from multiple resources, the individual keys must be
+ * unique over all sources. This is achieved by simply adding a prefix key
+ * that unambiguously identifies the item's context (e.g. path to the
* respective repository). The prefix will be set upon construction of the
* svn_cache__t instance.
*/
@@ -2147,11 +2148,11 @@ svn_membuffer_cache_get_info(void *cache
svn_membuffer_cache_t *cache = cache_void;
apr_uint32_t i;
- /* cache frontend specific data */
+ /* cache front-end specific data */
info->id = apr_pstrdup(result_pool, cache->full_prefix);
- /* collect info from shared cache backend */
+ /* collect info from shared cache back-end */
info->data_size = 0;
info->used_size = 0;
Modified: subversion/branches/javahl-ra/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_subr/io.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_subr/io.c Mon Dec 24 22:47:14 2012
@@ -138,6 +138,14 @@
#endif
#endif
+/* Forward declaration */
+static apr_status_t
+dir_is_empty(const char *dir, apr_pool_t *pool);
+static APR_INLINE svn_error_t *
+do_io_file_wrapper_cleanup(apr_file_t *file, apr_status_t status,
+ const char *msg, const char *msg_no_name,
+ apr_pool_t *pool);
+
/* Local wrapper of svn_path_cstring_to_utf8() that does no copying on
* operating systems where APR always uses utf-8 as native path format */
static svn_error_t *
@@ -2077,11 +2085,6 @@ svn_io_file_lock2(const char *lock_file,
/* Data consistency/coherency operations. */
-static APR_INLINE svn_error_t *
-do_io_file_wrapper_cleanup(apr_file_t *file, apr_status_t status,
- const char *msg, const char *msg_no_name,
- apr_pool_t *pool);
-
svn_error_t *svn_io_file_flush_to_disk(apr_file_t *file,
apr_pool_t *pool)
{
@@ -3723,11 +3726,6 @@ svn_io_dir_open(apr_dir_t **new_dir, con
return SVN_NO_ERROR;
}
-/* Forward declaration */
-static apr_status_t
-dir_is_empty(const char *dir, apr_pool_t *pool);
-
-
svn_error_t *
svn_io_dir_remove_nonrecursive(const char *dirname, apr_pool_t *pool)
{
Modified: subversion/branches/javahl-ra/subversion/libsvn_subr/named_atomic.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_subr/named_atomic.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_subr/named_atomic.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_subr/named_atomic.c Mon Dec 24 22:47:14 2012
@@ -24,7 +24,7 @@
#include "private/svn_named_atomic.h"
#include <apr_global_mutex.h>
-#include <apr_shm.h>
+#include <apr_mmap.h>
#include "svn_private_config.h"
#include "private/svn_atomic.h"
@@ -35,13 +35,16 @@
/* Implementation aspects.
*
- * We use a single shared memory block that will be created by the first
- * user and merely mapped by all subsequent ones. The memory block contains
- * an short header followed by a fixed-capacity array of named atomics. The
- * number of entries currently in use is stored in the header part.
+ * We use a single shared memory block (memory mapped file) that will be
+ * created by the first user and merely mapped by all subsequent ones.
+ * The memory block contains an short header followed by a fixed-capacity
+ * array of named atomics. The number of entries currently in use is stored
+ * in the header part.
*
- * Finding / creating the SHM object as well as adding new array entries
- * is being guarded by an APR global mutex.
+ * Finding / creating the MMAP object as well as adding new array entries
+ * is being guarded by an APR global mutex. Since releasing the MMAP
+ * structure and closing the underlying does not affect other users of the
+ * same, cleanup will not be synchronized.
*
* The array is append-only. Once a process mapped the block into its
* address space, it may freely access any of the used entries. However,
@@ -182,8 +185,8 @@ struct named_atomic_data_t
*/
struct shared_data_t
{
- volatile apr_int32_t count;
- char padding [sizeof(struct named_atomic_data_t) - sizeof(apr_int32_t)];
+ volatile apr_uint32_t count;
+ char padding [sizeof(struct named_atomic_data_t) - sizeof(apr_uint32_t)];
struct named_atomic_data_t atomics[MAX_ATOMIC_COUNT];
};
@@ -382,8 +385,13 @@ svn_atomic_namespace__create(svn_atomic_
apr_pool_t *result_pool)
{
apr_status_t apr_err;
+ svn_error_t *err;
+ apr_file_t *file;
+ apr_mmap_t *mmap;
const char *shm_name, *lock_name;
- apr_shm_t *shared_mem;
+ apr_finfo_t finfo;
+
+ apr_pool_t *subpool = svn_pool_create(result_pool);
/* allocate the namespace data structure
*/
@@ -391,8 +399,8 @@ svn_atomic_namespace__create(svn_atomic_
/* construct the names of the system objects that we need
*/
- shm_name = apr_pstrcat(result_pool, name, SHM_NAME_SUFFIX, NULL);
- lock_name = apr_pstrcat(result_pool, name, MUTEX_NAME_SUFFIX, NULL);
+ shm_name = apr_pstrcat(subpool, name, SHM_NAME_SUFFIX, NULL);
+ lock_name = apr_pstrcat(subpool, name, MUTEX_NAME_SUFFIX, NULL);
/* initialize the lock objects
*/
@@ -415,42 +423,80 @@ svn_atomic_namespace__create(svn_atomic_
*/
SVN_ERR(lock(&new_ns->mutex));
- /* First, look for an existing shared memory object. If it doesn't
- * exist, create one.
+ /* First, make sure that the underlying file exists. If it doesn't
+ * exist, create one and initialize its content.
+ */
+ err = svn_io_file_open(&file, shm_name,
+ APR_READ | APR_WRITE | APR_CREATE,
+ APR_OS_DEFAULT,
+ result_pool);
+ if (!err)
+ {
+ err = svn_io_stat(&finfo, shm_name, APR_FINFO_SIZE, subpool);
+ if (!err && finfo.size < sizeof(struct shared_data_t))
+ {
+ /* Zero all counters, values and names.
+ */
+ struct shared_data_t initial_data;
+ memset(&initial_data, 0, sizeof(initial_data));
+ err = svn_io_file_write_full(file, &initial_data,
+ sizeof(initial_data), NULL,
+ subpool);
+ }
+ }
+
+ /* Now, map it into memory.
*/
- apr_err = apr_shm_attach(&shared_mem, shm_name, result_pool);
- if (apr_err)
+ if (!err)
{
- apr_err = apr_shm_create(&shared_mem,
- sizeof(*new_ns->data),
- shm_name,
- result_pool);
- if (apr_err)
- return unlock(&new_ns->mutex,
- svn_error_wrap_apr(apr_err,
- _("Can't get shared memory for named atomics")));
+ apr_err = apr_mmap_create(&mmap, file, 0, sizeof(*new_ns->data),
+ APR_MMAP_READ | APR_MMAP_WRITE , result_pool);
+ if (!apr_err)
+ new_ns->data = mmap->mm;
+ else
+ err = svn_error_createf(apr_err, NULL,
+ _("MMAP failed for file '%s'"), shm_name);
+ }
- new_ns->data = apr_shm_baseaddr_get(shared_mem);
+ svn_pool_destroy(subpool);
- /* Zero all counters, values and names.
+ if (!err && new_ns->data)
+ {
+ /* Sanitize (in case of data corruption)
*/
- memset(new_ns->data, 0, sizeof(*new_ns->data));
- }
- else
- new_ns->data = apr_shm_baseaddr_get(shared_mem);
+ if (new_ns->data->count > MAX_ATOMIC_COUNT)
+ new_ns->data->count = MAX_ATOMIC_COUNT;
- /* 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
- * wither 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;
+ /* 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.
*/
- *ns = new_ns;
- return unlock(&new_ns->mutex, SVN_NO_ERROR);
+ return unlock(&new_ns->mutex, err);
+}
+
+svn_error_t *
+svn_atomic_namespace__cleanup(const char *name,
+ apr_pool_t *pool)
+{
+ const char *shm_name, *lock_name;
+
+ /* file names used for the specified namespace */
+ shm_name = apr_pstrcat(pool, name, SHM_NAME_SUFFIX, NULL);
+ lock_name = apr_pstrcat(pool, name, MUTEX_NAME_SUFFIX, NULL);
+
+ /* remove these files if they exist */
+ SVN_ERR(svn_io_remove_file2(shm_name, TRUE, pool));
+ SVN_ERR(svn_io_remove_file2(lock_name, TRUE, pool));
+
+ return SVN_NO_ERROR;
}
svn_error_t *
@@ -459,7 +505,7 @@ svn_named_atomic__get(svn_named_atomic__
const char *name,
svn_boolean_t auto_create)
{
- apr_int32_t i, count;
+ apr_uint32_t i, count;
svn_error_t *error = SVN_NO_ERROR;
apr_size_t len = strlen(name);
@@ -497,7 +543,7 @@ svn_named_atomic__get(svn_named_atomic__
/* We only need to check for new entries.
*/
for (i = count; i < ns->data->count; ++i)
- if (strcmp(ns->data->atomics[i].name, name) == 0)
+ if (strncmp(ns->data->atomics[i].name, name, len + 1) == 0)
{
return_atomic(atomic, ns, i);
Modified: subversion/branches/javahl-ra/subversion/libsvn_subr/path.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_subr/path.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_subr/path.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_subr/path.c Mon Dec 24 22:47:14 2012
@@ -1082,7 +1082,7 @@ svn_path_url_add_component2(const char *
/* = svn_path_uri_encode() but without always copying */
component = uri_escape(component, svn_uri__char_validity, pool);
- return svn_path_join(url, component, pool);
+ return svn_path_join_internal(url, component, pool);
}
svn_error_t *
Modified: subversion/branches/javahl-ra/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_subr/sqlite.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_subr/sqlite.c Mon Dec 24 22:47:14 2012
@@ -45,6 +45,9 @@
#ifdef SVN_SQLITE_INLINE
/* Include sqlite3 inline, making all symbols private. */
#define SQLITE_API static
+ #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+ #pragma GCC diagnostic ignored "-Wunused-function"
+ #endif
#include <sqlite3.c>
#else
#include <sqlite3.h>
Modified: subversion/branches/javahl-ra/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_subr/subst.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_subr/subst.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_subr/subst.c Mon Dec 24 22:47:14 2012
@@ -1613,7 +1613,7 @@ create_special_file_from_stream(svn_stre
}
if (! strncmp(identifier, SVN_SUBST__SPECIAL_LINK_STR " ",
- strlen(SVN_SUBST__SPECIAL_LINK_STR " ")))
+ sizeof(SVN_SUBST__SPECIAL_LINK_STR " ")-1))
{
/* For symlinks, the type specific data is just a filesystem
path that the symlink should reference. */
Modified: subversion/branches/javahl-ra/subversion/libsvn_subr/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_subr/temp_serializer.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_subr/temp_serializer.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_subr/temp_serializer.c Mon Dec 24 22:47:14 2012
@@ -333,7 +333,7 @@ svn_temp_serializer__get_length(svn_temp
return context->buffer->len;
}
-/* Return the data buffer that receives the serialialized data from
+/* Return the data buffer that receives the serialized data from
* the given serialization CONTEXT.
*/
svn_stringbuf_t *
Modified: subversion/branches/javahl-ra/subversion/libsvn_subr/utf.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_subr/utf.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_subr/utf.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_subr/utf.c Mon Dec 24 22:47:14 2012
@@ -892,7 +892,9 @@ svn_utf_stringbuf_from_utf8(svn_stringbu
*dest = svn_stringbuf_dup(src, pool);
}
- SVN_ERR(put_xlate_handle_node(node, SVN_UTF_UTON_XLATE_HANDLE, pool));
+ err = svn_error_compose_create(
+ err,
+ put_xlate_handle_node(node, SVN_UTF_UTON_XLATE_HANDLE, pool));
return err;
}
@@ -925,7 +927,9 @@ svn_utf_string_from_utf8(const svn_strin
*dest = svn_string_dup(src, pool);
}
- SVN_ERR(put_xlate_handle_node(node, SVN_UTF_UTON_XLATE_HANDLE, pool));
+ err = svn_error_compose_create(
+ err,
+ put_xlate_handle_node(node, SVN_UTF_UTON_XLATE_HANDLE, pool));
return err;
}
@@ -943,7 +947,9 @@ svn_utf_cstring_from_utf8(const char **d
SVN_ERR(get_uton_xlate_handle_node(&node, pool));
err = convert_cstring(dest, src, node, pool);
- SVN_ERR(put_xlate_handle_node(node, SVN_UTF_UTON_XLATE_HANDLE, pool));
+ err = svn_error_compose_create(
+ err,
+ put_xlate_handle_node(node, SVN_UTF_UTON_XLATE_HANDLE, pool));
return err;
}
@@ -965,7 +971,9 @@ svn_utf_cstring_from_utf8_ex2(const char
SVN_ERR(get_xlate_handle_node(&node, topage, SVN_APR_UTF8_CHARSET,
convset_key, pool));
err = convert_cstring(dest, src, node, pool);
- SVN_ERR(put_xlate_handle_node(node, convset_key, pool));
+ err = svn_error_compose_create(
+ err,
+ put_xlate_handle_node(node, convset_key, pool));
return err;
}
@@ -1062,7 +1070,9 @@ svn_utf_cstring_from_utf8_string(const c
*dest = apr_pstrmemdup(pool, src->data, src->len);
}
- SVN_ERR(put_xlate_handle_node(node, SVN_UTF_UTON_XLATE_HANDLE, pool));
+ err = svn_error_compose_create(
+ err,
+ put_xlate_handle_node(node, SVN_UTF_UTON_XLATE_HANDLE, pool));
return err;
}
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/adm_files.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/adm_files.c Mon Dec 24 22:47:14 2012
@@ -592,7 +592,7 @@ svn_wc_create_tmp_file2(apr_file_t **fp,
SVN_ERR(svn_wc__db_open(&db,
NULL /* config */,
- TRUE /* auto_upgrade */,
+ FALSE /* auto_upgrade */,
TRUE /* enforce_empty_wq */,
pool, pool));
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/adm_ops.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/adm_ops.c Mon Dec 24 22:47:14 2012
@@ -2211,7 +2211,7 @@ svn_wc_get_pristine_copy_path(const char
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
- SVN_ERR(svn_wc__db_open(&db, NULL, TRUE, TRUE, pool, pool));
+ SVN_ERR(svn_wc__db_open(&db, NULL, FALSE, TRUE, pool, pool));
/* DB is now open. This is seemingly a "light" function that a caller
may use repeatedly despite error return values. The rest of this
function should aggressively close DB, even in the error case. */
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/cleanup.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/cleanup.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/cleanup.c Mon Dec 24 22:47:14 2012
@@ -206,7 +206,7 @@ svn_wc_cleanup3(svn_wc_context_t *wc_ctx
/* We need a DB that allows a non-empty work queue (though it *will*
auto-upgrade). We'll handle everything manually. */
SVN_ERR(svn_wc__db_open(&db,
- NULL /* ### config */, TRUE, FALSE,
+ NULL /* ### config */, FALSE, FALSE,
scratch_pool, scratch_pool));
SVN_ERR(cleanup_internal(db, local_abspath, cancel_func, cancel_baton,
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/conflicts.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/conflicts.c Mon Dec 24 22:47:14 2012
@@ -1617,34 +1617,6 @@ eval_text_conflict_func_result(svn_skel_
return SVN_NO_ERROR;
}
-/* Helper for maybe_resolve_conflicts() below. */
-static const svn_wc_conflict_description2_t *
-setup_text_conflict_desc(const char *left_abspath,
- const char *right_abspath,
- const char *target_abspath,
- const svn_wc_conflict_version_t *left_version,
- const svn_wc_conflict_version_t *right_version,
- const char *result_target,
- const char *detranslated_target,
- const char *mimeprop,
- svn_boolean_t is_binary,
- apr_pool_t *pool)
-{
- svn_wc_conflict_description2_t *cdesc;
-
- cdesc = svn_wc_conflict_description_create_text2(target_abspath, pool);
- cdesc->is_binary = is_binary;
- cdesc->mime_type = mimeprop;
- cdesc->base_abspath = left_abspath;
- cdesc->their_abspath = right_abspath;
- cdesc->my_abspath = detranslated_target;
- cdesc->merged_file = result_target;
-
- cdesc->src_left_version = left_version;
- cdesc->src_right_version = right_version;
-
- return cdesc;
-}
/* Create a new file in the same directory as VERSIONED_ABSPATH, with the
same basename as VERSIONED_ABSPATH, with a ".edited" extension, and set
@@ -1711,7 +1683,7 @@ resolve_text_conflicts(svn_skel_t **work
{
svn_wc_conflict_result_t *result;
svn_skel_t *work_item;
- const svn_wc_conflict_description2_t *cdesc;
+ svn_wc_conflict_description2_t *cdesc;
apr_hash_t *props;
*work_items = NULL;
@@ -1719,38 +1691,37 @@ resolve_text_conflicts(svn_skel_t **work
/* Give the conflict resolution callback a chance to clean
up the conflicts before we mark the file 'conflicted' */
- SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath,
+ scratch_pool, scratch_pool));
- cdesc = setup_text_conflict_desc(left_abspath,
- right_abspath,
- local_abspath,
- left_version,
- right_version,
- result_target,
- detranslated_target,
- svn_prop_get_value(props,
- SVN_PROP_MIME_TYPE),
- FALSE,
- scratch_pool);
+ cdesc = svn_wc_conflict_description_create_text2(local_abspath,
+ scratch_pool);
+ cdesc->is_binary = FALSE;
+ cdesc->mime_type = svn_prop_get_value(props, SVN_PROP_MIME_TYPE);
+ cdesc->base_abspath = left_abspath;
+ cdesc->their_abspath = right_abspath;
+ cdesc->my_abspath = detranslated_target;
+ cdesc->merged_file = result_target;
+ cdesc->src_left_version = left_version;
+ cdesc->src_right_version = right_version;
- SVN_ERR(conflict_func(&result, cdesc, conflict_baton, 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:"
- " returned no results"));
+ if (result == NULL)
+ return svn_error_create(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+ _("Conflict callback violated API: "
+ "returned no results"));
- if (result->save_merged)
+ if (result->save_merged)
{
- SVN_ERR(save_merge_result(work_items,
- db, local_abspath,
- /* Look for callback's own
- merged-file first: */
- result->merged_file
- ? result->merged_file
- : result_target,
- result_pool, scratch_pool));
+ SVN_ERR(save_merge_result(work_items,
+ db, local_abspath,
+ /* Look for callback's own
+ merged-file first: */
+ result->merged_file
+ ? result->merged_file
+ : result_target,
+ result_pool, scratch_pool));
}
SVN_ERR(eval_text_conflict_func_result(&work_item,
@@ -1779,6 +1750,107 @@ resolve_text_conflicts(svn_skel_t **work
}
+static svn_error_t *
+setup_tree_conflict_desc(svn_wc_conflict_description2_t **desc,
+ svn_wc_operation_t operation,
+ const apr_array_header_t *locations,
+ const svn_skel_t *conflict_skel,
+ const char *local_abspath,
+ svn_wc__db_t *db,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_wc_conflict_version_t *v1;
+ svn_wc_conflict_version_t *v2;
+ svn_node_kind_t tc_kind;
+ svn_wc_conflict_reason_t local_change;
+ svn_wc_conflict_action_t incoming_change;
+
+ SVN_ERR(svn_wc__conflict_read_tree_conflict(&local_change,
+ &incoming_change,
+ db, local_abspath,
+ conflict_skel,
+ result_pool, scratch_pool));
+
+ v1 = (locations && locations->nelts > 0)
+ ? APR_ARRAY_IDX(locations, 0, svn_wc_conflict_version_t *)
+ : NULL;
+
+ v2 = (locations && locations->nelts > 1)
+ ? APR_ARRAY_IDX(locations, 1, svn_wc_conflict_version_t *)
+ : NULL;
+
+ if (incoming_change != svn_wc_conflict_action_delete
+ && (operation == svn_wc_operation_update
+ || operation == svn_wc_operation_switch))
+ {
+ svn_wc__db_status_t status;
+ svn_revnum_t revision;
+ const char *repos_relpath;
+ const char *repos_root_url;
+ const char *repos_uuid;
+ svn_kind_t kind;
+ svn_error_t *err;
+
+ /* ### Theoretically we should just fetch the BASE information
+ here. This code might need tweaks until all tree conflicts
+ are installed in the proper state */
+
+ SVN_ERR_ASSERT(v2 == NULL); /* Not set for update and switch */
+
+ /* With an update or switch we have to fetch the second location
+ for a tree conflict from WORKING. (For text or prop from BASE)
+ */
+ err = svn_wc__db_base_get_info(&status, &kind, &revision,
+ &repos_relpath, &repos_root_url,
+ &repos_uuid, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ db, local_abspath,
+ scratch_pool, scratch_pool);
+
+ if (err)
+ {
+ if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+ return svn_error_trace(err);
+
+ svn_error_clear(err);
+ /* Ignore BASE */
+
+ tc_kind = svn_node_file; /* Avoid assertion */
+ }
+ else if (repos_relpath)
+ {
+ v2 = svn_wc_conflict_version_create2(repos_root_url,
+ repos_uuid,
+ repos_relpath,
+ revision,
+ svn__node_kind_from_kind(kind),
+ result_pool);
+ tc_kind = svn__node_kind_from_kind(kind);
+ }
+ else
+ tc_kind = svn_node_file; /* Avoid assertion */
+ }
+ else
+ {
+ if (v1)
+ tc_kind = v1->node_kind;
+ else if (v2)
+ tc_kind = v2->node_kind;
+ else
+ tc_kind = svn_node_file; /* Avoid assertion */
+ }
+
+ *desc = svn_wc_conflict_description_create_tree2(local_abspath, tc_kind,
+ operation, v1, v2,
+ result_pool);
+ (*desc)->reason = local_change;
+ (*desc)->action = incoming_change;
+
+ return SVN_NO_ERROR;
+}
+
+
svn_error_t *
svn_wc__conflict_invoke_resolver(svn_wc__db_t *db,
const char *local_abspath,
@@ -1790,10 +1862,13 @@ svn_wc__conflict_invoke_resolver(svn_wc_
{
svn_boolean_t text_conflicted;
svn_boolean_t prop_conflicted;
+ svn_boolean_t tree_conflicted;
svn_wc_operation_t operation;
+ const apr_array_header_t *locations;
- SVN_ERR(svn_wc__conflict_read_info(&operation, NULL,
- &text_conflicted, &prop_conflicted, NULL,
+ SVN_ERR(svn_wc__conflict_read_info(&operation, &locations,
+ &text_conflicted, &prop_conflicted,
+ &tree_conflicted,
db, local_abspath, conflict_skel,
scratch_pool, scratch_pool));
@@ -1907,6 +1982,30 @@ svn_wc__conflict_invoke_resolver(svn_wc_
}
}
+ if (tree_conflicted)
+ {
+ svn_wc_conflict_reason_t local_change;
+ svn_wc_conflict_action_t incoming_change;
+ svn_wc_conflict_result_t *result;
+ svn_wc_conflict_description2_t *desc;
+
+ SVN_ERR(svn_wc__conflict_read_tree_conflict(&local_change,
+ &incoming_change,
+ db, local_abspath,
+ conflict_skel,
+ scratch_pool, scratch_pool));
+ SVN_ERR(setup_tree_conflict_desc(&desc, operation, locations,
+ conflict_skel, local_abspath, db,
+ scratch_pool, scratch_pool));
+ /* Tell the resolver func about this conflict. */
+ 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
+ * postponed and resolved after the operation has completed. */
+ }
+
return SVN_NO_ERROR;
}
@@ -2124,94 +2223,10 @@ svn_wc__read_conflicts(const apr_array_h
if (tree_conflicted)
{
svn_wc_conflict_description2_t *desc;
- svn_wc_conflict_version_t *v1;
- svn_wc_conflict_version_t *v2;
- svn_node_kind_t tc_kind;
- svn_wc_conflict_reason_t local_change;
- svn_wc_conflict_action_t incoming_change;
-
- SVN_ERR(svn_wc__conflict_read_tree_conflict(&local_change,
- &incoming_change,
- db, local_abspath,
- conflict_skel,
- scratch_pool, scratch_pool));
-
- v1 = (locations && locations->nelts > 0)
- ? APR_ARRAY_IDX(locations, 0, svn_wc_conflict_version_t *)
- : NULL;
-
- v2 = (locations && locations->nelts > 1)
- ? APR_ARRAY_IDX(locations, 1, svn_wc_conflict_version_t *)
- : NULL;
-
- if (incoming_change != svn_wc_conflict_action_delete
- && (operation == svn_wc_operation_update
- || operation == svn_wc_operation_switch))
- {
- svn_wc__db_status_t status;
- svn_revnum_t revision;
- const char *repos_relpath;
- const char *repos_root_url;
- const char *repos_uuid;
- svn_kind_t kind;
- svn_error_t *err;
-
- /* ### Theoretically we should just fetch the BASE information
- here. This code might need tweaks until all tree conflicts
- are installed in the proper state */
-
- SVN_ERR_ASSERT(v2 == NULL); /* Not set for update and switch */
-
- /* With an update or switch we have to fetch the second location
- for a tree conflict from WORKING. (For text or prop from BASE)
- */
- err = svn_wc__db_base_get_info(&status, &kind, &revision,
- &repos_relpath, &repos_root_url,
- &repos_uuid, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- db, local_abspath,
- scratch_pool, scratch_pool);
-
- if (err)
- {
- if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
- return svn_error_trace(err);
-
- svn_error_clear(err);
- /* Ignore BASE */
-
- tc_kind = svn_node_file; /* Avoid assertion */
- }
- else if (repos_relpath)
- {
- v2 = svn_wc_conflict_version_create2(repos_root_url,
- repos_uuid,
- repos_relpath,
- revision,
- svn__node_kind_from_kind(kind),
- scratch_pool);
- tc_kind = svn__node_kind_from_kind(kind);
- }
- else
- tc_kind = svn_node_file; /* Avoid assertion */
- }
- else
- {
- if (v1)
- tc_kind = v1->node_kind;
- else if (v2)
- tc_kind = v2->node_kind;
- else
- tc_kind = svn_node_file; /* Avoid assertion */
- }
-
- desc = svn_wc_conflict_description_create_tree2(local_abspath, tc_kind,
- operation, v1, v2,
- result_pool);
-
- desc->reason = local_change;
- desc->action = incoming_change;
+ SVN_ERR(setup_tree_conflict_desc(&desc, operation, locations,
+ conflict_skel, local_abspath, db,
+ result_pool, scratch_pool));
APR_ARRAY_PUSH(cflcts, const svn_wc_conflict_description2_t *) = desc;
}
@@ -2243,6 +2258,7 @@ resolve_conflict_on_node(svn_boolean_t *
svn_boolean_t resolve_props,
svn_boolean_t resolve_tree,
svn_wc_conflict_choice_t conflict_choice,
+ svn_skel_t *work_items,
svn_cancel_func_t cancel_func_t,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -2252,7 +2268,6 @@ resolve_conflict_on_node(svn_boolean_t *
svn_boolean_t text_conflicted;
svn_boolean_t prop_conflicted;
svn_boolean_t tree_conflicted;
- svn_skel_t *work_items = NULL;
svn_skel_t *work_item;
apr_pool_t *pool = scratch_pool;
@@ -2542,6 +2557,7 @@ svn_wc__resolve_text_conflict(svn_wc__db
FALSE /* resolve_props */,
FALSE /* resolve_tree */,
svn_wc_conflict_choose_merged,
+ NULL,
NULL, NULL, /* cancel_func */
scratch_pool));
}
@@ -2591,6 +2607,8 @@ conflict_status_walker(void *baton,
const svn_wc_conflict_description2_t *cd;
svn_boolean_t did_resolve;
svn_wc_conflict_choice_t my_choice = cswb->conflict_choice;
+ svn_skel_t *work_items = NULL;
+
cd = APR_ARRAY_IDX(conflicts, i, const svn_wc_conflict_description2_t *);
@@ -2621,15 +2639,32 @@ conflict_status_walker(void *baton,
if (!cswb->resolve_tree)
break;
- /* For now, we only clear tree conflict information and resolve
- * to the working state. There is no way to pick theirs-full
- * or mine-full, etc. Throw an error if the user expects us
- * to be smarter than we really are. */
- if (my_choice != svn_wc_conflict_choose_merged)
+ /* After updates, we can resolve local moved-away vs. any incoming
+ * change, either by updating the moved-away node (mine-conflict)
+ * or by breaking the move (theirs-conflict). */
+ if ((cd->operation == svn_wc_operation_update ||
+ cd->operation == svn_wc_operation_switch) &&
+ cd->reason == svn_wc_conflict_reason_moved_away)
+ {
+ if (my_choice == svn_wc_conflict_choose_mine_conflict)
+ SVN_ERR(svn_wc__db_update_moved_away_conflict_victim(
+ &work_items, local_abspath, cswb->db,
+ cswb->notify_func, cswb->notify_baton,
+ cswb->cancel_func, cswb->cancel_baton,
+ scratch_pool, scratch_pool));
+ else if (my_choice == svn_wc_conflict_choose_theirs_conflict)
+ {
+ /* ### TODO break move */
+ }
+ }
+ else if (my_choice != svn_wc_conflict_choose_merged)
{
+ /* For other tree conflicts, there is no way to pick
+ * theirs-full or mine-full, etc. Throw an error if the
+ * user expects us to be smarter than we really are. */
return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
NULL,
- _("Tree conflicts can only be "
+ _("Tree conflict can only be "
"resolved to 'working' state; "
"'%s' not resolved"),
svn_dirent_local_style(local_abspath,
@@ -2643,6 +2678,7 @@ conflict_status_walker(void *baton,
FALSE /* resolve_props */,
TRUE /* resolve_tree */,
my_choice,
+ work_items,
cswb->cancel_func,
cswb->cancel_baton,
iterpool));
@@ -2661,6 +2697,7 @@ conflict_status_walker(void *baton,
FALSE /* resolve_props */,
FALSE /* resolve_tree */,
my_choice,
+ NULL,
cswb->cancel_func,
cswb->cancel_baton,
iterpool));
@@ -2690,6 +2727,7 @@ conflict_status_walker(void *baton,
TRUE /* resolve_props */,
FALSE /* resolve_tree */,
my_choice,
+ NULL,
cswb->cancel_func,
cswb->cancel_baton,
iterpool));
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/conflicts.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/conflicts.h?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/conflicts.h (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/conflicts.h Mon Dec 24 22:47:14 2012
@@ -394,7 +394,6 @@ svn_wc__resolve_text_conflict(svn_wc__db
const char *local_abspath,
apr_pool_t *scratch_pool);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/context.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/context.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/context.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/context.c Mon Dec 24 22:47:14 2012
@@ -65,10 +65,12 @@ svn_wc_context_create(svn_wc_context_t *
{
svn_wc_context_t *ctx = apr_pcalloc(result_pool, sizeof(*ctx));
- /* Create the state_pool, and open up a wc_db in it. */
+ /* Create the state_pool, and open up a wc_db in it.
+ * Since config contains a private mutable member but C doesn't support
+ * we need to make it writable */
ctx->state_pool = result_pool;
- SVN_ERR(svn_wc__db_open(&ctx->db, config,
- TRUE, TRUE, ctx->state_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_open(&ctx->db, (svn_config_t *)config,
+ FALSE, TRUE, ctx->state_pool, scratch_pool));
ctx->close_db_on_destroy = TRUE;
apr_pool_cleanup_register(result_pool, ctx, close_ctx_apr,
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/entries.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/entries.c Mon Dec 24 22:47:14 2012
@@ -1389,10 +1389,10 @@ entries_read_txn(void *baton, svn_sqlite
}
svn_error_t *
-svn_wc_entries_read(apr_hash_t **entries,
- svn_wc_adm_access_t *adm_access,
- svn_boolean_t show_hidden,
- apr_pool_t *pool)
+svn_wc__entries_read_internal(apr_hash_t **entries,
+ svn_wc_adm_access_t *adm_access,
+ svn_boolean_t show_hidden,
+ apr_pool_t *pool)
{
apr_hash_t *new_entries;
@@ -1401,7 +1401,7 @@ svn_wc_entries_read(apr_hash_t **entries
{
svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
const char *local_abspath = svn_wc__adm_access_abspath(adm_access);
- apr_pool_t *result_pool = svn_wc_adm_access_pool(adm_access);
+ apr_pool_t *result_pool = svn_wc__adm_access_pool_internal(adm_access);
svn_sqlite__db_t *sdb;
struct entries_read_baton_t erb;
@@ -1425,12 +1425,21 @@ svn_wc_entries_read(apr_hash_t **entries
*entries = new_entries;
else
SVN_ERR(prune_deleted(entries, new_entries,
- svn_wc_adm_access_pool(adm_access),
+ svn_wc__adm_access_pool_internal(adm_access),
pool));
return SVN_NO_ERROR;
}
+svn_error_t *
+svn_wc_entries_read(apr_hash_t **entries,
+ svn_wc_adm_access_t *adm_access,
+ svn_boolean_t show_hidden,
+ apr_pool_t *pool)
+{
+ return svn_error_trace(svn_wc__entries_read_internal(entries, adm_access,
+ show_hidden, pool));
+}
/* No transaction required: called from write_entry which is itself
transaction-wrapped. */
@@ -2445,7 +2454,8 @@ walker_helper(const char *dirpath,
svn_error_t *err;
svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
- err = svn_wc_entries_read(&entries, adm_access, show_hidden, pool);
+ err = svn_wc__entries_read_internal(&entries, adm_access, show_hidden,
+ pool);
if (err)
SVN_ERR(walk_callbacks->handle_error(dirpath, err, walk_baton, pool));
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/entries.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/entries.h?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/entries.h (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/entries.h Mon Dec 24 22:47:14 2012
@@ -148,6 +148,15 @@ svn_wc__serialize_file_external(const ch
const svn_opt_revision_t *rev,
apr_pool_t *pool);
+/* Non-deprecated wrapper variant of svn_wc_entries_read used implement
+ legacy API functions. See svn_wc_entries_read for a detailed description.
+ */
+svn_error_t *
+svn_wc__entries_read_internal(apr_hash_t **entries,
+ svn_wc_adm_access_t *adm_access,
+ svn_boolean_t show_hidden,
+ apr_pool_t *pool);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/lock.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/lock.c Mon Dec 24 22:47:14 2012
@@ -98,7 +98,8 @@ svn_wc__internal_check_wc(int *wc_format
svn_node_kind_t kind;
if (err->apr_err != SVN_ERR_WC_MISSING &&
- err->apr_err != SVN_ERR_WC_UNSUPPORTED_FORMAT)
+ err->apr_err != SVN_ERR_WC_UNSUPPORTED_FORMAT &&
+ err->apr_err != SVN_ERR_WC_UPGRADE_REQUIRED)
return svn_error_trace(err);
svn_error_clear(err);
@@ -331,7 +332,7 @@ pool_cleanup_locked(void *p)
run, but the subpools will NOT be destroyed) */
scratch_pool = svn_pool_create(lock->pool);
- err = svn_wc__db_open(&db, NULL /* ### config. need! */, TRUE, TRUE,
+ err = svn_wc__db_open(&db, NULL /* ### config. need! */, FALSE, TRUE,
scratch_pool, scratch_pool);
if (!err)
{
@@ -781,7 +782,7 @@ svn_wc_adm_open3(svn_wc_adm_access_t **a
do it here. */
/* ### we could optimize around levels_to_lock==0, but much of this
### is going to be simplified soon anyways. */
- SVN_ERR(svn_wc__db_open(&db, NULL /* ### config. need! */, TRUE, TRUE,
+ SVN_ERR(svn_wc__db_open(&db, NULL /* ### config. need! */, FALSE, TRUE,
pool, pool));
db_provided = FALSE;
}
@@ -811,7 +812,7 @@ svn_wc_adm_probe_open3(svn_wc_adm_access
/* Ugh. Too bad about having to open a DB. */
SVN_ERR(svn_wc__db_open(&db,
- NULL /* ### config */, TRUE, TRUE, pool, pool));
+ NULL /* ### config */, FALSE, TRUE, pool, pool));
err = probe(db, &dir, path, pool);
svn_error_clear(svn_wc__db_close(db));
SVN_ERR(err);
@@ -1157,7 +1158,7 @@ open_anchor(svn_wc_adm_access_t **anchor
### given that we need DB for format detection, may as well keep this.
### in any case, much of this is going to be simplified soon anyways. */
if (!db_provided)
- SVN_ERR(svn_wc__db_open(&db, NULL, /* ### config. need! */ TRUE, TRUE,
+ SVN_ERR(svn_wc__db_open(&db, NULL, /* ### config. need! */ FALSE, TRUE,
pool, pool));
if (svn_path_is_empty(path)
@@ -1478,6 +1479,11 @@ svn_wc_adm_access_pool(const svn_wc_adm_
return adm_access->pool;
}
+apr_pool_t *
+svn_wc__adm_access_pool_internal(const svn_wc_adm_access_t *adm_access)
+{
+ return adm_access->pool;
+}
void
svn_wc__adm_access_set_entries(svn_wc_adm_access_t *adm_access,
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/lock.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/lock.h?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/lock.h (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/lock.h Mon Dec 24 22:47:14 2012
@@ -77,6 +77,13 @@ svn_wc__adm_get_db(const svn_wc_adm_acce
const char *
svn_wc__adm_access_abspath(const svn_wc_adm_access_t *adm_access);
+/* Return the pool used by access baton ADM_ACCESS.
+ * Note: This is a non-deprecated variant of svn_wc_adm_access_pool for
+ * libsvn_wc internal usage only.
+ */
+apr_pool_t *
+svn_wc__adm_access_pool_internal(const svn_wc_adm_access_t *adm_access);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/node.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/node.c Mon Dec 24 22:47:14 2012
@@ -219,6 +219,70 @@ svn_wc__internal_get_repos_info(const ch
return SVN_NO_ERROR;
}
+/* ### This is essentially a copy-paste of svn_wc__internal_get_url().
+ * ### If we decide to keep this one, then it should be rewritten to avoid
+ * ### code duplication.*/
+svn_error_t *
+svn_wc__internal_get_repos_relpath(const char **repos_relpath,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_wc__db_status_t status;
+ svn_boolean_t have_base;
+
+ SVN_ERR(svn_wc__db_read_info(&status, NULL, NULL, repos_relpath,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ &have_base, NULL, NULL,
+ db, local_abspath,
+ result_pool, scratch_pool));
+ if (*repos_relpath == NULL)
+ {
+ if (status == svn_wc__db_status_added)
+ {
+ SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, repos_relpath,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ db, local_abspath,
+ result_pool, scratch_pool));
+ }
+ else if (have_base)
+ {
+ SVN_ERR(svn_wc__db_scan_base_repos(repos_relpath, NULL,
+ NULL,
+ db, local_abspath,
+ result_pool, scratch_pool));
+ }
+ else if (status == svn_wc__db_status_excluded
+ || (!have_base && (status == svn_wc__db_status_deleted)))
+ {
+ const char *parent_abspath, *name, *parent_relpath;
+
+ svn_dirent_split(&parent_abspath, &name, local_abspath,
+ scratch_pool);
+ SVN_ERR(svn_wc__internal_get_repos_relpath(&parent_relpath, db,
+ parent_abspath,
+ scratch_pool,
+ scratch_pool));
+
+ if (parent_relpath)
+ *repos_relpath = svn_relpath_join(parent_relpath, name,
+ result_pool);
+ }
+ else
+ {
+ /* Status: obstructed, obstructed_add */
+ *repos_relpath = NULL;
+ return SVN_NO_ERROR;
+ }
+ }
+
+ return SVN_NO_ERROR;
+}
+
svn_error_t *
svn_wc__node_get_repos_info(const char **repos_root_url,
const char **repos_uuid,
@@ -348,9 +412,6 @@ svn_wc__node_get_url(const char **url,
result_pool, scratch_pool));
}
-/* ### This is essentially a copy-paste of svn_wc__internal_get_url().
- * ### If we decide to keep this one, then it should be rewritten to avoid
- * ### code duplication.*/
svn_error_t *
svn_wc__node_get_repos_relpath(const char **repos_relpath,
svn_wc_context_t *wc_ctx,
@@ -358,58 +419,11 @@ svn_wc__node_get_repos_relpath(const cha
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- svn_wc__db_status_t status;
- svn_boolean_t have_base;
-
- SVN_ERR(svn_wc__db_read_info(&status, NULL, NULL, repos_relpath,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- &have_base, NULL, NULL,
- wc_ctx->db, local_abspath,
- result_pool, scratch_pool));
- if (*repos_relpath == NULL)
- {
- if (status == svn_wc__db_status_added)
- {
- SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, repos_relpath,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- wc_ctx->db, local_abspath,
- result_pool, scratch_pool));
- }
- else if (have_base)
- {
- SVN_ERR(svn_wc__db_scan_base_repos(repos_relpath, NULL,
- NULL,
- wc_ctx->db, local_abspath,
- result_pool, scratch_pool));
- }
- else if (status == svn_wc__db_status_excluded
- || (!have_base && (status == svn_wc__db_status_deleted)))
- {
- const char *parent_abspath, *name, *parent_relpath;
-
- svn_dirent_split(&parent_abspath, &name, local_abspath,
- scratch_pool);
- SVN_ERR(svn_wc__node_get_repos_relpath(&parent_relpath, wc_ctx,
- parent_abspath,
- scratch_pool,
- scratch_pool));
-
- if (parent_relpath)
- *repos_relpath = svn_relpath_join(parent_relpath, name,
- result_pool);
- }
- else
- {
- /* Status: obstructed, obstructed_add */
- *repos_relpath = NULL;
- return SVN_NO_ERROR;
- }
- }
-
- return SVN_NO_ERROR;
+ return svn_error_trace(svn_wc__internal_get_repos_relpath(repos_relpath,
+ wc_ctx->db,
+ local_abspath,
+ result_pool,
+ scratch_pool));
}
svn_error_t *
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/old-and-busted.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/old-and-busted.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/old-and-busted.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/old-and-busted.c Mon Dec 24 22:47:14 2012
@@ -1327,7 +1327,7 @@ svn_wc_entry(const svn_wc_entry_t **entr
/* Load an entries hash, and cache it into DIR_ACCESS. Go ahead and
fetch all entries here (optimization) since we know how to filter
out a "hidden" node. */
- SVN_ERR(svn_wc_entries_read(&entries, dir_access, TRUE, pool));
+ SVN_ERR(svn_wc__entries_read_internal(&entries, dir_access, TRUE, pool));
*entry = apr_hash_get(entries, entry_name, APR_HASH_KEY_STRING);
if (!show_hidden && *entry != NULL)
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/props.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/props.c Mon Dec 24 22:47:14 2012
@@ -1675,6 +1675,8 @@ validate_prop_against_node_kind(const ch
const char *file_prohibit[] = { SVN_PROP_IGNORE,
SVN_PROP_EXTERNALS,
+ SVN_PROP_INHERITABLE_AUTO_PROPS,
+ SVN_PROP_INHERITABLE_IGNORES,
NULL };
const char *dir_prohibit[] = { SVN_PROP_EXECUTABLE,
SVN_PROP_KEYWORDS,
@@ -2144,7 +2146,9 @@ svn_wc_canonicalize_svn_prop(const svn_s
SVN_ERR(svn_mime_type_validate(new_value->data, pool));
}
else if (strcmp(propname, SVN_PROP_IGNORE) == 0
- || strcmp(propname, SVN_PROP_EXTERNALS) == 0)
+ || strcmp(propname, SVN_PROP_EXTERNALS) == 0
+ || strcmp(propname, SVN_PROP_INHERITABLE_IGNORES) == 0
+ || strcmp(propname, SVN_PROP_INHERITABLE_AUTO_PROPS) == 0)
{
/* Make sure that the last line ends in a newline */
if (propval->len == 0
@@ -2356,12 +2360,12 @@ filter_unwanted_props(apr_hash_t *prop_h
}
svn_error_t *
-svn_wc__get_iprops(apr_array_header_t **inherited_props,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- const char *propname,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+svn_wc__internal_get_iprops(apr_array_header_t **inherited_props,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ const char *propname,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
int i;
apr_array_header_t *cached_iprops = NULL;
@@ -2381,23 +2385,23 @@ svn_wc__get_iprops(apr_array_header_t **
svn_pool_clear(iterpool);
- SVN_ERR(svn_wc_is_wc_root2(&is_wc_root, wc_ctx, parent_abspath,
- iterpool));
+ SVN_ERR(svn_wc__internal_is_wc_root(&is_wc_root, db, parent_abspath,
+ iterpool));
+
if (is_wc_root)
{
const char *child_repos_relpath;
- SVN_ERR(svn_wc__node_get_repos_relpath(&child_repos_relpath,
- wc_ctx, parent_abspath,
- iterpool, iterpool));
+ SVN_ERR(svn_wc__internal_get_repos_relpath(&child_repos_relpath,
+ db, parent_abspath,
+ iterpool, iterpool));
/* If the WC root is also the root of the repository then by
definition there are no inheritable properties to be had. */
if (child_repos_relpath[0] != '\0')
{
/* Grab the cached inherited properties for the WC root. */
- SVN_ERR(svn_wc__db_read_cached_iprops(&cached_iprops,
- wc_ctx->db,
+ SVN_ERR(svn_wc__db_read_cached_iprops(&cached_iprops, db,
parent_abspath,
scratch_pool,
iterpool));
@@ -2408,9 +2412,8 @@ svn_wc__get_iprops(apr_array_header_t **
LOCAL_ABSPATH can inherit properties from it. */
if (strcmp(local_abspath, parent_abspath) != 0)
{
- SVN_ERR(svn_wc__db_read_props(&actual_props, wc_ctx->db,
- parent_abspath, result_pool,
- iterpool));
+ SVN_ERR(svn_wc__db_read_props(&actual_props, db, parent_abspath,
+ result_pool, iterpool));
if (actual_props)
{
/* If we only want PROPNAME filter out any other properties. */
@@ -2466,6 +2469,19 @@ svn_wc__get_iprops(apr_array_header_t **
}
svn_error_t *
+svn_wc__get_iprops(apr_array_header_t **inherited_props,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ const char *propname,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ return svn_error_trace(svn_wc__internal_get_iprops(inherited_props, wc_ctx->db,
+ local_abspath, propname,
+ result_pool, scratch_pool));
+}
+
+svn_error_t *
svn_wc__get_cached_iprop_children(apr_hash_t **iprop_paths,
svn_depth_t depth,
svn_wc_context_t *wc_ctx,
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/status.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/status.c Mon Dec 24 22:47:14 2012
@@ -939,10 +939,14 @@ send_status_structure(const struct walk_
}
-/* Store in PATTERNS a list of all svn:ignore properties from
+/* Store in *PATTERNS a list of all svn:ignore properties from
the working copy directory, including the default ignores
passed in as IGNORES.
+ If INHERITED_PATTERNS is not NULL, then store in *INHERITED_PATTERNS
+ a list of all ignore patterns defined by the svn:inherited-ignores
+ properties explicitly set on, or inherited by, LOCAL_ABSPATH.
+
Upon return, *PATTERNS will contain zero or more (const char *)
patterns from the value of the SVN_PROP_IGNORE property set on
the working directory path.
@@ -961,6 +965,7 @@ send_status_structure(const struct walk_
*/
static svn_error_t *
collect_ignore_patterns(apr_array_header_t **patterns,
+ apr_array_header_t **inherited_patterns,
svn_wc__db_t *db,
const char *local_abspath,
const apr_array_header_t *ignores,
@@ -970,7 +975,7 @@ collect_ignore_patterns(apr_array_header
{
int i;
const svn_string_t *value;
- apr_hash_t *props;
+ apr_hash_t *props = NULL;
/* ### assert we are passed a directory? */
@@ -984,21 +989,56 @@ collect_ignore_patterns(apr_array_header
ignore);
}
- if (!may_have_props)
- return SVN_NO_ERROR;
+ if (may_have_props)
+ {
+ /* Add any svn:ignore globs to the PATTERNS array. */
+ SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath,
+ scratch_pool, scratch_pool));
- /* Then add any svn:ignore globs to the PATTERNS array. */
- SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath,
- scratch_pool, scratch_pool));
+ if (!props)
+ return SVN_NO_ERROR;
- if (!props)
- return SVN_NO_ERROR;
+ value = apr_hash_get(props, SVN_PROP_IGNORE, APR_HASH_KEY_STRING);
- value = apr_hash_get(props, SVN_PROP_IGNORE, APR_HASH_KEY_STRING);
+ if (value != NULL)
+ svn_cstring_split_append(*patterns, value->data, "\n\r", FALSE,
+ result_pool);
+ }
- if (value != NULL)
- svn_cstring_split_append(*patterns, value->data, "\n\r", FALSE,
- result_pool);
+ if (inherited_patterns)
+ {
+ apr_array_header_t *inherited_props;
+
+ *inherited_patterns = apr_array_make(result_pool, 1,
+ sizeof(const char *));
+ if (props)
+ {
+ value = apr_hash_get(props, SVN_PROP_INHERITABLE_IGNORES,
+ APR_HASH_KEY_STRING);
+ if (value != NULL)
+ svn_cstring_split_append(*inherited_patterns, value->data, "\n\r",
+ FALSE, result_pool);
+ }
+
+ SVN_ERR(svn_wc__internal_get_iprops(&inherited_props, db, local_abspath,
+ SVN_PROP_INHERITABLE_IGNORES,
+ scratch_pool, scratch_pool));
+ for (i = 0; i < inherited_props->nelts; i++)
+ {
+ apr_hash_index_t *hi;
+ svn_prop_inherited_item_t *elt = APR_ARRAY_IDX(
+ inherited_props, i, svn_prop_inherited_item_t *);
+
+ for (hi = apr_hash_first(scratch_pool, elt->prop_hash);
+ hi;
+ hi = apr_hash_next(hi))
+ {
+ const svn_string_t *propval = svn__apr_hash_index_val(hi);
+ svn_cstring_split_append(*inherited_patterns, propval->data,
+ "\n\r", FALSE, result_pool);
+ }
+ }
+ }
return SVN_NO_ERROR;
}
@@ -1043,13 +1083,13 @@ is_external_path(apr_hash_t *externals,
requested. PATH_KIND is the node kind of NAME as determined by the
caller. PATH_SPECIAL is the special status of the path, also determined
by the caller.
- PATTERNS points to a list of filename patterns which are marked as
- ignored. None of these parameter may be NULL. EXTERNALS is a hash
- of known externals definitions for this status run.
+ PATTERNS and INHERITED_PATTERNS point to a list of filename patterns which
+ are marked as ignored. None of these parameter may be NULL. EXTERNALS is
+ a hash of known externals definitions for this status run.
- If NO_IGNORE is non-zero, the item will be added regardless of
+ If NO_IGNORE is TRUE, the item will be added regardless of
whether it is ignored; otherwise we will only add the item if it
- does not match any of the patterns in PATTERNS.
+ does not match any of the patterns in PATTERN or INHERITED_IGNORES.
Allocate everything in POOL.
*/
@@ -1059,22 +1099,26 @@ send_unversioned_item(const struct walk_
const svn_io_dirent2_t *dirent,
svn_boolean_t tree_conflicted,
const apr_array_header_t *patterns,
+ const apr_array_header_t *inherited_patterns,
svn_boolean_t no_ignore,
svn_wc_status_func4_t status_func,
void *status_baton,
apr_pool_t *scratch_pool)
{
svn_boolean_t is_ignored;
+ svn_boolean_t is_mandatory_ignored;
svn_boolean_t is_external;
svn_wc_status3_t *status;
+ const char *base_name = svn_dirent_basename(local_abspath, NULL);
- is_ignored = svn_wc_match_ignore_list(
- svn_dirent_basename(local_abspath, NULL),
- patterns, scratch_pool);
-
+ is_ignored = svn_wc_match_ignore_list(base_name, patterns, scratch_pool);
+ is_mandatory_ignored = svn_wc_match_ignore_list(base_name,
+ inherited_patterns,
+ scratch_pool);
SVN_ERR(assemble_unversioned(&status,
wb->db, local_abspath,
- dirent, tree_conflicted, is_ignored,
+ dirent, tree_conflicted,
+ is_ignored || is_mandatory_ignored,
scratch_pool, scratch_pool));
is_external = is_external_path(wb->externals, local_abspath, scratch_pool);
@@ -1089,7 +1133,9 @@ send_unversioned_item(const struct walk_
/* If we aren't ignoring it, or if it's an externals path, pass this
entry to the status func. */
- if (no_ignore || (! is_ignored) || is_external)
+ if (no_ignore
+ || !(is_ignored || is_mandatory_ignored)
+ || is_external)
return svn_error_trace((*status_func)(status_baton, local_abspath,
status, scratch_pool));
@@ -1137,15 +1183,17 @@ get_dir_status(const struct walk_status_
*
* DIR_HAS_PROPS is a boolean indicating whether PARENT_ABSPATH has properties.
*
- * If *COLLECTED_IGNORE_PATTERNS is NULL and ignore patterns are needed in
- * this call, *COLLECTED_IGNORE_PATTERNS will be set to an apr_array_header_t*
+ * If *COLLECTED_IGNORE_PATTERNS or COLLECTED_INHERITED_IGNORE_PATTERNS are NULL
+ * and ignore patterns are needed in this call, then *COLLECTED_IGNORE_PATTERNS
+ * *COLLECTED_INHERITED_IGNORE_PATTERNS will be set to an apr_array_header_t*
* containing all ignore patterns, as returned by collect_ignore_patterns() on
- * PARENT_ABSPATH and IGNORE_PATTERNS. If *COLLECTED_IGNORE_PATTERNS is passed
- * non-NULL, it is assumed to already hold that result. This speeds up
- * repeated calls with the same PARENT_ABSPATH.
+ * PARENT_ABSPATH and IGNORE_PATTERNS. If *COLLECTED_IGNORE_PATTERNS and
+ * COLLECTED_INHERITED_IGNORE_PATTERNS is passed non-NULL, it is assumed they
+ * already hold those results. This speeds up repeated calls with the same
+ * PARENT_ABSPATH.
*
- * *COLLECTED_IGNORE_PATTERNS will be allocated in RESULT_POOL. All other
- * allocations are made in SCRATCH_POOL.
+ * *COLLECTED_IGNORE_PATTERNS and COLLECTED_INHERITED_IGNORE_PATTERNS will be
+ * allocated in RESULT_POOL. All other allocations are made in SCRATCH_POOL.
*
* The remaining parameters correspond to get_dir_status(). */
static svn_error_t*
@@ -1160,6 +1208,7 @@ one_child_status(const struct walk_statu
svn_boolean_t dir_has_props,
svn_boolean_t unversioned_tree_conflicted,
apr_array_header_t **collected_ignore_patterns,
+ apr_array_header_t **collected_inherited_ignore_patterns,
const apr_array_header_t *ignore_patterns,
svn_depth_t depth,
svn_boolean_t get_all,
@@ -1242,9 +1291,12 @@ one_child_status(const struct walk_statu
* determined. For example, in 'svn status', plain unversioned nodes show
* as '? C', where ignored ones show as 'I C'. */
- if (ignore_patterns && ! *collected_ignore_patterns)
- SVN_ERR(collect_ignore_patterns(collected_ignore_patterns, wb->db,
- parent_abspath, ignore_patterns,
+ if ((ignore_patterns && ! *collected_ignore_patterns)
+ || (collected_inherited_ignore_patterns
+ && ! collected_inherited_ignore_patterns))
+ SVN_ERR(collect_ignore_patterns(collected_ignore_patterns,
+ collected_inherited_ignore_patterns,
+ wb->db, parent_abspath, ignore_patterns,
dir_has_props,
result_pool, scratch_pool));
@@ -1253,6 +1305,7 @@ one_child_status(const struct walk_statu
dirent,
conflicted,
*collected_ignore_patterns,
+ *collected_inherited_ignore_patterns,
no_ignore,
status_func, status_baton,
scratch_pool));
@@ -1306,6 +1359,7 @@ get_dir_status(const struct walk_status_
apr_hash_t *dirents, *nodes, *conflicts, *all_children;
apr_array_header_t *sorted_children;
apr_array_header_t *collected_ignore_patterns = NULL;
+ apr_array_header_t *collected_inherited_ignore_patterns = NULL;
apr_pool_t *iterpool, *subpool = svn_pool_create(scratch_pool);
svn_error_t *err;
int i;
@@ -1436,6 +1490,7 @@ get_dir_status(const struct walk_status_
dir_has_props,
apr_hash_get(conflicts, key, klen) != NULL,
&collected_ignore_patterns,
+ &collected_inherited_ignore_patterns,
ignore_patterns,
depth,
get_all,
@@ -1485,6 +1540,7 @@ get_child_status(const struct walk_statu
const char *dir_repos_uuid;
const struct svn_wc__db_info_t *dir_info;
apr_array_header_t *collected_ignore_patterns = NULL;
+ apr_array_header_t *collected_inherited_ignore_patterns = NULL;
const svn_io_dirent2_t *dirent_p;
const char *parent_abspath = svn_dirent_dirname(local_abspath,
scratch_pool);
@@ -1523,6 +1579,7 @@ get_child_status(const struct walk_statu
(dir_info->had_props || dir_info->props_mod),
FALSE, /* unversioned_tree_conflicted */
&collected_ignore_patterns,
+ &collected_inherited_ignore_patterns,
ignore_patterns,
svn_depth_empty,
get_all,
@@ -2985,7 +3042,7 @@ svn_wc_get_ignores2(apr_array_header_t *
apr_array_header_t *default_ignores;
SVN_ERR(svn_wc_get_default_ignores(&default_ignores, config, scratch_pool));
- return svn_error_trace(collect_ignore_patterns(patterns, wc_ctx->db,
+ return svn_error_trace(collect_ignore_patterns(patterns, NULL, wc_ctx->db,
local_abspath,
default_ignores, TRUE,
result_pool, scratch_pool));
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/tree_conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/tree_conflicts.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/tree_conflicts.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/tree_conflicts.c Mon Dec 24 22:47:14 2012
@@ -182,11 +182,12 @@ read_node_version_info(const svn_wc_conf
skel->children->next->next->next->next));
kind = (svn_node_kind_t)n;
- *version_info = svn_wc_conflict_version_create(repos_root,
- repos_relpath,
- peg_rev,
- kind,
- result_pool);
+ *version_info = svn_wc_conflict_version_create2(repos_root,
+ NULL,
+ repos_relpath,
+ peg_rev,
+ kind,
+ result_pool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c Mon Dec 24 22:47:14 2012
@@ -874,7 +874,7 @@ complete_conflict(svn_skel_t *conflict,
SVN_ERR(svn_wc__conflict_skel_is_complete(&is_complete, conflict));
if (is_complete)
- return SVN_NO_ERROR; /* Already competed */
+ return SVN_NO_ERROR; /* Already completed */
if (old_repos_relpath)
src_left_version = svn_wc_conflict_version_create2(eb->repos_root,
@@ -5077,10 +5077,10 @@ svn_wc__check_wc_root(svn_boolean_t *wc_
}
svn_error_t *
-svn_wc_is_wc_root2(svn_boolean_t *wc_root,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *scratch_pool)
+svn_wc__internal_is_wc_root(svn_boolean_t *wc_root,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool)
{
svn_boolean_t is_root;
svn_boolean_t is_switched;
@@ -5089,7 +5089,7 @@ svn_wc_is_wc_root2(svn_boolean_t *wc_roo
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
err = svn_wc__check_wc_root(&is_root, &kind, &is_switched,
- wc_ctx->db, local_abspath, scratch_pool);
+ db, local_abspath, scratch_pool);
if (err)
{
@@ -5105,6 +5105,16 @@ svn_wc_is_wc_root2(svn_boolean_t *wc_roo
return SVN_NO_ERROR;
}
+svn_error_t *
+svn_wc_is_wc_root2(svn_boolean_t *wc_root,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool)
+{
+ return svn_error_trace(svn_wc__internal_is_wc_root(wc_root, wc_ctx->db,
+ local_abspath,
+ scratch_pool));
+}
svn_error_t*
svn_wc__strictly_is_wc_root(svn_boolean_t *wc_root,
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/upgrade.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/upgrade.c Mon Dec 24 22:47:14 2012
@@ -1892,6 +1892,9 @@ svn_wc__upgrade_sdb(int *result_format,
*result_format = XXX;
/* FALLTHROUGH */
#endif
+ case SVN_WC__VERSION:
+ /* already upgraded */
+ *result_format = SVN_WC__VERSION;
}
#ifdef SVN_DEBUG
@@ -2019,7 +2022,7 @@ is_old_wcroot(const char *local_abspath,
{
return svn_error_createf(
SVN_ERR_WC_INVALID_OP_ON_CWD, err,
- _("Can't upgrade '%s' as it is not a pre-1.7 working copy directory"),
+ _("Can't upgrade '%s' as it is not a working copy"),
svn_dirent_local_style(local_abspath, scratch_pool));
}
else if (svn_dirent_is_root(local_abspath, strlen(local_abspath)))
@@ -2068,7 +2071,7 @@ is_old_wcroot(const char *local_abspath,
return svn_error_createf(
SVN_ERR_WC_INVALID_OP_ON_CWD, NULL,
- _("Can't upgrade '%s' as it is not a pre-1.7 working copy root,"
+ _("Can't upgrade '%s' as it is not a working copy root,"
" the root is '%s'"),
svn_dirent_local_style(local_abspath, scratch_pool),
svn_dirent_local_style(parent_abspath, scratch_pool));
@@ -2128,6 +2131,34 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
apr_hash_t *entries;
const char *root_adm_abspath;
upgrade_working_copy_baton_t cb_baton;
+ svn_error_t *err;
+ int result_format;
+
+ /* Try upgrading a wc-ng-style working copy. */
+ SVN_ERR(svn_wc__db_open(&db, NULL /* ### config */, TRUE, FALSE,
+ scratch_pool, scratch_pool));
+
+ err = svn_wc__db_bump_format(&result_format, local_abspath, db,
+ scratch_pool);
+ if (err)
+ {
+ if (err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED) /* pre-1.7 WC */
+ {
+ svn_error_clear(err);
+ SVN_ERR(svn_wc__db_close(db));
+ }
+ else
+ return svn_error_trace(err);
+ }
+ else
+ {
+ /* Auto-upgrade worked! */
+ SVN_ERR(svn_wc__db_close(db));
+
+ SVN_ERR_ASSERT(result_format == SVN_WC__VERSION);
+
+ return SVN_NO_ERROR;
+ }
SVN_ERR(is_old_wcroot(local_abspath, scratch_pool));
@@ -2141,7 +2172,7 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
upgrade. */
SVN_ERR(svn_wc__db_open(&db,
- NULL /* ### config */, FALSE, FALSE,
+ NULL /* ### config */, TRUE, FALSE,
scratch_pool, scratch_pool));
SVN_ERR(svn_wc__read_entries_old(&entries, local_abspath,
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/util.c?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/util.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/util.c Mon Dec 24 22:47:14 2012
@@ -469,7 +469,7 @@ svn_wc__status2_from_3(svn_wc_status2_t
/* (Currently a no-op, but just make sure it is ok) */
if (old_status->repos_node_status == svn_wc_status_modified
|| old_status->repos_node_status == svn_wc_status_conflicted)
- (*status)->text_status = old_status->repos_text_status;
+ (*status)->repos_text_status = old_status->repos_text_status;
if (old_status->node_status == svn_wc_status_added)
(*status)->prop_status = svn_wc_status_none; /* No separate info */
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/wc.h?rev=1425690&r1=1425689&r2=1425690&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/wc.h Mon Dec 24 22:47:14 2012
@@ -640,6 +640,31 @@ svn_wc__internal_get_repos_info(const ch
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/* Internal version of svn_wc__node_get_repos_relpath() */
+svn_error_t *
+svn_wc__internal_get_repos_relpath(const char **repos_relpath,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Internal version of svn_wc__get_iprops() */
+svn_error_t *
+svn_wc__internal_get_iprops(apr_array_header_t **inherited_props,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ const char *propname,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Internal version of svn_wc_is_wc_root2() */
+svn_error_t *
+svn_wc__internal_is_wc_root(svn_boolean_t *wc_root,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool);
+
+
/* Upgrade the wc sqlite database given in SDB for the wc located at
WCROOT_ABSPATH. It's current/starting format is given by START_FORMAT.
After the upgrade is complete (to as far as the automatic upgrade will