You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/11/23 02:12:45 UTC
svn commit: r1412731 [5/10] - in /subversion/branches/ev2-export: ./ build/
build/ac-macros/ contrib/client-side/svnmerge/
contrib/server-side/svncutter/ notes/ subversion/
subversion/bindings/javahl/native/ subversion/bindings/swig/perl/native/
subver...
Modified: subversion/branches/ev2-export/subversion/libsvn_subr/utf_width.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/utf_width.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/utf_width.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/utf_width.c Fri Nov 23 01:12:18 2012
@@ -67,16 +67,16 @@
#include "svn_private_config.h"
struct interval {
- int first;
- int last;
+ apr_uint32_t first;
+ apr_uint32_t last;
};
/* auxiliary function for binary search in interval table */
static int
-bisearch(apr_uint32_t ucs, const struct interval *table, int max)
+bisearch(apr_uint32_t ucs, const struct interval *table, apr_uint32_t max)
{
- int min = 0;
- int mid;
+ apr_uint32_t min = 0;
+ apr_uint32_t mid;
if (ucs < table[0].first || ucs > table[max].last)
return 0;
@@ -85,7 +85,7 @@ bisearch(apr_uint32_t ucs, const struct
if (ucs > table[mid].last)
min = mid + 1;
else if (ucs < table[mid].first)
- max = mid - 1;
+ max = mid - 1; /* this is safe because ucs >= table[0].first */
else
return 1;
}
Modified: subversion/branches/ev2-export/subversion/libsvn_subr/win32_crashrpt.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/win32_crashrpt.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/win32_crashrpt.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/win32_crashrpt.c Fri Nov 23 01:12:18 2012
@@ -46,6 +46,12 @@ HANDLE dbghelp_dll = INVALID_HANDLE_VALU
#define LOGFILE_PREFIX "svn-crash-log"
+#if defined(_M_IX86)
+#define FORMAT_PTR "0x%08x"
+#elif defined(_M_X64)
+#define FORMAT_PTR "0x%016I64x"
+#endif
+
/*** Code. ***/
/* Convert a wide-character string to utf-8. This function will create a buffer
@@ -158,7 +164,7 @@ write_module_info_callback(void *data,
MINIDUMP_MODULE_CALLBACK module = callback_input->Module;
char *buf = convert_wbcs_to_utf8(module.FullPath);
- fprintf(log_file, "0x%08x", module.BaseOfImage);
+ fprintf(log_file, FORMAT_PTR, module.BaseOfImage);
fprintf(log_file, " %s", buf);
free(buf);
@@ -268,9 +274,9 @@ format_basic_type(char *buf, DWORD basic
case 2: /* btChar */
{
if (!IsBadStringPtr(*(PSTR*)address, 32))
- sprintf(buf, "\"%.31s\"", *(unsigned long *)address);
+ sprintf(buf, "\"%.31s\"", *(const char **)address);
else
- sprintf(buf, "0x%08x", (int)*(unsigned long *)address);
+ sprintf(buf, FORMAT_PTR, *(DWORD_PTR *)address);
}
case 6: /* btInt */
sprintf(buf, "%d", *(int *)address);
@@ -279,7 +285,7 @@ format_basic_type(char *buf, DWORD basic
sprintf(buf, "%f", *(float *)address);
break;
default:
- sprintf(buf, "0x%08x", *(unsigned long *)address);
+ sprintf(buf, FORMAT_PTR, *(DWORD_PTR *)address);
break;
}
break;
@@ -290,7 +296,8 @@ format_basic_type(char *buf, DWORD basic
sprintf(buf, "0x%016I64X", *(unsigned __int64 *)address);
break;
default:
- sprintf(buf, "[unhandled type 0x%08x of length 0x%08x]", basic_type, length);
+ sprintf(buf, "[unhandled type 0x%08x of length " FORMAT_PTR "]",
+ basic_type, length);
break;
}
}
@@ -328,14 +335,14 @@ format_value(char *value_str, DWORD64 mo
LocalFree(type_name_wbcs);
if (ptr == 0)
- sprintf(value_str, "(%s) 0x%08x",
- type_name, (DWORD *)value_addr);
+ sprintf(value_str, "(%s) " FORMAT_PTR,
+ type_name, (DWORD_PTR *)value_addr);
else if (ptr == 1)
- sprintf(value_str, "(%s *) 0x%08x",
- type_name, *(DWORD *)value_addr);
+ sprintf(value_str, "(%s *) " FORMAT_PTR,
+ type_name, *(DWORD_PTR *)value_addr);
else
- sprintf(value_str, "(%s **) 0x%08x",
- type_name, *(DWORD *)value_addr);
+ sprintf(value_str, "(%s **) " FORMAT_PTR,
+ type_name, *(DWORD_PTR *)value_addr);
free(type_name);
}
@@ -352,12 +359,12 @@ format_value(char *value_str, DWORD64 mo
/* print a char * as a string */
if (ptr == 1 && length == 1)
{
- sprintf(value_str, "0x%08x \"%s\"",
- *(DWORD *)value_addr, (char *)*(DWORD*)value_addr);
+ sprintf(value_str, FORMAT_PTR " \"%s\"",
+ *(DWORD_PTR *)value_addr, *(const char **)value_addr);
}
else if (ptr >= 1)
{
- sprintf(value_str, "0x%08x", *(DWORD *)value_addr);
+ sprintf(value_str, FORMAT_PTR, *(DWORD_PTR *)value_addr);
}
else if (SymGetTypeInfo_(proc, mod_base, type, TI_GET_BASETYPE, &bt))
{
@@ -366,10 +373,10 @@ format_value(char *value_str, DWORD64 mo
}
break;
case 12: /* SymTagEnum */
- sprintf(value_str, "%d", *(DWORD *)value_addr);
+ sprintf(value_str, "%d", *(DWORD_PTR *)value_addr);
break;
case 13: /* SymTagFunctionType */
- sprintf(value_str, "0x%08x", *(DWORD *)value_addr);
+ sprintf(value_str, FORMAT_PTR, *(DWORD_PTR *)value_addr);
break;
default:
sprintf(value_str, "[unhandled tag: %d]", tag);
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/adm_files.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/adm_files.c Fri Nov 23 01:12:18 2012
@@ -403,6 +403,9 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
apr_pool_t *scratch_pool)
{
int format;
+ const char *original_repos_relpath;
+ const char *original_root_url;
+ svn_boolean_t is_op_root;
const char *repos_relpath = svn_uri_skip_ancestor(repos_root_url, url,
scratch_pool);
svn_wc__db_status_t status;
@@ -428,9 +431,10 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
SVN_ERR(svn_wc__db_read_info(&status, NULL,
&db_revision, &db_repos_relpath,
&db_repos_root_url, &db_repos_uuid,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ &original_repos_relpath, &original_root_url,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, &is_op_root, NULL, NULL,
NULL, NULL, NULL,
db, local_abspath, scratch_pool, scratch_pool));
@@ -469,26 +473,17 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
/* The caller gives us a URL which should match the entry. However,
some callers compensate for an old problem in entry->url and pass
- the copyfrom_url instead. See ^/notes/api-errata/wc002.txt. As
+ the copyfrom_url instead. See ^/notes/api-errata/1.7/wc002.txt. As
a result, we allow the passed URL to match copyfrom_url if it
does not match the entry's primary URL. */
- /* ### comparing URLs, should they be canonicalized first? */
if (strcmp(db_repos_uuid, repos_uuid)
|| strcmp(db_repos_root_url, repos_root_url)
|| !svn_relpath_skip_ancestor(db_repos_relpath, repos_relpath))
{
- const char *copyfrom_root_url, *copyfrom_repos_relpath;
-
- SVN_ERR(svn_wc__internal_get_copyfrom_info(©from_root_url,
- ©from_repos_relpath,
- NULL, NULL, NULL,
- db, local_abspath,
- scratch_pool,
- scratch_pool));
-
- if (copyfrom_root_url == NULL
- || strcmp(copyfrom_root_url, repos_root_url)
- || strcmp(copyfrom_repos_relpath, repos_relpath))
+ if (!is_op_root /* copy_from was set on op-roots only */
+ || original_root_url == NULL
+ || strcmp(original_root_url, repos_root_url)
+ || strcmp(original_repos_relpath, repos_relpath))
return
svn_error_createf(SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
_("URL '%s' (uuid: '%s') doesn't match existing "
@@ -592,7 +587,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/ev2-export/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/adm_ops.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/adm_ops.c Fri Nov 23 01:12:18 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. */
@@ -2330,6 +2330,11 @@ svn_wc__internal_remove_from_revision_co
SVN_ERR(svn_wc__db_is_wcroot(&is_root, db, local_abspath, scratch_pool));
+ SVN_ERR(svn_wc__write_check(db, is_root ? local_abspath
+ : svn_dirent_dirname(local_abspath,
+ scratch_pool),
+ scratch_pool));
+
SVN_ERR(svn_wc__db_op_remove_node(&left_something,
db, local_abspath,
destroy_wf /* destroy_wc */,
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/cleanup.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/cleanup.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/cleanup.c Fri Nov 23 01:12:18 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/ev2-export/subversion/libsvn_wc/context.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/context.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/context.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/context.c Fri Nov 23 01:12:18 2012
@@ -70,7 +70,7 @@ svn_wc_context_create(svn_wc_context_t *
* we need to make it writable */
ctx->state_pool = result_pool;
SVN_ERR(svn_wc__db_open(&ctx->db, (svn_config_t *)config,
- TRUE, TRUE, ctx->state_pool, scratch_pool));
+ 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/ev2-export/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/copy.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/copy.c Fri Nov 23 01:12:18 2012
@@ -618,14 +618,26 @@ copy_or_move(svn_wc_context_t *wc_ctx,
break;
}
- SVN_ERR(svn_wc__db_read_info(&dstdir_status, NULL, NULL, NULL,
- &dst_repos_root_url, &dst_repos_uuid, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL,
- db, dstdir_abspath,
- scratch_pool, scratch_pool));
+ err = svn_wc__db_read_info(&dstdir_status, NULL, NULL, NULL,
+ &dst_repos_root_url, &dst_repos_uuid, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ db, dstdir_abspath,
+ scratch_pool, scratch_pool);
+
+ if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+ {
+ /* An unversioned destination directory exists on disk. */
+ svn_error_clear(err);
+ return svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, NULL,
+ _("'%s' is not under version control"),
+ svn_dirent_local_style(dstdir_abspath,
+ scratch_pool));
+ }
+ else
+ SVN_ERR(err);
/* Do this now, as we know the right data is cached */
SVN_ERR(svn_wc__db_get_wcroot(&dst_wcroot_abspath, db, dstdir_abspath,
@@ -795,6 +807,11 @@ svn_wc_copy3(svn_wc_context_t *wc_ctx,
void *notify_baton,
apr_pool_t *scratch_pool)
{
+ /* Verify that we have the required write lock. */
+ SVN_ERR(svn_wc__write_check(wc_ctx->db,
+ svn_dirent_dirname(dst_abspath, scratch_pool),
+ scratch_pool));
+
return svn_error_trace(copy_or_move(wc_ctx, src_abspath, dst_abspath,
metadata_only, FALSE /* is_move */,
TRUE /* allow_mixed_revisions */,
@@ -931,6 +948,14 @@ svn_wc__move2(svn_wc_context_t *wc_ctx,
{
svn_wc__db_t *db = wc_ctx->db;
+ /* Verify that we have the required write locks. */
+ SVN_ERR(svn_wc__write_check(wc_ctx->db,
+ svn_dirent_dirname(src_abspath, scratch_pool),
+ scratch_pool));
+ SVN_ERR(svn_wc__write_check(wc_ctx->db,
+ svn_dirent_dirname(dst_abspath, scratch_pool),
+ scratch_pool));
+
SVN_ERR(copy_or_move(wc_ctx, src_abspath, dst_abspath,
TRUE /* metadata_only */,
TRUE /* is_move */,
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/externals.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/externals.c Fri Nov 23 01:12:18 2012
@@ -163,13 +163,18 @@ svn_wc_parse_externals_description3(apr_
svn_boolean_t canonicalize_url,
apr_pool_t *pool)
{
- apr_array_header_t *lines = svn_cstring_split(desc, "\n\r", TRUE, pool);
int i;
+ unsigned int len;
+ apr_array_header_t *externals = NULL;
+ apr_array_header_t *lines = svn_cstring_split(desc, "\n\r", TRUE, pool);
+ apr_hash_t *duplicate_check = apr_hash_make(pool);
const char *parent_directory_display = svn_path_is_url(parent_directory) ?
parent_directory : svn_dirent_local_style(parent_directory, pool);
+ /* If an error occurs halfway through parsing, *externals_p should stay
+ * untouched. So, store the list in a local var first. */
if (externals_p)
- *externals_p = apr_array_make(pool, 1, sizeof(svn_wc_external_item2_t *));
+ externals = apr_array_make(pool, 1, sizeof(svn_wc_external_item2_t *));
for (i = 0; i < lines->nelts; i++)
{
@@ -327,10 +332,28 @@ svn_wc_parse_externals_description3(apr_
item->url = svn_dirent_canonicalize(item->url, pool);
}
- if (externals_p)
- APR_ARRAY_PUSH(*externals_p, svn_wc_external_item2_t *) = item;
+ /* Has the same WC target path already been mentioned in this prop? */
+ len = apr_hash_count(duplicate_check);
+ apr_hash_set(duplicate_check, item->target_dir, APR_HASH_KEY_STRING, "");
+ if (len == apr_hash_count(duplicate_check))
+ {
+ /* Hashtable length is unchanged. This must be a duplicate. */
+ return svn_error_createf
+ (SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION, NULL,
+ _("Invalid %s property on '%s': "
+ "target '%s' appears more than once"),
+ SVN_PROP_EXTERNALS,
+ parent_directory_display,
+ item->target_dir);
+ }
+
+ if (externals)
+ APR_ARRAY_PUSH(externals, svn_wc_external_item2_t *) = item;
}
+ if (externals_p)
+ *externals_p = externals;
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/info.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/info.c Fri Nov 23 01:12:18 2012
@@ -94,6 +94,7 @@ build_info_for_node(svn_wc__info2_t **in
svn_boolean_t conflicted;
svn_boolean_t op_root;
svn_boolean_t have_base;
+ svn_boolean_t have_more_work;
svn_wc_info_t *wc_info;
tmpinfo = apr_pcalloc(result_pool, sizeof(*tmpinfo));
@@ -118,7 +119,7 @@ build_info_for_node(svn_wc__info2_t **in
&wc_info->recorded_time,
&wc_info->changelist,
&conflicted, &op_root, NULL, NULL,
- &have_base, NULL, NULL,
+ &have_base, &have_more_work, NULL,
db, local_abspath,
result_pool, scratch_pool));
@@ -188,9 +189,30 @@ build_info_for_node(svn_wc__info2_t **in
/* ### We should be able to avoid both these calls with the information
from read_info() in most cases */
- SVN_ERR(svn_wc__internal_node_get_schedule(&wc_info->schedule, NULL,
- db, local_abspath,
- scratch_pool));
+ if (! op_root)
+ wc_info->schedule = svn_wc_schedule_normal;
+ else if (! have_more_work && ! have_base)
+ wc_info->schedule = svn_wc_schedule_add;
+ else
+ {
+ svn_wc__db_status_t below_working;
+ svn_boolean_t have_work;
+
+ SVN_ERR(svn_wc__db_info_below_working(&have_base, &have_work,
+ &below_working,
+ db, local_abspath,
+ scratch_pool));
+
+ /* If the node is not present or deleted (read: not present
+ in working), then the node is not a replacement */
+ if (below_working != svn_wc__db_status_not_present
+ && below_working != svn_wc__db_status_deleted)
+ {
+ wc_info->schedule = svn_wc_schedule_replace;
+ }
+ else
+ wc_info->schedule = svn_wc_schedule_add;
+ }
SVN_ERR(svn_wc__db_read_url(&tmpinfo->URL, db, local_abspath,
result_pool, scratch_pool));
}
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/lock.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/lock.c Fri Nov 23 01:12:18 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)
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/node.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/node.c Fri Nov 23 01:12:18 2012
@@ -426,149 +426,6 @@ svn_wc__node_get_repos_relpath(const cha
scratch_pool));
}
-svn_error_t *
-svn_wc__internal_get_copyfrom_info(const char **copyfrom_root_url,
- const char **copyfrom_repos_relpath,
- const char **copyfrom_url,
- svn_revnum_t *copyfrom_rev,
- svn_boolean_t *is_copy_target,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- const char *original_root_url;
- const char *original_repos_relpath;
- svn_revnum_t original_revision;
- svn_wc__db_status_t status;
-
- if (copyfrom_root_url)
- *copyfrom_root_url = NULL;
- if (copyfrom_repos_relpath)
- *copyfrom_repos_relpath = NULL;
- if (copyfrom_url)
- *copyfrom_url = NULL;
- if (copyfrom_rev)
- *copyfrom_rev = SVN_INVALID_REVNUM;
- if (is_copy_target)
- *is_copy_target = FALSE;
-
- SVN_ERR(svn_wc__db_read_info(&status, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL,
- &original_repos_relpath,
- &original_root_url, NULL,
- &original_revision,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL,
- db, local_abspath, result_pool, scratch_pool));
- if (original_root_url && original_repos_relpath)
- {
- /* If this was the root of the copy then the URL is immediately
- available... */
- const char *my_copyfrom_url;
-
- if (copyfrom_url || is_copy_target)
- my_copyfrom_url = svn_path_url_add_component2(original_root_url,
- original_repos_relpath,
- result_pool);
-
- if (copyfrom_root_url)
- *copyfrom_root_url = original_root_url;
- if (copyfrom_repos_relpath)
- *copyfrom_repos_relpath = original_repos_relpath;
- if (copyfrom_url)
- *copyfrom_url = my_copyfrom_url;
-
- if (copyfrom_rev)
- *copyfrom_rev = original_revision;
-
- if (is_copy_target)
- {
- /* ### At this point we'd just set is_copy_target to TRUE, *but* we
- * currently want to model wc-1 behaviour. Particularly, this
- * affects mixed-revision copies (e.g. wc-wc copy):
- * - Wc-1 saw only the root of a mixed-revision copy as the copy's
- * root.
- * - Wc-ng returns an explicit original_root_url,
- * original_repos_relpath pair for each subtree with mismatching
- * revision.
- * We need to compensate for that: Find out if the parent of
- * this node is also copied and has a matching copy_from URL. If so,
- * nevermind the revision, just like wc-1 did, and say this was not
- * a separate copy target. */
- const char *parent_abspath;
- const char *base_name;
- const char *parent_copyfrom_url;
-
- svn_dirent_split(&parent_abspath, &base_name, local_abspath,
- scratch_pool);
-
- /* This is a copied node, so we should never fall off the top of a
- * working copy here. */
- SVN_ERR(svn_wc__internal_get_copyfrom_info(NULL, NULL,
- &parent_copyfrom_url,
- NULL, NULL,
- db, parent_abspath,
- scratch_pool,
- scratch_pool));
-
- /* So, count this as a separate copy target only if the URLs
- * don't match up, or if the parent isn't copied at all. */
- if (parent_copyfrom_url == NULL
- || strcmp(my_copyfrom_url,
- svn_path_url_add_component2(parent_copyfrom_url,
- base_name,
- scratch_pool)) != 0)
- *is_copy_target = TRUE;
- }
- }
- else if ((status == svn_wc__db_status_added)
- && (copyfrom_rev || copyfrom_url || copyfrom_root_url
- || copyfrom_repos_relpath))
- {
- /* ...But if this is merely the descendant of an explicitly
- copied/moved directory, we need to do a bit more work to
- determine copyfrom_url and copyfrom_rev. */
- const char *op_root_abspath;
-
- SVN_ERR(svn_wc__db_scan_addition(&status, &op_root_abspath, NULL, NULL,
- NULL, &original_repos_relpath,
- &original_root_url, NULL,
- &original_revision, NULL, NULL, db,
- local_abspath, result_pool, scratch_pool));
- if (status == svn_wc__db_status_copied ||
- status == svn_wc__db_status_moved_here)
- {
- const char *src_parent_url;
- const char *src_relpath;
-
- src_parent_url = svn_path_url_add_component2(original_root_url,
- original_repos_relpath,
- scratch_pool);
- src_relpath = svn_dirent_is_child(op_root_abspath, local_abspath,
- scratch_pool);
- if (src_relpath)
- {
- if (copyfrom_root_url)
- *copyfrom_root_url = original_root_url;
- if (copyfrom_repos_relpath)
- *copyfrom_repos_relpath = svn_relpath_join(
- original_repos_relpath,
- src_relpath, result_pool);
- if (copyfrom_url)
- *copyfrom_url = svn_path_url_add_component2(src_parent_url,
- src_relpath,
- result_pool);
- if (copyfrom_rev)
- *copyfrom_rev = original_revision;
- }
- }
- }
-
- return SVN_NO_ERROR;
-}
-
-
/* A recursive node-walker, helper for svn_wc__internal_walk_children().
*
* Call WALK_CALLBACK with WALK_BATON on all children (recursively) of
@@ -939,134 +796,6 @@ svn_wc__node_get_pre_ng_status_data(svn_
return SVN_NO_ERROR;
}
-
-svn_error_t *
-svn_wc__internal_get_commit_base(svn_revnum_t *commit_base_revision,
- const char **repos_relpath,
- const char **repos_root_url,
- const char **repos_uuid,
- 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_boolean_t have_more_work;
- svn_revnum_t revision;
- svn_revnum_t orig_revision;
- const char *orig_repos_relpath;
- const char *orig_repos_root_url;
- const char *orig_repos_uuid;
-
- *commit_base_revision = SVN_INVALID_REVNUM;
-
- SVN_ERR(svn_wc__db_read_info(&status, NULL,
- &revision, repos_relpath,
- repos_root_url, repos_uuid,
- NULL, NULL, NULL, NULL, NULL, NULL,
- &orig_repos_relpath, &orig_repos_root_url,
- &orig_repos_uuid, &orig_revision,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- &have_base, &have_more_work, NULL,
- db, local_abspath, scratch_pool, scratch_pool));
-
- if (SVN_IS_VALID_REVNUM(revision))
- {
- /* We are looking directly at BASE */
- if (commit_base_revision)
- *commit_base_revision = revision;
- return SVN_NO_ERROR;
- }
- else if (SVN_IS_VALID_REVNUM(orig_revision))
- {
- /* We are looking at a copied node */
- if (commit_base_revision)
- *commit_base_revision = orig_revision;
- if (repos_relpath)
- *repos_relpath = orig_repos_relpath;
- if (repos_root_url)
- *repos_root_url = orig_repos_root_url;
- if (repos_uuid)
- *repos_uuid = orig_repos_uuid;
- return SVN_NO_ERROR;
- }
-
- if (status == svn_wc__db_status_added)
- {
- /* If the node was copied/moved-here, return the copy/move source
- revision (not this node's base revision). */
- SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL,
- repos_relpath, repos_root_url,
- repos_uuid, commit_base_revision,
- NULL, NULL, db, local_abspath,
- scratch_pool, scratch_pool));
-
-
- if (SVN_IS_VALID_REVNUM(*commit_base_revision))
- return SVN_NO_ERROR;
- /* Fall through to handle simple replacements */
- }
- else if (status == svn_wc__db_status_deleted)
- {
- const char *work_del_abspath;
-
- SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
- &work_del_abspath, NULL,
- db, local_abspath,
- scratch_pool, scratch_pool));
- if (work_del_abspath != NULL)
- {
- /* This is a deletion within a copied subtree. Get the copied-from
- * revision. */
- SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL,
- repos_relpath, repos_root_url,
- repos_uuid, commit_base_revision,
- NULL, NULL, db,
- svn_dirent_dirname(work_del_abspath,
- scratch_pool),
- scratch_pool, scratch_pool));
-
- SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(*commit_base_revision));
-
- return SVN_NO_ERROR;
- }
- /* else deletion of BASE node, fall through */
- }
-
- /* Catch replacement by local addition and deleted BASE nodes. */
- if (have_base && !have_more_work)
- {
- SVN_ERR(svn_wc__db_base_get_info(&status, NULL, commit_base_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 (status == svn_wc__db_status_not_present)
- *commit_base_revision = SVN_INVALID_REVNUM; /* No replacement */
- }
-
- return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_wc__node_get_commit_base(svn_revnum_t *revision,
- const char **repos_relpath,
- const char **repos_root_url,
- const char **repos_uuid,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- return svn_error_trace(svn_wc__internal_get_commit_base(
- revision, repos_relpath, repos_root_url, repos_uuid,
- wc_ctx->db, local_abspath,
- result_pool, scratch_pool));
-}
-
svn_error_t *
svn_wc__node_get_lock_info(const char **lock_token,
const char **lock_owner,
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/props.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/props.c Fri Nov 23 01:12:18 2012
@@ -2390,22 +2390,15 @@ svn_wc__internal_get_iprops(apr_array_he
if (is_wc_root)
{
- const char *child_repos_relpath;
-
- 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, db,
- parent_abspath,
- scratch_pool,
- iterpool));
- }
+ definition there are no inheritable properties to be had,
+ but checking for that is just as expensive as fetching them
+ anyway. */
+
+ /* Grab the cached inherited properties for the WC root. */
+ SVN_ERR(svn_wc__db_read_cached_iprops(&cached_iprops, db,
+ parent_abspath,
+ scratch_pool, iterpool));
}
/* If PARENT_ABSPATH is a true parent of LOCAL_ABSPATH, then
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/status.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/status.c Fri Nov 23 01:12:18 2012
@@ -252,14 +252,15 @@ read_info(const struct svn_wc__db_info_t
{
struct svn_wc__db_info_t *mtb = apr_pcalloc(result_pool, sizeof(*mtb));
const svn_checksum_t *checksum;
+ const char *original_repos_relpath;
SVN_ERR(svn_wc__db_read_info(&mtb->status, &mtb->kind,
&mtb->revnum, &mtb->repos_relpath,
&mtb->repos_root_url, &mtb->repos_uuid,
&mtb->changed_rev, &mtb->changed_date,
&mtb->changed_author, &mtb->depth,
- &checksum, NULL, NULL, NULL, NULL,
- NULL, &mtb->lock, &mtb->recorded_size,
+ &checksum, NULL, &original_repos_relpath, NULL,
+ NULL, NULL, &mtb->lock, &mtb->recorded_size,
&mtb->recorded_mod_time, &mtb->changelist,
&mtb->conflicted, &mtb->op_root,
&mtb->had_props, &mtb->props_mod,
@@ -358,6 +359,7 @@ read_info(const struct svn_wc__db_info_t
}
mtb->has_checksum = (checksum != NULL);
+ mtb->copied = (original_repos_relpath != NULL);
#ifdef HAVE_SYMLINK
if (mtb->kind == svn_kind_file
@@ -676,27 +678,33 @@ assemble_status(svn_wc_status3_t **statu
override a C text status.*/
if (info->status == svn_wc__db_status_added)
{
+ copied = info->copied;
if (!info->op_root)
- copied = TRUE; /* And keep status normal */
- else if (info->kind == svn_kind_file
- && !info->have_base && !info->have_more_work)
+ { /* Keep status normal */ }
+ else if (!info->have_base && !info->have_more_work)
{
/* Simple addition or copy, no replacement */
node_status = svn_wc_status_added;
- /* If an added node has a pristine file, it was copied */
- copied = info->has_checksum;
}
else
{
- svn_wc_schedule_t schedule;
- SVN_ERR(svn_wc__internal_node_get_schedule(&schedule, &copied,
- db, local_abspath,
- scratch_pool));
+ svn_wc__db_status_t below_working;
+ svn_boolean_t have_base, have_work;
- if (schedule == svn_wc_schedule_add)
+ SVN_ERR(svn_wc__db_info_below_working(&have_base, &have_work,
+ &below_working,
+ db, local_abspath,
+ scratch_pool));
+
+ /* If the node is not present or deleted (read: not present
+ in working), then the node is not a replacement */
+ if (below_working != svn_wc__db_status_not_present
+ && below_working != svn_wc__db_status_deleted)
+ {
+ node_status = svn_wc_status_replaced;
+ }
+ else
node_status = svn_wc_status_added;
- else if (schedule == svn_wc_schedule_replace)
- node_status = svn_wc_status_replaced;
}
/* Get moved-from info (only for potential op-roots of a move). */
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/update_editor.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/update_editor.c Fri Nov 23 01:12:18 2012
@@ -765,6 +765,10 @@ struct file_baton
initialized, this is never NULL, but it may have zero elements. */
apr_array_header_t *propchanges;
+ /* For existing files, whether there are local modifications. FALSE for added
+ files */
+ svn_boolean_t local_prop_mods;
+
/* Bump information for the directory this file lives in */
struct bump_dir_info *bump_info;
@@ -3283,7 +3287,7 @@ open_file(const char *path,
&fb->changed_author, NULL,
&fb->original_checksum, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
- &conflicted, NULL, NULL, NULL,
+ &conflicted, NULL, NULL, &fb->local_prop_mods,
NULL, NULL, &have_work,
eb->db, fb->local_abspath,
fb->pool, scratch_pool));
@@ -3512,6 +3516,85 @@ change_file_prop(void *file_baton,
if (!fb->edited && svn_property_kind2(name) == svn_prop_regular_kind)
SVN_ERR(mark_file_edited(fb, scratch_pool));
+ if (! fb->shadowed
+ && strcmp(name, SVN_PROP_SPECIAL) == 0)
+ {
+ struct edit_baton *eb = fb->edit_baton;
+ svn_boolean_t modified = FALSE;
+ svn_boolean_t becomes_symlink;
+ svn_boolean_t was_symlink;
+
+ /* Let's see if we have a change as in some scenarios servers report
+ non-changes of properties. */
+ becomes_symlink = (value != NULL);
+
+ if (fb->adding_file)
+ was_symlink = becomes_symlink; /* No change */
+ else
+ {
+ apr_hash_t *props;
+
+ /* We read the server-props, not the ACTUAL props here as we just
+ want to see if this is really an incoming prop change. */
+ SVN_ERR(svn_wc__db_base_get_props(&props, eb->db,
+ fb->local_abspath,
+ scratch_pool, scratch_pool));
+
+ was_symlink = ((props
+ && apr_hash_get(props, SVN_PROP_SPECIAL,
+ APR_HASH_KEY_STRING) != NULL)
+ ? svn_tristate_true
+ : svn_tristate_false);
+ }
+
+ if (was_symlink != becomes_symlink)
+ {
+ /* If the local node was not modified, we continue as usual, if
+ modified we want a tree conflict just like how we would handle
+ it when receiving a delete + add (aka "replace") */
+ if (fb->local_prop_mods)
+ modified = TRUE;
+ else
+ SVN_ERR(svn_wc__internal_file_modified_p(&modified, eb->db,
+ fb->local_abspath,
+ FALSE, scratch_pool));
+ }
+
+ if (modified)
+ {
+ if (!fb->edit_conflict)
+ fb->edit_conflict = svn_wc__conflict_skel_create(fb->pool);
+
+ SVN_ERR(svn_wc__conflict_skel_add_tree_conflict(
+ fb->edit_conflict,
+ eb->db, fb->local_abspath,
+ svn_wc_conflict_reason_edited,
+ svn_wc_conflict_action_replace,
+ fb->pool, scratch_pool));
+
+ SVN_ERR(complete_conflict(fb->edit_conflict, fb->dir_baton,
+ fb->local_abspath, fb->old_repos_relpath,
+ fb->old_revision, svn_node_file,
+ fb->pool, scratch_pool));
+
+ /* Create a copy of the existing (pre update) BASE node in WORKING,
+ mark a tree conflict and handle the rest of the update as
+ shadowed */
+ SVN_ERR(svn_wc__db_op_make_copy(eb->db, fb->local_abspath,
+ fb->edit_conflict, NULL,
+ scratch_pool));
+
+ do_notification(eb, fb->local_abspath, svn_node_file,
+ svn_wc_notify_tree_conflict, scratch_pool);
+
+ /* Ok, we introduced a replacement, so we can now handle the rest
+ as a normal shadowed update */
+ fb->shadowed = TRUE;
+ fb->add_existed = FALSE;
+ fb->already_notified = TRUE;
+ }
+ }
+
return SVN_NO_ERROR;
}
@@ -4016,64 +4099,6 @@ close_file(void *file_baton,
if (current_actual_props == NULL)
current_actual_props = apr_hash_make(scratch_pool);
- /* Catch symlink-ness change.
- * add_file() doesn't know whether the incoming added node is a file or
- * a symlink, because symlink-ness is saved in a prop :(
- * So add_file() cannot notice when update wants to add a symlink where
- * locally there already is a file scheduled for addition, or vice versa.
- * It sees incoming symlinks as simple files and may wrongly try to offer
- * a text conflict. So flag a tree conflict here. */
- if (!fb->shadowed
- && (! fb->adding_file || fb->add_existed))
- {
- svn_boolean_t local_is_link;
- svn_boolean_t incoming_is_link;
- int i;
-
- local_is_link = apr_hash_get(local_actual_props,
- SVN_PROP_SPECIAL,
- APR_HASH_KEY_STRING) != NULL;
-
- incoming_is_link = local_is_link;
-
- /* Does an incoming propchange affect symlink-ness? */
- for (i = 0; i < regular_prop_changes->nelts; ++i)
- {
- const svn_prop_t *prop = &APR_ARRAY_IDX(regular_prop_changes, i,
- svn_prop_t);
-
- if (strcmp(prop->name, SVN_PROP_SPECIAL) == 0)
- {
- incoming_is_link = (prop->value != NULL);
- break;
- }
- }
-
- if (local_is_link != incoming_is_link)
- {
- fb->shadowed = TRUE;
- fb->obstruction_found = TRUE;
- fb->add_existed = FALSE;
-
- if (!conflict_skel)
- conflict_skel = svn_wc__conflict_skel_create(fb->pool);
-
- SVN_ERR(svn_wc__conflict_skel_add_tree_conflict(
- conflict_skel,
- eb->db, fb->local_abspath,
- svn_wc_conflict_reason_added,
- svn_wc_conflict_action_add,
- scratch_pool, scratch_pool));
-
- fb->already_notified = TRUE;
- do_notification(eb, fb->local_abspath, svn_node_unknown,
- svn_wc_notify_tree_conflict, scratch_pool);
-
- /* The update will be applied to PRISTINE, but not to
- the in-working copy node */
- }
- }
-
prop_state = svn_wc_notify_state_unknown;
if (! fb->shadowed)
@@ -5217,9 +5242,9 @@ svn_wc_add_repos_file4(svn_wc_context_t
const char *source_abspath = NULL;
svn_skel_t *all_work_items = NULL;
svn_skel_t *work_item;
- const char *original_root_url;
+ const char *repos_root_url;
+ const char *repos_uuid;
const char *original_repos_relpath;
- const char *original_uuid;
svn_revnum_t changed_rev;
apr_time_t changed_date;
const char *changed_author;
@@ -5256,10 +5281,10 @@ svn_wc_add_repos_file4(svn_wc_context_t
scratch_pool));
}
- SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, &repos_root_url,
+ &repos_uuid, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
db, dir_abspath, scratch_pool, scratch_pool));
switch (status)
@@ -5294,26 +5319,30 @@ svn_wc_add_repos_file4(svn_wc_context_t
{
/* Find the repository_root via the parent directory, which
is always versioned before this function is called */
- SVN_ERR(svn_wc__internal_get_repos_info(&original_root_url,
- &original_uuid,
- wc_ctx->db,
- dir_abspath,
- pool, pool));
+
+ if (!repos_root_url)
+ {
+ /* The parent is an addition, scan upwards to find the right info */
+ SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
+ &repos_root_url, &repos_uuid,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ wc_ctx->db, dir_abspath,
+ scratch_pool, scratch_pool));
+ }
+ SVN_ERR_ASSERT(repos_root_url);
original_repos_relpath =
- svn_uri_skip_ancestor(original_root_url, copyfrom_url, pool);
+ svn_uri_skip_ancestor(repos_root_url, copyfrom_url, scratch_pool);
if (!original_repos_relpath)
return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
_("Copyfrom-url '%s' has different repository"
" root than '%s'"),
- copyfrom_url, original_root_url);
+ copyfrom_url, repos_root_url);
}
else
{
- original_root_url = NULL;
original_repos_relpath = NULL;
- original_uuid = NULL;
copyfrom_rev = SVN_INVALID_REVNUM; /* Just to be sure. */
}
@@ -5450,8 +5479,9 @@ svn_wc_add_repos_file4(svn_wc_context_t
changed_date,
changed_author,
original_repos_relpath,
- original_root_url,
- original_uuid,
+ original_repos_relpath ? repos_root_url
+ : NULL,
+ original_repos_relpath ? repos_uuid : NULL,
copyfrom_rev,
new_text_base_sha1_checksum,
TRUE,
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/upgrade.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/upgrade.c Fri Nov 23 01:12:18 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/ev2-export/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc-metadata.sql?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc-metadata.sql Fri Nov 23 01:12:18 2012
@@ -585,13 +585,14 @@ CREATE UNIQUE INDEX I_EXTERNALS_DEFINED
-- STMT_UPGRADE_TO_20
-UPDATE BASE_NODE SET checksum=(SELECT checksum FROM pristine
- WHERE md5_checksum=BASE_NODE.checksum)
-WHERE EXISTS(SELECT 1 FROM pristine WHERE md5_checksum=BASE_NODE.checksum);
-
-UPDATE WORKING_NODE SET checksum=(SELECT checksum FROM pristine
- WHERE md5_checksum=WORKING_NODE.checksum)
-WHERE EXISTS(SELECT 1 FROM pristine WHERE md5_checksum=WORKING_NODE.checksum);
+UPDATE BASE_NODE SET checksum = (SELECT checksum FROM pristine
+ WHERE md5_checksum = BASE_NODE.checksum)
+WHERE EXISTS (SELECT 1 FROM pristine WHERE md5_checksum = BASE_NODE.checksum);
+
+UPDATE WORKING_NODE SET checksum = (SELECT checksum FROM pristine
+ WHERE md5_checksum = WORKING_NODE.checksum)
+WHERE EXISTS (SELECT 1 FROM pristine
+ WHERE md5_checksum = WORKING_NODE.checksum);
INSERT INTO NODES (
wc_id, local_relpath, op_depth, parent_relpath,
@@ -731,9 +732,9 @@ LIMIT 1
-- STMT_UPGRADE_TO_28
-UPDATE NODES SET checksum=(SELECT checksum FROM pristine
- WHERE md5_checksum=nodes.checksum)
-WHERE EXISTS(SELECT 1 FROM pristine WHERE md5_checksum=nodes.checksum);
+UPDATE NODES SET checksum = (SELECT checksum FROM pristine
+ WHERE md5_checksum = nodes.checksum)
+WHERE EXISTS (SELECT 1 FROM pristine WHERE md5_checksum = nodes.checksum);
PRAGMA user_version = 28;
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc.h?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc.h Fri Nov 23 01:12:18 2012
@@ -576,35 +576,6 @@ svn_wc__internal_node_get_schedule(svn_w
const char *local_abspath,
apr_pool_t *scratch_pool);
-/**
- * Set @a *copyfrom_url to the corresponding copy-from URL (allocated
- * from @a result_pool), and @a copyfrom_rev to the corresponding
- * copy-from revision, of @a local_abspath, using @a db. Set @a
- * is_copy_target to TRUE iff @a local_abspath was the target of a
- * copy information (versus being a member of the subtree beneath such
- * a copy target).
- *
- * @a copyfrom_root_url and @a copyfrom_repos_relpath return the exact same
- * information as @a copyfrom_url, just still separated as root and relpath.
- *
- * If @a local_abspath is not copied, set @a *copyfrom_root_url,
- * @a *copyfrom_repos_relpath and @a copyfrom_url to NULL and
- * @a *copyfrom_rev to @c SVN_INVALID_REVNUM.
- *
- * Any out parameters may be NULL if the caller doesn't care about those
- * values.
- */
-svn_error_t *
-svn_wc__internal_get_copyfrom_info(const char **copyfrom_root_url,
- const char **copyfrom_repos_relpath,
- const char **copyfrom_url,
- svn_revnum_t *copyfrom_rev,
- svn_boolean_t *is_copy_target,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
/* Internal version of svn_wc__node_get_origin() */
svn_error_t *
svn_wc__internal_get_origin(svn_boolean_t *is_copy,
@@ -619,18 +590,6 @@ svn_wc__internal_get_origin(svn_boolean_
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Internal version of svn_wc__node_get_commit_base() */
-svn_error_t *
-svn_wc__internal_get_commit_base(svn_revnum_t *commit_base_revision,
- const char **repos_relpath,
- const char **repos_root_url,
- const char **repos_uuid,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-
/* Internal version of svn_wc__node_get_repos_info() */
svn_error_t *
svn_wc__internal_get_repos_info(const char **repos_root_url,
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c Fri Nov 23 01:12:18 2012
@@ -2074,16 +2074,15 @@ db_base_remove(void *baton,
wcroot, local_relpath,
scratch_pool, scratch_pool));
- /* ### This function should be turned into a helper of this function,
- as this is the only valid caller */
if (status == svn_wc__db_status_normal
&& rb->keep_as_working)
{
- SVN_ERR(svn_wc__db_temp_op_make_copy(rb->db,
- svn_dirent_join(wcroot->abspath,
- local_relpath,
- scratch_pool),
- scratch_pool));
+ SVN_ERR(svn_wc__db_op_make_copy(rb->db,
+ svn_dirent_join(wcroot->abspath,
+ local_relpath,
+ scratch_pool),
+ NULL, NULL,
+ scratch_pool));
keep_working = TRUE;
}
else
@@ -2668,27 +2667,24 @@ svn_wc__db_base_clear_dav_cache_recursiv
}
-
-/* Like svn_wc__db_base_get_info(), but taking WCROOT+LOCAL_RELPATH instead of
- DB+LOCAL_ABSPATH and outputting REPOS_ID instead of URL+UUID. */
-static svn_error_t *
-depth_get_info(svn_wc__db_status_t *status,
- svn_kind_t *kind,
- svn_revnum_t *revision,
- const char **repos_relpath,
- apr_int64_t *repos_id,
- svn_revnum_t *changed_rev,
- apr_time_t *changed_date,
- const char **changed_author,
- svn_depth_t *depth,
- const svn_checksum_t **checksum,
- const char **target,
- svn_boolean_t *had_props,
- svn_wc__db_wcroot_t *wcroot,
- const char *local_relpath,
- int op_depth,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+svn_error_t *
+svn_wc__db_depth_get_info(svn_wc__db_status_t *status,
+ svn_kind_t *kind,
+ svn_revnum_t *revision,
+ const char **repos_relpath,
+ apr_int64_t *repos_id,
+ svn_revnum_t *changed_rev,
+ apr_time_t *changed_date,
+ const char **changed_author,
+ svn_depth_t *depth,
+ const svn_checksum_t **checksum,
+ const char **target,
+ svn_boolean_t *had_props,
+ svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath,
+ int op_depth,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_sqlite__stmt_t *stmt;
svn_boolean_t have_row;
@@ -4176,11 +4172,11 @@ db_op_copy_shadowed_layer(svn_wc__db_wcr
{
svn_error_t *err;
- err = depth_get_info(&status, &kind, &node_revision, &node_repos_relpath,
- &node_repos_id, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL,
- src_wcroot, src_relpath, src_op_depth,
- scratch_pool, scratch_pool);
+ err = svn_wc__db_depth_get_info(&status, &kind, &node_revision,
+ &node_repos_relpath, &node_repos_id,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ src_wcroot, src_relpath, src_op_depth,
+ scratch_pool, scratch_pool);
if (err)
{
@@ -4393,10 +4389,11 @@ op_copy_shadowed_layer_txn(void * baton,
del_op_depth = relpath_depth(ocb->dst_relpath);
/* Get some information from the parent */
- SVN_ERR(depth_get_info(NULL, NULL, &revision, &repos_relpath, &repos_id,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- ocb->src_wcroot, src_parent_relpath, src_op_depth,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_depth_get_info(NULL, NULL, &revision, &repos_relpath,
+ &repos_id, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, ocb->src_wcroot,
+ src_parent_relpath, src_op_depth,
+ scratch_pool, scratch_pool));
if (repos_relpath == NULL)
{
@@ -8060,6 +8057,7 @@ read_children_info(void *baton,
child->recorded_mod_time = svn_sqlite__column_int64(stmt, 13);
child->recorded_size = get_recorded_size(stmt, 7);
child->has_checksum = !svn_sqlite__column_is_null(stmt, 6);
+ child->copied = op_depth > 0 && !svn_sqlite__column_is_null(stmt, 2);
child->had_props = SQLITE_PROPERTIES_AVAILABLE(stmt, 14);
#ifdef HAVE_SYMLINK
if (child->had_props)
@@ -11921,7 +11919,7 @@ svn_wc__db_temp_get_format(int *format,
directory to not be a working copy. */
if (err)
{
- if (err && err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY)
+ if (err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY)
return svn_error_trace(err);
svn_error_clear(err);
@@ -13087,6 +13085,8 @@ svn_wc__db_temp_op_start_directory_updat
struct make_copy_baton_t
{
int op_depth;
+ const svn_skel_t *conflicts;
+ const svn_skel_t *work_items;
};
@@ -13135,6 +13135,7 @@ make_copy_txn(void *baton,
svn_boolean_t add_working_base_deleted = FALSE;
svn_boolean_t remove_working = FALSE;
const apr_array_header_t *children;
+ struct make_copy_baton_t cbt;
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
int i;
@@ -13199,18 +13200,20 @@ make_copy_txn(void *baton,
SVN_ERR(gather_repo_children(&children, wcroot, local_relpath,
0, scratch_pool, iterpool));
+ cbt.op_depth = mcb->op_depth;
+ cbt.conflicts = NULL;
+ cbt.work_items = NULL;
+
for (i = 0; i < children->nelts; i++)
{
const char *name = APR_ARRAY_IDX(children, i, const char *);
- struct make_copy_baton_t cbt;
+
const char *copy_relpath;
svn_pool_clear(iterpool);
copy_relpath = svn_relpath_join(local_relpath, name, iterpool);
- cbt.op_depth = mcb->op_depth;
-
SVN_ERR(make_copy_txn(&cbt, wcroot, copy_relpath, iterpool));
}
@@ -13218,6 +13221,11 @@ make_copy_txn(void *baton,
iterpool),
svn_depth_empty, iterpool));
+ if (mcb->conflicts)
+ SVN_ERR(mark_conflict(wcroot, local_relpath, mcb->conflicts, iterpool));
+
+ SVN_ERR(add_work_items(wcroot->sdb, mcb->work_items, iterpool));
+
svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
@@ -13225,9 +13233,11 @@ make_copy_txn(void *baton,
svn_error_t *
-svn_wc__db_temp_op_make_copy(svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *scratch_pool)
+svn_wc__db_op_make_copy(svn_wc__db_t *db,
+ const char *local_abspath,
+ const svn_skel_t *conflicts,
+ const svn_skel_t *work_items,
+ apr_pool_t *scratch_pool)
{
svn_wc__db_wcroot_t *wcroot;
const char *local_relpath;
@@ -13260,6 +13270,8 @@ svn_wc__db_temp_op_make_copy(svn_wc__db_
SVN_ERR(catch_copy_of_server_excluded(wcroot, local_relpath, scratch_pool));
mcb.op_depth = relpath_depth(local_relpath);
+ mcb.conflicts = conflicts;
+ mcb.work_items = work_items;
SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, make_copy_txn, &mcb,
scratch_pool));
@@ -14025,3 +14037,36 @@ svn_wc__db_verify(svn_wc__db_t *db,
SVN_ERR(verify_wcroot(wcroot, scratch_pool));
return SVN_NO_ERROR;
}
+
+svn_error_t *
+svn_wc__db_bump_format(int *result_format,
+ const char *wcroot_abspath,
+ svn_wc__db_t *db,
+ apr_pool_t *scratch_pool)
+{
+
+ svn_wc__db_wcroot_t *wcroot;
+ const char *local_relpath;
+
+ SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
+ db, wcroot_abspath,
+ scratch_pool, scratch_pool));
+
+ /* This function is indirectly called from the upgrade code, so we
+ can't verify the wcroot here. Just check that it is not NULL */
+ SVN_ERR_ASSERT(wcroot != NULL);
+
+ /* Reject attempts to upgrade subdirectories of a working copy. */
+ if (strcmp(wcroot_abspath, wcroot->abspath) != 0)
+ return svn_error_createf(
+ SVN_ERR_WC_INVALID_OP_ON_CWD, NULL,
+ _("Can't upgrade '%s' as it is not a working copy root,"
+ " the root is '%s'"),
+ svn_dirent_local_style(wcroot_abspath, scratch_pool),
+ svn_dirent_local_style(wcroot->abspath, scratch_pool));
+
+ SVN_ERR(svn_wc__upgrade_sdb(result_format, wcroot->abspath,
+ wcroot->sdb, wcroot->format,
+ scratch_pool));
+ return SVN_NO_ERROR;
+}
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h Fri Nov 23 01:12:18 2012
@@ -134,7 +134,8 @@ typedef enum svn_wc__db_status_t {
svn_wc__db_status_normal,
/* The node has been added (potentially obscuring a delete or move of
- the BASE node; see HAVE_BASE param). The text will be marked as
+ the BASE node; see HAVE_BASE param [### What param? This is an enum
+ not a function.] ). The text will be marked as
modified, and if properties exist, they will be marked as modified.
In many cases svn_wc__db_status_added means any of added, moved-here
@@ -1918,6 +1919,7 @@ struct svn_wc__db_info_t {
svn_boolean_t op_root;
svn_boolean_t has_checksum;
+ svn_boolean_t copied;
svn_boolean_t had_props;
svn_boolean_t props_mod;
@@ -2792,6 +2794,23 @@ svn_wc__db_upgrade_get_repos_id(apr_int6
const char *repos_root_url,
apr_pool_t *scratch_pool);
+/* Upgrade the metadata concerning the WC at WCROOT_ABSPATH, in DB,
+ * to the SVN_WC__VERSION format.
+ *
+ * This function is used for upgrading wc-ng working copies to a newer
+ * wc-ng format. If a pre-1.7 working copy is found, this function
+ * returns SVN_ERR_WC_UPGRADE_REQUIRED.
+ *
+ * Upgrading subdirectories of a working copy is not supported.
+ * If WCROOT_ABSPATH is not a working copy root SVN_ERR_WC_INVALID_OP_ON_CWD
+ * is returned.
+ */
+svn_error_t *
+svn_wc__db_bump_format(int *result_format,
+ const char *wcroot_abspath,
+ svn_wc__db_t *db,
+ apr_pool_t *scratch_pool);
+
/* @} */
@@ -3010,9 +3029,11 @@ svn_wc__db_temp_op_end_directory_update(
leaving any subtree additions and copies as-is. This allows the
base node tree to be removed. */
svn_error_t *
-svn_wc__db_temp_op_make_copy(svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *scratch_pool);
+svn_wc__db_op_make_copy(svn_wc__db_t *db,
+ const char *local_abspath,
+ const svn_skel_t *conflicts,
+ const svn_skel_t *work_items,
+ apr_pool_t *scratch_pool);
/* Close the wc root LOCAL_ABSPATH and remove any per-directory
handles associated with it. */
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h Fri Nov 23 01:12:18 2012
@@ -260,6 +260,27 @@ svn_wc__db_base_get_info_internal(svn_wc
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/* Similar to svn_wc__db_base_get_info(), but taking WCROOT+LOCAL_RELPATH
+ * instead of DB+LOCAL_ABSPATH, an explicit op-depth of the node to get
+ * information about, and outputting REPOS_ID instead of URL+UUID. */
+svn_error_t *
+svn_wc__db_depth_get_info(svn_wc__db_status_t *status,
+ svn_kind_t *kind,
+ svn_revnum_t *revision,
+ const char **repos_relpath,
+ apr_int64_t *repos_id,
+ svn_revnum_t *changed_rev,
+ apr_time_t *changed_date,
+ const char **changed_author,
+ svn_depth_t *depth,
+ const svn_checksum_t **checksum,
+ const char **target,
+ svn_boolean_t *had_props,
+ svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath,
+ int op_depth,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Like svn_wc__db_read_conflict(), but with WCROOT+LOCAL_RELPATH instead of
DB+LOCAL_ABSPATH, and outputting relpaths instead of abspaths. */