You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/09/22 13:35:44 UTC
svn commit: r999881 - in /subversion/branches/atomic-revprop: ./ notes/
subversion/include/ subversion/libsvn_client/ subversion/libsvn_diff/
subversion/libsvn_fs/ subversion/libsvn_subr/ subversion/libsvn_wc/
subversion/mod_dav_svn/ subversion/svn/ su...
Author: danielsh
Date: Wed Sep 22 11:35:43 2010
New Revision: 999881
URL: http://svn.apache.org/viewvc?rev=999881&view=rev
Log:
On the atomic-revprop branch, merge r999426 through r999880 from trunk.
Added:
subversion/branches/atomic-revprop/subversion/tests/cmdline/svnrdump_tests_data/repo-with-copy-of-root-dir.dump
- copied unchanged from r999880, subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/repo-with-copy-of-root-dir.dump
subversion/branches/atomic-revprop/subversion/tests/cmdline/svnrdump_tests_data/tag-trunk-with-file.dump
- copied unchanged from r999880, subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/tag-trunk-with-file.dump
subversion/branches/atomic-revprop/subversion/tests/cmdline/svnrdump_tests_data/tag-trunk-with-file2.dump
- copied unchanged from r999880, subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/tag-trunk-with-file2.dump
Modified:
subversion/branches/atomic-revprop/ (props changed)
subversion/branches/atomic-revprop/notes/subversion-design.html
subversion/branches/atomic-revprop/subversion/include/svn_client.h
subversion/branches/atomic-revprop/subversion/include/svn_wc.h
subversion/branches/atomic-revprop/subversion/libsvn_client/deprecated.c
subversion/branches/atomic-revprop/subversion/libsvn_client/externals.c
subversion/branches/atomic-revprop/subversion/libsvn_client/relocate.c
subversion/branches/atomic-revprop/subversion/libsvn_diff/parse-diff.c
subversion/branches/atomic-revprop/subversion/libsvn_fs/access.c
subversion/branches/atomic-revprop/subversion/libsvn_subr/svn_string.c
subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c
subversion/branches/atomic-revprop/subversion/libsvn_wc/relocate.c
subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-queries.sql
subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c
subversion/branches/atomic-revprop/subversion/mod_dav_svn/version.c
subversion/branches/atomic-revprop/subversion/svn/main.c
subversion/branches/atomic-revprop/subversion/svn/switch-cmd.c
subversion/branches/atomic-revprop/subversion/svnrdump/dump_editor.c
subversion/branches/atomic-revprop/subversion/svnrdump/load_editor.c
subversion/branches/atomic-revprop/subversion/svnserve/cyrus_auth.c
subversion/branches/atomic-revprop/subversion/tests/cmdline/svnrdump_tests.py
subversion/branches/atomic-revprop/subversion/tests/cmdline/switch_tests.py
subversion/branches/atomic-revprop/subversion/tests/libsvn_subr/cache-test.c
subversion/branches/atomic-revprop/subversion/tests/libsvn_subr/target-test.c
subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/db-test.c
Propchange: subversion/branches/atomic-revprop/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 22 11:35:43 2010
@@ -37,4 +37,4 @@
/subversion/branches/tc_url_rev:874351-874483
/subversion/branches/tree-conflicts:868291-873154
/subversion/branches/tree-conflicts-notify:873926-874008
-/subversion/trunk:965046-999425
+/subversion/trunk:965046-999880
Modified: subversion/branches/atomic-revprop/notes/subversion-design.html
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/notes/subversion-design.html?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/notes/subversion-design.html (original)
+++ subversion/branches/atomic-revprop/notes/subversion-design.html Wed Sep 22 11:35:43 2010
@@ -2255,7 +2255,7 @@ write/Makefile:6
<p>For a detailed description of exactly how Greg Stein
<em class="email">gstein@lyra.org</em> is mapping the WebDAV DeltaV spec to
- Subversion, see his paper: <a href="http://svn.apache.org/repos/asf/subversion/trunk/www/webdav-usage.html">http://svn.apache.org/repos/asf/subversion/trunk/www/webdav-usage.html</a>
+ Subversion, see his paper: <a href="http://svn.apache.org/repos/asf/subversion/trunk/notes/http-and-webdav/webdav-usage.html">http://svn.apache.org/repos/asf/subversion/trunk/notes/http-and-webdav/webdav-usage.html</a>
</p>
<p>For more information on WebDAV and the DeltaV extensions, see
Modified: subversion/branches/atomic-revprop/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/include/svn_client.h?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/include/svn_client.h (original)
+++ subversion/branches/atomic-revprop/subversion/include/svn_client.h Wed Sep 22 11:35:43 2010
@@ -3418,18 +3418,35 @@ svn_client_upgrade(const char *dir,
*/
/**
- * Modify a working copy directory @a dir, changing any
- * repository URLs that begin with @a from to begin with @a to instead,
- * recursing into subdirectories if @a recurse is TRUE.
+ * Recursively modify a working copy rooted at @a wcroot_dir, changing any
+ * repository URLs that begin with @a from to begin with @a to instead.
*
- * @param dir Working copy directory
+ * @param wcroot_dir Working copy root directory
* @param from Original URL
* @param to New URL
- * @param recurse Whether to recurse
* @param ctx svn_client_ctx_t
* @param pool The pool from which to perform memory allocations
+ *
+ * @since New in 1.7
*/
svn_error_t *
+svn_client_relocate2(const char *wcroot_dir,
+ const char *from,
+ const char *to,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool);
+
+/**
+ * Similar to svn_client_relocate2().
+ *
+ * @note As of the 1.7 API, @a dir is required to be a working copy
+ * root directory, and @a recurse is required to be TRUE.
+ *
+ * @deprecated Provided for limited backwards compatibility with the
+ * 1.6 API.
+ */
+SVN_DEPRECATED
+svn_error_t *
svn_client_relocate(const char *dir,
const char *from,
const char *to,
@@ -3437,7 +3454,6 @@ svn_client_relocate(const char *dir,
svn_client_ctx_t *ctx,
apr_pool_t *pool);
-
/** @} */
/**
Modified: subversion/branches/atomic-revprop/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/include/svn_wc.h?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/include/svn_wc.h (original)
+++ subversion/branches/atomic-revprop/subversion/include/svn_wc.h Wed Sep 22 11:35:43 2010
@@ -6791,13 +6791,13 @@ typedef svn_error_t *(*svn_wc_relocation
const char *uuid,
const char *url);
-/** Change repository references at @a local_abspath and all it's children.
- * The pre-change URL should be @a from, and the post-change URL will be
- * @a to. @a validator (and its baton, @a validator_baton), will be called
- * for the newly generated base URL and calculated repo root.
+/** Recursively change repository references at @a wcroot_abspath
+ * (which is the root directory of a working copy). The pre-change
+ * URL should be @a from, and the post-change URL will be @a to. @a
+ * validator (and its baton, @a validator_baton), will be called for
+ * the newly generated base URL and calculated repo root.
*
- * If @a recurse is @c FALSE, none of the children of @a local_abspath will
- * be changed. @a wc_ctx is an working copy context.
+ * @a wc_ctx is an working copy context.
*
* @a scratch_pool will be used for temporary allocations.
*
@@ -6805,10 +6805,9 @@ typedef svn_error_t *(*svn_wc_relocation
*/
svn_error_t *
svn_wc_relocate4(svn_wc_context_t *wc_ctx,
- const char *local_abspath,
+ const char *wcroot_abspath,
const char *from,
const char *to,
- svn_boolean_t recurse,
svn_wc_relocation_validator3_t validator,
void *validator_baton,
apr_pool_t *scratch_pool);
@@ -6816,8 +6815,12 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
/** Similar to svn_wc_relocate4(), but with a #svn_wc_adm_access_t /
* relative path parameter pair.
*
+ * @note As of the 1.7 API, @a path is required to be a working copy
+ * root directory, and @a recurse is required to be TRUE.
+ *
* @since New in 1.5.
- * @deprecated Provided for backwards compatibility with the 1.6 API.
+ * @deprecated Provided for limited backwards compatibility with the
+ * 1.6 API.
*/
SVN_DEPRECATED
svn_error_t *
Modified: subversion/branches/atomic-revprop/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_client/deprecated.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_client/deprecated.c Wed Sep 22 11:35:43 2010
@@ -2039,3 +2039,18 @@ svn_client_mergeinfo_log_eligible(const
svn_depth_empty, revprops, ctx,
pool);
}
+
+/*** From relocate.c ***/
+svn_error_t *
+svn_client_relocate(const char *path,
+ const char *from,
+ const char *to,
+ svn_boolean_t recurse,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
+{
+ if (! recurse)
+ svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, 0,
+ _("Non-recursive relocation not supported"));
+ return svn_client_relocate2(path, from, to, ctx, pool);
+}
Modified: subversion/branches/atomic-revprop/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_client/externals.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_client/externals.c Wed Sep 22 11:35:43 2010
@@ -229,8 +229,8 @@ switch_dir_external(const char *path,
SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root,
subpool));
- err = svn_client_relocate(path, repos_root_url, repos_root,
- TRUE, ctx, subpool);
+ err = svn_client_relocate2(path, repos_root_url, repos_root,
+ ctx, subpool);
/* If the relocation failed because the new URL points
to another repository, then we need to relegate and
check out a new WC. */
Modified: subversion/branches/atomic-revprop/subversion/libsvn_client/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_client/relocate.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_client/relocate.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_client/relocate.c Wed Sep 22 11:35:43 2010
@@ -126,24 +126,23 @@ validator_func(void *baton,
}
svn_error_t *
-svn_client_relocate(const char *path,
- const char *from,
- const char *to,
- svn_boolean_t recurse,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool)
+svn_client_relocate2(const char *wcroot_dir,
+ const char *from,
+ const char *to,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
{
struct validator_baton_t vb;
const char *local_abspath;
- /* Now, populate our validator callback baton, and call the relocate code. */
+ /* Populate our validator callback baton, and call the relocate code. */
vb.ctx = ctx;
- vb.path = path;
+ vb.path = wcroot_dir;
vb.url_uuids = apr_array_make(pool, 1, sizeof(struct url_uuid_t));
vb.pool = pool;
- SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
- SVN_ERR(svn_wc_relocate4(ctx->wc_ctx, local_abspath, from, to, recurse,
+ SVN_ERR(svn_dirent_get_absolute(&local_abspath, wcroot_dir, pool));
+ SVN_ERR(svn_wc_relocate4(ctx->wc_ctx, local_abspath, from, to,
validator_func, &vb, pool));
return SVN_NO_ERROR;
Modified: subversion/branches/atomic-revprop/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_diff/parse-diff.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_diff/parse-diff.c Wed Sep 22 11:35:43 2010
@@ -752,8 +752,8 @@ parse_next_hunk(svn_diff_hunk_t **hunk,
static int
compare_hunks(const void *a, const void *b)
{
- const svn_diff_hunk_t *ha = *((const svn_diff_hunk_t **)a);
- const svn_diff_hunk_t *hb = *((const svn_diff_hunk_t **)b);
+ const svn_diff_hunk_t *ha = *((const svn_diff_hunk_t *const *)a);
+ const svn_diff_hunk_t *hb = *((const svn_diff_hunk_t *const *)b);
if (ha->original_start < hb->original_start)
return -1;
Modified: subversion/branches/atomic-revprop/subversion/libsvn_fs/access.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_fs/access.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_fs/access.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_fs/access.c Wed Sep 22 11:35:43 2010
@@ -87,7 +87,7 @@ svn_fs_access_add_lock_token2(svn_fs_acc
const char *token)
{
apr_hash_set(access_ctx->lock_tokens,
- token, APR_HASH_KEY_STRING, (void *) path);
+ token, APR_HASH_KEY_STRING, path);
return SVN_NO_ERROR;
}
Modified: subversion/branches/atomic-revprop/subversion/libsvn_subr/svn_string.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_subr/svn_string.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_subr/svn_string.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_subr/svn_string.c Wed Sep 22 11:35:43 2010
@@ -661,7 +661,7 @@ svn_cstring_strtoui64(apr_uint64_t *n, c
val < 0 || (apr_uint64_t)val < minval || (apr_uint64_t)val > maxval)
return svn_error_return(
svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
- _("Number '%s' is out of range '[%lu, %lu]'"),
+ _("Number '%s' is out of range '[%llu, %llu]'"),
str, minval, maxval));
*n = val;
return SVN_NO_ERROR;
@@ -705,7 +705,7 @@ svn_cstring_strtoi64(apr_int64_t *n, con
val < minval || val > maxval)
return svn_error_return(
svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
- _("Number '%s' is out of range '[%ld, %ld]'"),
+ _("Number '%s' is out of range '[%lld, %lld]'"),
str, minval, maxval));
*n = val;
return SVN_NO_ERROR;
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c Wed Sep 22 11:35:43 2010
@@ -3364,12 +3364,16 @@ svn_wc_relocate3(const char *path,
const char *local_abspath;
svn_wc_context_t *wc_ctx;
+ if (! recurse)
+ svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, 0,
+ _("Non-recursive relocation not supported"));
+
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL /* config */,
svn_wc__adm_get_db(adm_access),
pool));
- SVN_ERR(svn_wc_relocate4(wc_ctx, local_abspath, from, to, recurse,
+ SVN_ERR(svn_wc_relocate4(wc_ctx, local_abspath, from, to,
validator, validator_baton, pool));
return svn_error_return(svn_wc_context_destroy(wc_ctx));
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/relocate.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/relocate.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/relocate.c Wed Sep 22 11:35:43 2010
@@ -76,7 +76,6 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
const char *local_abspath,
const char *from,
const char *to,
- svn_boolean_t recurse,
svn_wc_relocation_validator3_t validator,
void *validator_baton,
apr_pool_t *scratch_pool)
@@ -87,6 +86,35 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
const char *old_url;
const char *new_repos_root;
const char *uuid;
+ svn_boolean_t is_wc_root;
+
+ SVN_ERR(svn_wc__strictly_is_wc_root(&is_wc_root, wc_ctx, local_abspath,
+ scratch_pool));
+ if (! is_wc_root)
+ {
+ const char *wcroot_abspath;
+ svn_error_t *err;
+
+ err = svn_wc__db_get_wcroot(&wcroot_abspath, wc_ctx->db,
+ local_abspath, scratch_pool, scratch_pool);
+ if (err)
+ {
+ svn_error_clear(err);
+ return svn_error_createf(
+ SVN_ERR_WC_INVALID_OP_ON_CWD, NULL,
+ _("Cannot relocate '%s' as it is not the root of a working copy"),
+ svn_dirent_local_style(local_abspath, scratch_pool));
+ }
+ else
+ {
+ return svn_error_createf(
+ SVN_ERR_WC_INVALID_OP_ON_CWD, NULL,
+ _("Cannot relocate '%s' as it is not the root of a working copy; "
+ "try relocating '%s' instead"),
+ svn_dirent_local_style(local_abspath, scratch_pool),
+ svn_dirent_local_style(wcroot_abspath, scratch_pool));
+ }
+ }
SVN_ERR(svn_wc__db_read_info(NULL, &kind, NULL, &repos_relpath,
&old_repos_root, &uuid,
@@ -112,48 +140,7 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
SVN_ERR(validator(validator_baton, uuid, to, new_repos_root, scratch_pool));
- /* ### FIXME: This will ultimately cause the DAV cache to be
- recursively cleared, which is great in the recursive case, but
- overreaching otherwise. Granted, this only affects performance,
- and that only for DAV RA implementations that rely on the DAV
- cache. */
- SVN_ERR(svn_wc__db_global_relocate(wc_ctx->db, local_abspath, new_repos_root,
- scratch_pool));
-
- if (!recurse)
- {
- /* This gets sticky. We need to do the above relocation, and then
- relocate each of the children *back* to the original location. Ugh.
- */
- const apr_array_header_t *children;
- apr_pool_t *iterpool;
- int i;
-
- SVN_ERR(svn_wc__db_read_children(&children, wc_ctx->db, local_abspath,
- scratch_pool, scratch_pool));
- iterpool = svn_pool_create(scratch_pool);
- for (i = 0; i < children->nelts; i++)
- {
- const char *child = APR_ARRAY_IDX(children, i, const char *);
- const char *child_abspath;
- const char *child_from;
- const char *child_to;
-
- svn_pool_clear(iterpool);
- child_abspath = svn_dirent_join(local_abspath, child, iterpool);
-
- /* We invert the "from" and "to" because we're switching the
- children back to the original location. */
- child_from = svn_uri_join(to, child, iterpool);
- child_to = svn_uri_join(from, child, iterpool);
-
- SVN_ERR(svn_wc_relocate4(wc_ctx, child_abspath, child_from,
- child_to, TRUE, validator, validator_baton,
- iterpool));
- }
-
- svn_pool_destroy(iterpool);
- }
-
- return SVN_NO_ERROR;
+ return svn_error_return(svn_wc__db_global_relocate(wc_ctx->db, local_abspath,
+ new_repos_root,
+ scratch_pool));
}
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-queries.sql?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-queries.sql Wed Sep 22 11:35:43 2010
@@ -132,18 +132,43 @@ VALUES (?1, ?2, ?3, 'incomplete', 'unkno
SELECT COUNT(*) FROM BASE_NODE
WHERE wc_id = ?1 AND parent_relpath = ?2;
+-- STMT_COUNT_BASE_NODE_CHILDREN_1
+SELECT COUNT(*) FROM NODES
+WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = 0;
+
-- STMT_COUNT_WORKING_NODE_CHILDREN
SELECT COUNT(*) FROM WORKING_NODE
WHERE wc_id = ?1 AND parent_relpath = ?2;
+-- STMT_COUNT_WORKING_NODE_CHILDREN_1
+SELECT COUNT(*) FROM NODES
+WHERE wc_id = ?1 AND parent_relpath = ?2
+ AND op_depth IN (SELECT op_depth FROM NODES
+ WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth > 0
+ ORDER BY op_depth DESC
+ LIMIT 1);
+
+
-- STMT_SELECT_BASE_NODE_CHILDREN
select local_relpath from base_node
where wc_id = ?1 and parent_relpath = ?2;
+-- STMT_SELECT_BASE_NODE_CHILDREN_1
+select local_relpath from nodes
+where wc_id = ?1 and parent_relpath = ?2 and op_depth = 0;
+
-- STMT_SELECT_WORKING_NODE_CHILDREN
SELECT local_relpath FROM WORKING_NODE
WHERE wc_id = ?1 AND parent_relpath = ?2;
+-- STMT_SELECT_WORKING_NODE_CHILDREN_1
+SELECT local_relpath FROM NODES
+WHERE wc_id = ?1 AND parent_relpath = ?2
+ AND op_depth IN (SELECT op_depth FROM NODES
+ WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth > 0
+ ORDER BY op_depth DESC
+ LIMIT 1);
+
-- STMT_SELECT_WORKING_IS_FILE
select kind == 'file' from working_node
where wc_id = ?1 and local_relpath = ?2;
@@ -190,7 +215,7 @@ update nodes set properties = ?3
where wc_id = ?1 and local_relpath = ?2
and op_depth in
(select op_depth from nodes
- where wc_id = ?1 and local_relpath = ?2
+ where wc_id = ?1 and local_relpath = ?2 and op_depth > 0
order by op_depth desc
limit 1);
@@ -287,7 +312,7 @@ WHERE wc_id = ?1 AND local_relpath = ?2;
update nodes set translated_size = ?3, last_mod_time = ?4
where wc_id = ?1 and local_relpath = ?2
and op_depth = (select op_depth from nodes
- where wc_id = ?1 and local_relpath = ?2
+ where wc_id = ?1 and local_relpath = ?2 and op_depth > 0
order by op_depth desc
limit 1);
@@ -376,7 +401,7 @@ WHERE wc_id = ?1 AND local_relpath = ?2;
update NODES set depth = ?3
where wc_id = ?1 and local_relpath = ?2 and
op_depth in (select op_depth from NODES
- where wc_id = ?1 and local_relpath = ?2
+ where wc_id = ?1 and local_relpath = ?2 and op_depth > 0
order by op_depth desc
limit 1);
@@ -424,7 +449,7 @@ where wc_id = ?1 and local_relpath =?2;
update nodes set presence = ?3
where wc_id = ?1 and local_relpath = ?2
and op_depth in (select op_depth from nodes
- where wc_id = ?1 and local_relpath = ?2
+ where wc_id = ?1 and local_relpath = ?2 and op_depth > 0
order by op_depth desc
limit 1);
@@ -641,7 +666,7 @@ UPDATE NODES SET
revision = null
WHERE wc_id = ?1 AND local_relpath = ?2
AND op_depth IN (SELECT op_depth FROM nodes
- WHERE wc_id = ?1 AND local_relpath = ?2
+ WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0
ORDER BY op_depth DESC
LIMIT 1);
@@ -655,7 +680,7 @@ SELECT 0 FROM NODES WHERE wc_id = ?1 AND
UNION
SELECT 1 FROM NODES WHERE wc_id = ?1 AND local_relpath = ?2
AND op_depth IN (SELECT op_depth FROM nodes
- WHERE wc_id = ?1 AND local_relpath = ?2
+ WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0
ORDER BY op_depth DESC
LIMIT 1);
@@ -710,7 +735,7 @@ select wc_id, ?3 as local_relpath, ?4 as
kind, changed_revision, changed_date, changed_author, checksum, properties,
translated_size, last_mod_time, symlink_target
from NODES
-where wc_id = ?1 and local_relpath = ?2
+where wc_id = ?1 and local_relpath = ?2 and op_depth > 0
order by op_depth desc
limit 1;
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c Wed Sep 22 11:35:43 2010
@@ -1231,6 +1231,9 @@ union_children(const apr_array_header_t
{
/* ### it would be nice to pre-size this hash table. */
apr_hash_t *names = apr_hash_make(scratch_pool);
+#ifdef SVN_WC__NODES
+ apr_hash_t *names_nodes = apr_hash_make(scratch_pool);
+#endif
apr_array_header_t *names_array;
/* All of the names get allocated in RESULT_POOL. */
@@ -1238,6 +1241,17 @@ union_children(const apr_array_header_t
sdb, wc_id, parent_relpath, result_pool));
SVN_ERR(add_children_to_hash(names, STMT_SELECT_WORKING_NODE_CHILDREN,
sdb, wc_id, parent_relpath, result_pool));
+#ifdef SVN_WC__NODES
+ SVN_ERR(add_children_to_hash(names_nodes, STMT_SELECT_BASE_NODE_CHILDREN_1,
+ sdb, wc_id, parent_relpath, result_pool));
+ SVN_ERR(add_children_to_hash(names_nodes, STMT_SELECT_WORKING_NODE_CHILDREN_1,
+ sdb, wc_id, parent_relpath, result_pool));
+#ifndef SVN_WC__NODES_ONLY
+ SVN_ERR_ASSERT(apr_hash_count(names) == apr_hash_count(names_nodes));
+#else
+ names = names_nodes;
+#endif
+#endif
SVN_ERR(svn_hash_keys(&names_array, names, result_pool));
*children = names_array;
@@ -1306,6 +1320,10 @@ gather_children(const apr_array_header_t
const char *local_relpath;
int base_count;
int working_count;
+#ifdef SVN_WC__NODES
+ int base_count_nodes, working_count_nodes;
+ const apr_array_header_t *children_nodes;
+#endif
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
@@ -1321,17 +1339,47 @@ gather_children(const apr_array_header_t
directory in its repository.
### note "files". should redo count with subdirs included */
- return svn_error_return(single_table_children(
- children, STMT_SELECT_BASE_NODE_CHILDREN,
- 10 /* start_size */,
- pdh->wcroot->sdb, pdh->wcroot->wc_id,
- local_relpath, result_pool));
+#ifndef SVN_WC__NODES_ONLY
+ SVN_ERR(single_table_children(children, STMT_SELECT_BASE_NODE_CHILDREN,
+ 10 /* start_size */,
+ pdh->wcroot->sdb, pdh->wcroot->wc_id,
+ local_relpath, result_pool));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(single_table_children(&children_nodes,
+ STMT_SELECT_BASE_NODE_CHILDREN_1,
+ 10 /* start_size */,
+ pdh->wcroot->sdb, pdh->wcroot->wc_id,
+ local_relpath, result_pool));
+#ifndef SVN_WC__NODES_ONLY
+ SVN_ERR_ASSERT((*children)->nelts == children_nodes->nelts);
+#else
+ *children = children_nodes;
+#endif
+#endif
+ return SVN_NO_ERROR;
}
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(count_children(&base_count, STMT_COUNT_BASE_NODE_CHILDREN,
pdh->wcroot->sdb, pdh->wcroot->wc_id, local_relpath));
SVN_ERR(count_children(&working_count, STMT_COUNT_WORKING_NODE_CHILDREN,
pdh->wcroot->sdb, pdh->wcroot->wc_id, local_relpath));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(count_children(&base_count_nodes, STMT_COUNT_BASE_NODE_CHILDREN_1,
+ pdh->wcroot->sdb, pdh->wcroot->wc_id, local_relpath));
+ SVN_ERR(count_children(&working_count_nodes,
+ STMT_COUNT_WORKING_NODE_CHILDREN_1,
+ pdh->wcroot->sdb, pdh->wcroot->wc_id, local_relpath));
+#ifndef SVN_WC__NODES_ONLY
+ SVN_ERR_ASSERT(base_count == base_count_nodes);
+ SVN_ERR_ASSERT(working_count == working_count_nodes);
+#else
+ base_count = base_count_nodes;
+ working_count = working_count_nodes;
+#endif
+#endif
if (base_count == 0)
{
@@ -1341,18 +1389,48 @@ gather_children(const apr_array_header_t
return SVN_NO_ERROR;
}
- return svn_error_return(single_table_children(
- children, STMT_SELECT_WORKING_NODE_CHILDREN,
- working_count,
- pdh->wcroot->sdb, pdh->wcroot->wc_id,
- local_relpath, result_pool));
+#ifndef SVN_WC__NODES_ONLY
+ SVN_ERR(single_table_children(children, STMT_SELECT_WORKING_NODE_CHILDREN,
+ working_count,
+ pdh->wcroot->sdb, pdh->wcroot->wc_id,
+ local_relpath, result_pool));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(single_table_children(&children_nodes,
+ STMT_SELECT_WORKING_NODE_CHILDREN,
+ working_count,
+ pdh->wcroot->sdb, pdh->wcroot->wc_id,
+ local_relpath, result_pool));
+#ifndef SVN_WC__NODES_ONLY
+ SVN_ERR_ASSERT((*children)->nelts == children_nodes->nelts);
+#else
+ *children = children_nodes;
+#endif
+#endif
+ return SVN_NO_ERROR;
}
if (working_count == 0)
- return svn_error_return(single_table_children(
- children, STMT_SELECT_BASE_NODE_CHILDREN,
- base_count,
- pdh->wcroot->sdb, pdh->wcroot->wc_id,
- local_relpath, result_pool));
+ {
+#ifndef SVN_WC__NODES_ONLY
+ SVN_ERR(single_table_children(children, STMT_SELECT_BASE_NODE_CHILDREN,
+ base_count,
+ pdh->wcroot->sdb, pdh->wcroot->wc_id,
+ local_relpath, result_pool));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(single_table_children(&children_nodes,
+ STMT_SELECT_BASE_NODE_CHILDREN_1,
+ base_count,
+ pdh->wcroot->sdb, pdh->wcroot->wc_id,
+ local_relpath, result_pool));
+#ifndef SVN_WC__NODES_ONLY
+ SVN_ERR_ASSERT((*children)->nelts == children_nodes->nelts);
+#else
+ *children = children_nodes;
+#endif
+#endif
+ return SVN_NO_ERROR;
+ }
/* ### it would be nice to pass BASE_COUNT and WORKING_COUNT, but there is
### nothing union_children() can do with those. */
@@ -6566,12 +6644,34 @@ svn_wc__db_scan_addition(svn_wc__db_stat
svn_sqlite__stmt_t *stmt;
svn_boolean_t have_row;
svn_wc__db_status_t presence;
+#ifdef SVN_WC__NODES
+ svn_sqlite__stmt_t *stmt_nodes;
+ svn_boolean_t have_nodes_row;
+#endif
/* ### is it faster to fetch fewer columns? */
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_SELECT_WORKING_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, current_relpath));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt_nodes, wcroot->sdb,
+ STMT_SELECT_WORKING_NODE_1));
+ SVN_ERR(svn_sqlite__bindf(stmt_nodes, "is",
+ wcroot->wc_id, current_relpath));
+ SVN_ERR(svn_sqlite__step(&have_nodes_row, stmt_nodes));
+#ifndef SVN_WC__NODES_ONLY
+ SVN_ERR(assert_working_rows_match(have_row, have_nodes_row,
+ stmt, stmt_nodes,
+ current_relpath, scratch_pool));
+ SVN_ERR(svn_sqlite__reset(stmt_nodes));
+#else
+ stmt = stmt_nodes;
+ have_row = have_nodes_row;
+#endif
+#endif
if (!have_row)
{
@@ -7801,6 +7901,10 @@ svn_wc__db_node_hidden(svn_boolean_t *hi
svn_wc__db_status_t work_status, base_status;
svn_sqlite__stmt_t *stmt;
svn_boolean_t have_row;
+#ifdef SVN_WC__NODES
+ svn_sqlite__stmt_t *stmt_nodes;
+ svn_boolean_t have_nodes_row;
+#endif
/* This uses an optimisation that first reads the working node and
then may read the base node. It could call svn_wc__db_read_info
@@ -7814,10 +7918,27 @@ svn_wc__db_node_hidden(svn_boolean_t *hi
VERIFY_USABLE_PDH(pdh);
/* First check the working node. */
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
STMT_SELECT_WORKING_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt_nodes, pdh->wcroot->sdb,
+ STMT_SELECT_WORKING_NODE_1));
+ SVN_ERR(svn_sqlite__bindf(stmt_nodes, "is",
+ pdh->wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step(&have_nodes_row, stmt_nodes));
+#ifndef SVN_WC__NODES_ONLY
+ SVN_ERR(assert_working_rows_match(have_row, have_nodes_row, stmt, stmt_nodes,
+ local_relpath, scratch_pool));
+ SVN_ERR(svn_sqlite__reset(stmt_nodes));
+#else
+ stmt = stmt_nodes;
+ have_row = have_nodes_row;
+#endif
+#endif
if (have_row)
{
Modified: subversion/branches/atomic-revprop/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/mod_dav_svn/version.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/atomic-revprop/subversion/mod_dav_svn/version.c Wed Sep 22 11:35:43 2010
@@ -1016,22 +1016,22 @@ deliver_report(request_rec *r,
if (doc->root->ns == ns)
{
- const char *cleaned_uri, *relative_path, *repos_path;
- int trailing_slash;
- /* During SVNPathAuthz short_circuit
- * resource->info->repos->repo_name becomes NULL.*/
+ /* If the "SVNPathAuthz short_circuit" directive is used,
+ resource->info->repos->repo_name becomes NULL. */
if (resource->info->repos->repo_name == NULL)
{
+ const char *cleaned_uri, *relative_path, *repos_path;
+ int trailing_slash;
dav_error *err;
+
err = dav_svn_split_uri(r, r->uri, dav_svn__get_root_dir(r),
&cleaned_uri, &trailing_slash,
&(resource->info->repos->repo_name),
&relative_path, &repos_path);
if (err)
- {
- return err;
- }
+ return err;
}
+
/* ### note that these report names should have symbols... */
if (strcmp(doc->root->name, "update-report") == 0)
Modified: subversion/branches/atomic-revprop/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/main.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/main.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/main.c Wed Sep 22 11:35:43 2010
@@ -2087,12 +2087,24 @@ main(int argc, const char *argv[])
}
}
- if (opt_state.relocate && (opt_state.depth != svn_depth_unknown))
+ /* Relocation is infinite-depth only. */
+ if (opt_state.relocate)
{
- err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
- _("--relocate and --depth are mutually "
- "exclusive"));
- return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+ if (opt_state.depth != svn_depth_unknown)
+ {
+ err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+ _("--relocate and --depth are mutually "
+ "exclusive"));
+ return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+ }
+ if (! descend)
+ {
+ err = svn_error_create(
+ SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+ _("--relocate and --non-recursive (-N) are mutually "
+ "exclusive"));
+ return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+ }
}
/* Only a few commands can accept a revision range; the rest can take at
Modified: subversion/branches/atomic-revprop/subversion/svn/switch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/switch-cmd.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/switch-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/switch-cmd.c Wed Sep 22 11:35:43 2010
@@ -41,7 +41,6 @@
static svn_error_t *
rewrite_urls(const apr_array_header_t *targets,
- svn_boolean_t recurse,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
{
@@ -67,7 +66,7 @@ rewrite_urls(const apr_array_header_t *t
if (targets->nelts == 2)
{
- SVN_ERR(svn_client_relocate("", from, to, recurse, ctx, pool));
+ SVN_ERR(svn_client_relocate2("", from, to, ctx, pool));
}
else
{
@@ -75,8 +74,7 @@ rewrite_urls(const apr_array_header_t *t
{
const char *target = APR_ARRAY_IDX(targets, i, const char *);
svn_pool_clear(subpool);
- SVN_ERR(svn_client_relocate(target, from, to, recurse,
- ctx, subpool));
+ SVN_ERR(svn_client_relocate2(target, from, to, ctx, subpool));
}
}
@@ -109,9 +107,7 @@ svn_cl__switch(apr_getopt_t *os,
/* handle only-rewrite case specially */
if (opt_state->relocate)
- return rewrite_urls(targets,
- SVN_DEPTH_IS_RECURSIVE(opt_state->depth),
- ctx, scratch_pool);
+ return rewrite_urls(targets, ctx, scratch_pool);
if (targets->nelts < 1)
return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);
Modified: subversion/branches/atomic-revprop/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svnrdump/dump_editor.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/atomic-revprop/subversion/svnrdump/dump_editor.c Wed Sep 22 11:35:43 2010
@@ -66,9 +66,9 @@ struct dump_edit_baton {
const char *base_checksum;
/* Flags to trigger dumping props and text */
- svn_boolean_t dump_props;
svn_boolean_t dump_text;
- svn_boolean_t dump_props_pending;
+ svn_boolean_t dump_props;
+ svn_boolean_t dump_newlines;
};
/* Make a directory baton to represent the directory at path (relative
@@ -97,17 +97,15 @@ make_dir_baton(const char *path,
struct dir_baton *new_db = apr_pcalloc(pool, sizeof(*new_db));
const char *abspath;
- /* Disallow a path relative to nothing. */
- SVN_ERR_ASSERT_NO_RETURN(!path || pb);
-
/* Construct the full path of this node. */
if (pb)
abspath = svn_uri_join("/", path, pool);
else
- abspath = "/";
+ abspath = apr_pstrdup(pool, "/");
- /* Remove leading slashes from copyfrom paths. */
- if (copyfrom_path && strcmp(copyfrom_path, "/"))
+ /* Strip leading slash from copyfrom_path so that the path is
+ canonical and svn_relpath_join can be used */
+ if (copyfrom_path)
copyfrom_path = ((*copyfrom_path == '/') ?
copyfrom_path + 1 : copyfrom_path);
@@ -181,6 +179,19 @@ dump_props(struct dump_edit_baton *eb,
return SVN_NO_ERROR;
}
+static svn_error_t *
+dump_newlines(struct dump_edit_baton *eb,
+ svn_boolean_t *trigger_var,
+ apr_pool_t *pool)
+{
+ if (trigger_var && *trigger_var)
+ {
+ SVN_ERR(svn_stream_printf(eb->stream, pool, "\n\n"));
+ *trigger_var = FALSE;
+ }
+ return SVN_NO_ERROR;
+}
+
/*
* Write out a node record for PATH of type KIND under EB->FS_ROOT.
* ACTION describes what is happening to the node (see enum
@@ -227,6 +238,9 @@ dump_node(struct dump_edit_baton *eb,
switch (action)
{
case svn_node_action_change:
+ /* We are here after a change_file_prop or change_dir_prop. They
+ set up whatever dump_props they needed to- nothing to
+ do here but print node action information */
SVN_ERR(svn_stream_printf(eb->stream, pool,
SVN_REPOS_DUMPFILE_NODE_ACTION
": change\n"));
@@ -240,7 +254,9 @@ dump_node(struct dump_edit_baton *eb,
SVN_REPOS_DUMPFILE_NODE_ACTION
": replace\n"));
- eb->dump_props_pending = TRUE;
+ /* Wait for a change_*_prop to be called before dumping
+ anything */
+ eb->dump_props = TRUE;
break;
}
/* More complex case: is_copy is true, and copyfrom_path/
@@ -257,7 +273,6 @@ dump_node(struct dump_edit_baton *eb,
/* We can leave this routine quietly now, don't need to dump any
content; that was already done in the second record. */
- eb->dump_props = FALSE;
break;
case svn_node_action_delete:
@@ -265,10 +280,10 @@ dump_node(struct dump_edit_baton *eb,
SVN_REPOS_DUMPFILE_NODE_ACTION
": delete\n"));
- /* We can leave this routine quietly now, don't need to dump
- any content. */
+ /* We can leave this routine quietly now. Nothing more to do-
+ print a couple of newlines because we're not dumping props or
+ text. */
SVN_ERR(svn_stream_printf(eb->stream, pool, "\n\n"));
- eb->dump_props = FALSE;
break;
case svn_node_action_add:
@@ -277,15 +292,17 @@ dump_node(struct dump_edit_baton *eb,
if (!is_copy)
{
- /* eb->dump_props_pending for files is handled in close_file
+ /* eb->dump_props for files is handled in close_file
which is called immediately. However, directories are not
closed until all the work inside them has been done;
- eb->dump_props_pending for directories is handled in all the
+ eb->dump_props for directories is handled in all the
functions that can possibly be called after add_directory:
add_directory, open_directory, delete_entry, close_directory,
add_file, open_file. change_dir_prop is a special case. */
- eb->dump_props_pending = TRUE;
+ /* Wait for a change_*_prop to be called before dumping
+ anything */
+ eb->dump_props = TRUE;
break;
}
@@ -296,19 +313,18 @@ dump_node(struct dump_edit_baton *eb,
": %s\n",
copyfrom_rev, copyfrom_path));
- /* Ugly hack: If a directory was copied from a previous revision,
- nothing else can be done, and close_file won't be called to
- write two blank lines. Write them here otherwise the `svnadmin
- load` parser will fail. */
+ /* Ugly hack: If a directory was copied from a previous
+ revision, nothing like close_file will be called to write two
+ blank lines. If change_dir_prop is called, props are dumped
+ (along with the necessary PROPS-END\n\n and we're good. So
+ set a dump_newlines here to print the newlines unless
+ change_dir_prop is called next otherwise the `svnadmin load`
+ parser will fail. */
if (kind == svn_node_dir)
- SVN_ERR(svn_stream_printf(eb->stream, pool, "\n\n"));
+ eb->dump_newlines = TRUE;
break;
}
-
- /* Dump property headers */
- SVN_ERR(dump_props(eb, &(eb->dump_props), FALSE, pool));
-
return SVN_NO_ERROR;
}
@@ -345,11 +361,15 @@ delete_entry(const char *path,
LDR_DBG(("delete_entry %s\n", path));
/* Some pending properties to dump? */
- SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
+ SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props), TRUE, pool));
+
+ /* Some pending newlines to dump? */
+ SVN_ERR(dump_newlines(pb->eb, &(pb->eb->dump_newlines), pool));
/* Add this path to the deleted_entries of the parent directory
baton. */
- apr_hash_set(pb->deleted_entries, path, APR_HASH_KEY_STRING, pb);
+ apr_hash_set(pb->deleted_entries, apr_pstrdup(pb->eb->pool, path),
+ APR_HASH_KEY_STRING, pb);
return SVN_NO_ERROR;
}
@@ -371,7 +391,10 @@ add_directory(const char *path,
LDR_DBG(("add_directory %s\n", path));
/* Some pending properties to dump? */
- SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
+ SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props), TRUE, pool));
+
+ /* Some pending newlines to dump? */
+ SVN_ERR(dump_newlines(pb->eb, &(pb->eb->dump_newlines), pool));
/* This might be a replacement -- is the path already deleted? */
val = apr_hash_get(pb->deleted_entries, path, APR_HASH_KEY_STRING);
@@ -413,7 +436,10 @@ open_directory(const char *path,
LDR_DBG(("open_directory %s\n", path));
/* Some pending properties to dump? */
- SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
+ SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props), TRUE, pool));
+
+ /* Some pending newlines to dump? */
+ SVN_ERR(dump_newlines(pb->eb, &(pb->eb->dump_newlines), pool));
/* If the parent directory has explicit comparison path and rev,
record the same for this one. */
@@ -442,12 +468,15 @@ close_directory(void *dir_baton,
LDR_DBG(("close_directory %p\n", dir_baton));
+ /* Some pending properties to dump? */
+ SVN_ERR(dump_props(eb, &(eb->dump_props), TRUE, pool));
+
+ /* Some pending newlines to dump? */
+ SVN_ERR(dump_newlines(eb, &(eb->dump_newlines), pool));
+
/* Create a pool just for iterations to allocate a loop variable */
iterpool = svn_pool_create(pool);
- /* Some pending properties to dump? */
- SVN_ERR(dump_props(eb, &(eb->dump_props_pending), TRUE, pool));
-
/* Dump the deleted directory entries */
for (hi = apr_hash_first(iterpool, db->deleted_entries); hi;
hi = apr_hash_next(hi))
@@ -481,7 +510,10 @@ add_file(const char *path,
LDR_DBG(("add_file %s\n", path));
/* Some pending properties to dump? */
- SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
+ SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props), TRUE, pool));
+
+ /* Some pending newlines to dump? */
+ SVN_ERR(dump_newlines(pb->eb, &(pb->eb->dump_newlines), pool));
/* This might be a replacement -- is the path already deleted? */
val = apr_hash_get(pb->deleted_entries, path, APR_HASH_KEY_STRING);
@@ -523,7 +555,10 @@ open_file(const char *path,
LDR_DBG(("open_file %s\n", path));
/* Some pending properties to dump? */
- SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
+ SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props), TRUE, pool));
+
+ /* Some pending newlines to dump? */
+ SVN_ERR(dump_newlines(pb->eb, &(pb->eb->dump_newlines), pool));
/* If the parent directory has explicit copyfrom path and rev,
record the same for this one. */
@@ -568,17 +603,21 @@ change_dir_prop(void *parent_baton,
{
/* If db->written_out is set, it means that the node information
corresponding to this directory has already been written: don't
- do anything; dump_props_pending will take care of dumping the
+ do anything; dump_props will take care of dumping the
props. If it not, dump the node itself before dumping the
props. */
SVN_ERR(dump_node(db->eb, db->abspath, svn_node_dir,
svn_node_action_change, FALSE, db->copyfrom_path,
db->copyfrom_rev, pool));
-
- SVN_ERR(dump_props(db->eb, NULL, TRUE, pool));
db->written_out = TRUE;
}
+
+ /* Dump props whether or not the directory has been written
+ out. Then disable printing a couple of extra newlines */
+ SVN_ERR(dump_props(db->eb, NULL, TRUE, pool));
+ db->eb->dump_newlines = FALSE;
+
return SVN_NO_ERROR;
}
@@ -605,7 +644,7 @@ change_file_prop(void *file_baton,
/* Dump the property headers and wait; close_file might need
to write text headers too depending on whether
apply_textdelta is called */
- eb->dump_props_pending = TRUE;
+ eb->dump_props = TRUE;
return SVN_NO_ERROR;
}
@@ -680,11 +719,11 @@ close_file(void *file_baton,
LDR_DBG(("close_file %p\n", file_baton));
- /* Some pending properties to dump? */
- SVN_ERR(dump_props(eb, &(eb->dump_props_pending), FALSE, pool));
+ /* Some pending properties to dump? Dump just the headers- dump the
+ props only after dumping the text headers too (if present) */
+ SVN_ERR(dump_props(eb, &(eb->dump_props), FALSE, pool));
- /* The prop headers have already been dumped in dump_node; now dump
- the text headers. */
+ /* Dump the text headers */
if (eb->dump_text)
{
/* Text-delta: true */
@@ -716,7 +755,7 @@ close_file(void *file_baton,
/* Content-length: 1549 */
/* If both text and props are absent, skip this header */
- if (eb->dump_props || eb->dump_props_pending)
+ if (eb->dump_props)
SVN_ERR(svn_stream_printf(eb->stream, pool,
SVN_REPOS_DUMPFILE_CONTENT_LENGTH
": %ld\n\n",
@@ -727,15 +766,14 @@ close_file(void *file_baton,
": %ld\n\n",
(unsigned long)info->size));
- /* Dump the props; the propstring should have already been
- written in dump_node or above */
- if (eb->dump_props || eb->dump_props_pending)
+ /* Dump the props now */
+ if (eb->dump_props)
{
SVN_ERR(svn_stream_write(eb->stream, eb->propstring->data,
&(eb->propstring->len)));
/* Cleanup */
- eb->dump_props = eb->dump_props_pending = FALSE;
+ eb->dump_props = FALSE;
svn_hash__clear(eb->props, pool);
svn_hash__clear(eb->deleted_props, pool);
}
@@ -758,6 +796,8 @@ close_file(void *file_baton,
eb->dump_text = FALSE;
}
+ /* Write a couple of blank lines for matching output with `svnadmin
+ dump` */
SVN_ERR(svn_stream_printf(eb->stream, pool, "\n\n"));
return SVN_NO_ERROR;
Modified: subversion/branches/atomic-revprop/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svnrdump/load_editor.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/atomic-revprop/subversion/svnrdump/load_editor.c Wed Sep 22 11:35:43 2010
@@ -233,6 +233,7 @@ new_node_record(void **node_baton,
void *commit_edit_baton;
char *ancestor_path;
apr_array_header_t *residual_open_path;
+ char *relpath_compose;
const char *nb_dirname;
apr_size_t residual_close_count;
int i;
@@ -355,8 +356,11 @@ new_node_record(void **node_baton,
for (i = 0; i < residual_open_path->nelts; i ++)
{
- SVN_ERR(commit_editor->open_directory(APR_ARRAY_IDX(residual_open_path,
- i, const char *),
+ relpath_compose =
+ svn_relpath_join(rb->db->relpath,
+ APR_ARRAY_IDX(residual_open_path, i, const char *),
+ rb->pool);
+ SVN_ERR(commit_editor->open_directory(relpath_compose,
rb->db->baton,
rb->rev - 1,
rb->pool, &child_baton));
@@ -364,10 +368,7 @@ new_node_record(void **node_baton,
child_db = apr_pcalloc(rb->pool, sizeof(*child_db));
child_db->baton = child_baton;
child_db->depth = rb->db->depth + 1;
- child_db->relpath = svn_relpath_join(rb->db->relpath,
- APR_ARRAY_IDX(residual_open_path,
- i, const char *),
- rb->pool);
+ child_db->relpath = relpath_compose;
child_db->parent = rb->db;
rb->db = child_db;
}
@@ -470,14 +471,21 @@ set_node_property(void *baton,
commit_editor = nb->rb->pb->commit_editor;
pool = nb->rb->pool;
- LDR_DBG(("Applying properties on %p\n", nb->file_baton));
- if (nb->kind == svn_node_file)
- SVN_ERR(commit_editor->change_file_prop(nb->file_baton, name,
- value, pool));
- else
- SVN_ERR(commit_editor->change_dir_prop(nb->rb->db->baton, name,
- value, pool));
-
+ switch (nb->kind)
+ {
+ case svn_node_file:
+ LDR_DBG(("Applying properties on %p\n", nb->file_baton));
+ SVN_ERR(commit_editor->change_file_prop(nb->file_baton, name,
+ value, pool));
+ break;
+ case svn_node_dir:
+ LDR_DBG(("Applying properties on %p\n", nb->rb->db->baton));
+ SVN_ERR(commit_editor->change_dir_prop(nb->rb->db->baton, name,
+ value, pool));
+ break;
+ default:
+ break;
+ }
return SVN_NO_ERROR;
}
Modified: subversion/branches/atomic-revprop/subversion/svnserve/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svnserve/cyrus_auth.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svnserve/cyrus_auth.c (original)
+++ subversion/branches/atomic-revprop/subversion/svnserve/cyrus_auth.c Wed Sep 22 11:35:43 2010
@@ -361,7 +361,7 @@ svn_error_t *cyrus_auth_request(svn_ra_s
if ((p = strchr(user, '@')) != NULL)
/* Drop the realm part. */
- b->user = apr_pstrndup(b->pool, user, p - (char *)user);
+ b->user = apr_pstrndup(b->pool, user, p - (const char *)user);
else
{
svn_error_t *err;
Modified: subversion/branches/atomic-revprop/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/cmdline/svnrdump_tests.py?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/atomic-revprop/subversion/tests/cmdline/svnrdump_tests.py Wed Sep 22 11:35:43 2010
@@ -167,6 +167,10 @@ def revision_0_load(sbox):
# docs/ (Added r6)
# README (Added r6)
+def skeleton_dump(sbox):
+ "dump: skeleton repository"
+ run_dump_test(sbox, "skeleton.dump")
+
def skeleton_load(sbox):
"load: skeleton repository"
run_load_test(sbox, "skeleton.dump")
@@ -219,6 +223,22 @@ def tag_empty_trunk_load(sbox):
"load: tag empty trunk"
run_load_test(sbox, "tag-empty-trunk.dump")
+def tag_trunk_with_file_dump(sbox):
+ "dump: tag trunk containing a file"
+ run_dump_test(sbox, "tag-trunk-with-file.dump")
+
+def tag_trunk_with_file_load(sbox):
+ "load: tag trunk containing a file"
+ run_load_test(sbox, "tag-trunk-with-file.dump")
+
+def tag_trunk_with_file2_dump(sbox):
+ "dump: tag trunk containing a file (#2)"
+ run_dump_test(sbox, "tag-trunk-with-file2.dump")
+
+def tag_trunk_with_file2_load(sbox):
+ "load: tag trunk containing a file (#2)"
+ run_load_test(sbox, "tag-trunk-with-file2.dump")
+
def dir_prop_change_dump(sbox):
"dump: directory property changes"
run_dump_test(sbox, "dir-prop-change.dump")
@@ -251,6 +271,14 @@ def url_encoding_load(sbox):
"load: url encoding issues"
run_load_test(sbox, "url-encoding-bug.dump")
+def commit_a_copy_of_root_dump(sbox):
+ "dump: commit a copy of root"
+ run_dump_test(sbox, "repo-with-copy-of-root-dir.dump")
+
+def commit_a_copy_of_root_load(sbox):
+ "load: commit a copy of root"
+ run_load_test(sbox, "repo-with-copy-of-root-dir.dump")
+
########################################################################
# Run the tests
@@ -260,6 +288,7 @@ test_list = [ None,
basic_dump,
revision_0_dump,
revision_0_load,
+ skeleton_dump,
skeleton_load,
copy_and_modify_dump,
copy_and_modify_load,
@@ -269,18 +298,24 @@ test_list = [ None,
modified_in_place_load,
tag_empty_trunk_dump,
tag_empty_trunk_load,
+ tag_trunk_with_file_dump,
+ tag_trunk_with_file_load,
+ tag_trunk_with_file2_dump,
+ tag_trunk_with_file2_load,
dir_prop_change_dump,
- dir_prop_change_load,
+ Wimp("TODO", dir_prop_change_load, svntest.main.is_ra_type_dav),
copy_parent_modify_prop_dump,
copy_parent_modify_prop_load,
url_encoding_dump,
url_encoding_load,
copy_revprops_dump,
- Wimp("TODO", copy_revprops_load),
+ copy_revprops_load,
no_author_dump,
no_author_load,
- Wimp("TODO", move_and_modify_in_the_same_revision_dump),
- Wimp("TODO", move_and_modify_in_the_same_revision_load),
+ move_and_modify_in_the_same_revision_dump,
+ move_and_modify_in_the_same_revision_load,
+ commit_a_copy_of_root_dump,
+ commit_a_copy_of_root_load,
]
if __name__ == '__main__':
Modified: subversion/branches/atomic-revprop/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/cmdline/switch_tests.py?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/atomic-revprop/subversion/tests/cmdline/switch_tests.py Wed Sep 22 11:35:43 2010
@@ -1049,18 +1049,25 @@ def commit_mods_below_switch(sbox):
def relocate_beyond_repos_root(sbox):
"relocate with prefixes longer than repo root"
- sbox.build(read_only = True)
+ sbox.build(read_only=True, create_wc=False)
+
+ wc_backup = sbox.add_wc_path('backup')
wc_dir = sbox.wc_dir
repo_dir = sbox.repo_dir
repo_url = sbox.repo_url
other_repo_dir, other_repo_url = sbox.add_repo_path('other')
- svntest.main.copy_repos(repo_dir, other_repo_dir, 1, 0)
-
A_url = repo_url + "/A"
+ A_wc_dir = wc_dir
other_A_url = other_repo_url + "/A"
other_B_url = other_repo_url + "/B"
- A_wc_dir = os.path.join(wc_dir, "A")
+
+ svntest.main.safe_rmtree(wc_dir, 1)
+ svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
+ repo_url + '/A', wc_dir)
+
+ svntest.main.copy_repos(repo_dir, other_repo_dir, 1, 0)
+
# A relocate that changes the repo path part of the URL shouldn't work.
# This tests for issue #2380.
@@ -2959,7 +2966,7 @@ def single_file_relocate(sbox):
svntest.main.copy_repos(repo_dir, other_repo_dir, 1, 0)
svntest.main.safe_rmtree(repo_dir, 1)
svntest.actions.run_and_verify_svn(None, None,
- ".*Cannot relocate a single file\n",
+ ".*Cannot relocate.*",
'switch', '--relocate',
iota_url, other_iota_url, iota_path)
Modified: subversion/branches/atomic-revprop/subversion/tests/libsvn_subr/cache-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/libsvn_subr/cache-test.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/tests/libsvn_subr/cache-test.c (original)
+++ subversion/branches/atomic-revprop/subversion/tests/libsvn_subr/cache-test.c Wed Sep 22 11:35:43 2010
@@ -71,11 +71,12 @@ deserialize_revnum(void **out,
apr_size_t data_len,
apr_pool_t *pool)
{
- svn_revnum_t *in_rev, *out_rev;
+ const svn_revnum_t *in_rev = (const svn_revnum_t *) data;
+ svn_revnum_t *out_rev;
+
if (data_len != sizeof(*in_rev))
return svn_error_create(SVN_ERR_REVNUM_PARSE_FAILURE, NULL,
_("Bad size for revision number in cache"));
- in_rev = (svn_revnum_t *) data;
out_rev = apr_palloc(pool, sizeof(*out_rev));
*out_rev = *in_rev;
*out = out_rev;
Modified: subversion/branches/atomic-revprop/subversion/tests/libsvn_subr/target-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/libsvn_subr/target-test.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/tests/libsvn_subr/target-test.c (original)
+++ subversion/branches/atomic-revprop/subversion/tests/libsvn_subr/target-test.c Wed Sep 22 11:35:43 2010
@@ -64,7 +64,8 @@ condense_targets_tests_helper(const char
apr_array_header_t *targets;
apr_array_header_t *condensed_targets;
const char *common_path, *common_path2, *curdir;
- char *token, *iter, *exp_common_abs = (char*)exp_common;
+ char *token, *iter;
+ const char *exp_common_abs = exp_common;
int i;
char buf[8192];
Modified: subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/db-test.c?rev=999881&r1=999880&r2=999881&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/db-test.c Wed Sep 22 11:35:43 2010
@@ -419,7 +419,7 @@ static const char * const TESTING_DATA =
" null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-d', 1, 'J', 2, 'moved/file', 2, 'normal', null,"
- " 1, null, 'file', 2, " TIME_2s ", '" AUTHOR_2 "', '$md5 $ " MD5_1 " ',"
+ " 1, null, 'file', 2, " TIME_2s ", '" AUTHOR_2 "', '$md5 $" MD5_1 "',"
" '()', 10, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-e', 1, 'J', null, null, null, 'not-present', null,"
@@ -486,17 +486,15 @@ static const char * const TESTING_DATA =
" null, null, null, null, null, "
" null, null, null, 0, null, null, '()', 0); "
#endif
-#ifdef SVN_WC__NODES_not_enabled_yet
+#ifdef SVN_WC__NODES
"insert into nodes values ("
- " 1, 'M', null, null, '', 'normal', 'dir', "
- " 1, null, null, "
- " 1, " TIME_1s ", '" AUTHOR_1 "', null, null, null, '()', null, null, "
- " null); "
+ " 1, 'M', 0, '', null, null, null, 'normal', null, "
+ " 1, null, 'dir', 1, " TIME_1s ", '" AUTHOR_1 "', null, '()', "
+ " null, null, null, null, null);"
"insert into nodes values ("
- " 1, 'M/M-a', 'M', 'not-present', 'file', "
- " null, null, "
- " null, null, null, null, null, "
- " null, null, null, 0, null, null, '()', 0); "
+ " 1, 'M/M-a', 1, 'M', null, null, null, 'not-present', null, "
+ " null, null, 'file', null, null, null, null, '()', "
+ " null, 0, null, null, null);"
#endif
);