You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/03/06 12:10:05 UTC
svn commit: r1453290 [4/15] - in /subversion/branches/fsfs-format7: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
subversion/bindings/javahl/native/
subversion/bindings/javahl/src/org/apache/subversion/javahl/
subversion/bindin...
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/mergeinfo.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/mergeinfo.c Wed Mar 6 11:10:01 2013
@@ -161,6 +161,9 @@ svn_client__record_wc_mergeinfo_catalog(
apr_array_header_t *sorted_cat =
svn_sort__hash(result_catalog, svn_sort_compare_items_as_paths,
scratch_pool);
+
+ /* Write the mergeinfo out in sorted order of the paths (presumably just
+ * so that the notifications are in a predictable, convenient order). */
for (i = 0; i < sorted_cat->nelts; i++)
{
svn_sort__item_t elt = APR_ARRAY_IDX(sorted_cat, i,
@@ -217,8 +220,10 @@ svn_client__get_wc_mergeinfo(svn_mergein
if (limit_abspath)
SVN_ERR_ASSERT(svn_dirent_is_absolute(limit_abspath));
- SVN_ERR(svn_wc__node_get_base(&base_revision, NULL, NULL, NULL, NULL,
+ SVN_ERR(svn_wc__node_get_base(NULL, &base_revision, NULL, NULL, NULL, NULL,
ctx->wc_ctx, local_abspath,
+ TRUE /* ignore_enoent */,
+ FALSE /* show_hidden */,
scratch_pool, scratch_pool));
iterpool = svn_pool_create(scratch_pool);
@@ -286,9 +291,15 @@ svn_client__get_wc_mergeinfo(svn_mergein
walk_relpath, result_pool);
local_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
- SVN_ERR(svn_wc__node_get_base(&parent_base_rev, NULL, NULL, NULL,
- NULL, ctx->wc_ctx, local_abspath,
+ SVN_ERR(svn_wc__node_get_base(NULL, &parent_base_rev, NULL, NULL,
+ NULL, NULL,
+ ctx->wc_ctx, local_abspath,
+ TRUE, FALSE,
scratch_pool, scratch_pool));
+
+ /* ### This checks the WORKING changed_rev, so invalid on replacement
+ ### not even reliable in case an ancestor was copied from a
+ ### different location */
SVN_ERR(svn_wc__node_get_changed_info(&parent_changed_rev,
NULL, NULL,
ctx->wc_ctx, local_abspath,
@@ -677,9 +688,9 @@ svn_client__get_wc_or_repos_mergeinfo_ca
if (! ra_session)
{
sesspool = svn_pool_create(scratch_pool);
- SVN_ERR(svn_client__open_ra_session_internal(
- &ra_session, NULL, url, NULL, NULL, FALSE,
- TRUE, ctx, sesspool));
+ SVN_ERR(svn_client_open_ra_session2(&ra_session, url, NULL,
+ ctx,
+ sesspool, sesspool));
}
SVN_ERR(svn_client__get_repos_mergeinfo_catalog(
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/mergeinfo.h?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/mergeinfo.h Wed Mar 6 11:10:01 2013
@@ -339,7 +339,12 @@ svn_client__record_wc_mergeinfo(const ch
svn_client_ctx_t *ctx,
apr_pool_t *scratch_pool);
-/* Write mergeinfo into the WC. RESULT_CATALOG maps (const char *) WC paths
+/* Write mergeinfo into the WC.
+ *
+ * For each path in RESULT_CATALOG, set the SVN_PROP_MERGEINFO
+ * property to represent the given mergeinfo, or remove the property
+ * if the given mergeinfo is null, and notify the change. Leave
+ * other paths unchanged. RESULT_CATALOG maps (const char *) WC paths
* to (svn_mergeinfo_t) mergeinfo. */
svn_error_t *
svn_client__record_wc_mergeinfo_catalog(apr_hash_t *result_catalog,
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/patch.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/patch.c Wed Mar 6 11:10:01 2013
@@ -2361,47 +2361,36 @@ create_missing_parents(patch_target_t *t
{
const char *component;
svn_node_kind_t wc_kind, disk_kind;
- svn_boolean_t is_deleted;
svn_pool_clear(iterpool);
component = APR_ARRAY_IDX(components, i, const char *);
local_abspath = svn_dirent_join(local_abspath, component, scratch_pool);
- SVN_ERR(svn_wc_read_kind(&wc_kind, ctx->wc_ctx, local_abspath, TRUE,
- iterpool));
+ SVN_ERR(svn_wc_read_kind2(&wc_kind, ctx->wc_ctx, local_abspath,
+ FALSE, TRUE, iterpool));
SVN_ERR(svn_io_check_path(local_abspath, &disk_kind, iterpool));
- if (wc_kind != svn_node_none)
- SVN_ERR(svn_wc__node_is_status_deleted(&is_deleted,
- ctx->wc_ctx,
- local_abspath,
- iterpool));
- else
- is_deleted = FALSE;
-
- if (disk_kind == svn_node_file
- || (wc_kind == svn_node_file && !is_deleted))
+ if (disk_kind == svn_node_file || wc_kind == svn_node_file)
{
/* on-disk files and missing files are obstructions */
target->skipped = TRUE;
break;
}
- else if (wc_kind == svn_node_dir)
+ else if (disk_kind == svn_node_dir)
{
- if (is_deleted)
+ if (wc_kind == svn_node_dir)
+ present_components++;
+ else
{
target->skipped = TRUE;
break;
}
-
- /* continue one level deeper */
- present_components++;
}
- else if (disk_kind == svn_node_dir)
+ else if (wc_kind != svn_node_none)
{
- /* Obstructed. ### BH: why? We can just add a directory */
+ /* Node is missing */
target->skipped = TRUE;
break;
}
@@ -2412,7 +2401,6 @@ create_missing_parents(patch_target_t *t
break;
}
}
-
if (! target->skipped)
{
local_abspath = abs_wc_path;
@@ -2504,37 +2492,53 @@ install_patched_target(patch_target_t *t
else
{
svn_node_kind_t parent_db_kind;
-
- if (target->added)
+ if (target->added || target->replaced)
{
+ const char *parent_abspath;
+
+ parent_abspath = svn_dirent_dirname(target->local_abspath,
+ pool);
/* If the target's parent directory does not yet exist
* we need to create it before we can copy the patched
* result in place. */
- SVN_ERR(svn_wc_read_kind(&parent_db_kind, ctx->wc_ctx,
- svn_dirent_dirname(target->local_abspath,
- pool),
- FALSE, pool));
-
- /* We don't allow targets to be added under dirs scheduled for
- * deletion. */
- if (parent_db_kind == svn_node_dir)
- {
- const char *parent_abspath;
- svn_boolean_t is_deleted;
-
- parent_abspath = svn_dirent_dirname(target->local_abspath,
- pool);
- SVN_ERR(svn_wc__node_is_status_deleted(&is_deleted, ctx->wc_ctx,
- parent_abspath, pool));
- if (is_deleted)
+ SVN_ERR(svn_wc_read_kind2(&parent_db_kind, ctx->wc_ctx,
+ parent_abspath, FALSE, FALSE, pool));
+
+ /* We can't add targets under nodes scheduled for delete, so add
+ a new directory if needed. */
+ if (parent_db_kind == svn_node_dir
+ || parent_db_kind == svn_node_file)
+ {
+ if (parent_db_kind != svn_node_dir)
+ target->skipped = TRUE;
+ else
{
- target->skipped = TRUE;
- return SVN_NO_ERROR;
+ svn_node_kind_t disk_kind;
+
+ SVN_ERR(svn_io_check_path(parent_abspath, &disk_kind, pool));
+ if (disk_kind != svn_node_dir)
+ target->skipped = TRUE;
}
}
else
SVN_ERR(create_missing_parents(target, abs_wc_path, ctx,
dry_run, pool));
+
+ }
+ else
+ {
+ svn_node_kind_t wc_kind;
+
+ /* The target should exist */
+ SVN_ERR(svn_wc_read_kind2(&wc_kind, ctx->wc_ctx,
+ target->local_abspath,
+ FALSE, FALSE, pool));
+
+ if (target->kind_on_disk == svn_node_none
+ || wc_kind != target->kind_on_disk)
+ {
+ target->skipped = TRUE;
+ }
}
if (! dry_run && ! target->skipped)
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/prop_commands.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/prop_commands.c Wed Mar 6 11:10:01 2013
@@ -156,9 +156,8 @@ propset_on_url(const char *propname,
/* Open an RA session for the URL. Note that we don't have a local
directory, nor a place to put temp files. */
- SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, target,
- NULL, NULL, FALSE, TRUE,
- ctx, pool));
+ SVN_ERR(svn_client_open_ra_session2(&ra_session, target, NULL,
+ ctx, pool, pool));
SVN_ERR(svn_ra_check_path(ra_session, "", base_revision_for_url,
&node_kind, pool));
@@ -307,7 +306,6 @@ svn_client_propset_local(const char *pro
{
svn_node_kind_t kind;
const char *target_abspath;
- svn_error_t *err;
const char *target = APR_ARRAY_IDX(targets, i, const char *);
svn_pool_clear(iterpool);
@@ -318,11 +316,11 @@ svn_client_propset_local(const char *pro
SVN_ERR(svn_dirent_get_absolute(&target_abspath, target, iterpool));
- err = svn_wc_read_kind(&kind, ctx->wc_ctx, target_abspath, FALSE,
- iterpool);
+ /* Call prop_set for deleted nodes to have special errors */
+ SVN_ERR(svn_wc_read_kind2(&kind, ctx->wc_ctx, target_abspath,
+ FALSE, FALSE, iterpool));
- if ((err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
- || (!err && (kind == svn_node_unknown || kind == svn_node_none)))
+ if (kind == svn_node_unknown || kind == svn_node_none)
{
if (ctx->notify_func2)
{
@@ -335,8 +333,6 @@ svn_client_propset_local(const char *pro
}
}
- SVN_ERR(err);
-
SVN_WC__CALL_WITH_WRITE_LOCK(
svn_wc_prop_set4(ctx->wc_ctx, target_abspath, propname,
propval, depth, skip_checks, changelists,
@@ -471,10 +467,9 @@ svn_client_revprop_set2(const char *prop
return svn_error_createf(SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
_("Bad property name: '%s'"), propname);
- /* Open an RA session for the URL. Note that we don't have a local
- directory, nor a place to put temp files. */
- SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, URL, NULL,
- NULL, FALSE, TRUE, ctx, pool));
+ /* Open an RA session for the URL. */
+ SVN_ERR(svn_client_open_ra_session2(&ra_session, URL, NULL,
+ ctx, pool, pool));
/* Resolve the revision into something real, and return that to the
caller as well. */
@@ -523,51 +518,6 @@ svn_client_revprop_set2(const char *prop
return SVN_NO_ERROR;
}
-
-/* Set *PROPS to the pristine (base) properties at LOCAL_ABSPATH, if PRISTINE
- * is true, or else the working value if PRISTINE is false.
- *
- * The keys of *PROPS will be 'const char *' property names, and the
- * values 'const svn_string_t *' property values. Allocate *PROPS
- * and its contents in RESULT_POOL. Use SCRATCH_POOL for temporary
- * allocations.
- */
-static svn_error_t *
-pristine_or_working_props(apr_hash_t **props,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- svn_boolean_t pristine,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- if (pristine)
- {
- return svn_error_trace(svn_wc_get_pristine_props(props,
- wc_ctx,
- local_abspath,
- result_pool,
- scratch_pool));
- }
-
- /* ### until svn_wc_prop_list2() returns a NULL value for locally-deleted
- ### nodes, then let's check manually. */
- {
- svn_boolean_t deleted;
-
- SVN_ERR(svn_wc__node_is_status_deleted(&deleted, wc_ctx, local_abspath,
- scratch_pool));
- if (deleted)
- {
- *props = NULL;
- return SVN_NO_ERROR;
- }
- }
-
- return svn_error_trace(svn_wc_prop_list2(props, wc_ctx, local_abspath,
- result_pool, scratch_pool));
-}
-
-
/* Helper for the remote case of svn_client_propget.
*
* If PROPS is not null, then get the value of property PROPNAME in REVNUM,
@@ -873,8 +823,9 @@ svn_client_propget5(apr_hash_t **props,
pristine = (revision->kind == svn_opt_revision_committed
|| revision->kind == svn_opt_revision_base);
- SVN_ERR(svn_wc_read_kind(&kind, ctx->wc_ctx, target, FALSE,
- scratch_pool));
+ SVN_ERR(svn_wc_read_kind2(&kind, ctx->wc_ctx, target,
+ pristine, FALSE,
+ scratch_pool));
if (kind == svn_node_unknown || kind == svn_node_none)
{
@@ -1039,19 +990,25 @@ svn_client_revprop_get(const char *propn
apr_pool_t *pool)
{
svn_ra_session_t *ra_session;
+ apr_pool_t *subpool = svn_pool_create(pool);
+ svn_error_t *err;
/* Open an RA session for the URL. Note that we don't have a local
directory, nor a place to put temp files. */
- SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, URL, NULL,
- NULL, FALSE, TRUE, ctx, pool));
+ SVN_ERR(svn_client_open_ra_session2(&ra_session, URL, NULL,
+ ctx, subpool, subpool));
/* Resolve the revision into something real, and return that to the
caller as well. */
SVN_ERR(svn_client__get_revision_number(set_rev, NULL, ctx->wc_ctx, NULL,
- ra_session, revision, pool));
+ ra_session, revision, subpool));
/* The actual RA call. */
- return svn_ra_rev_prop(ra_session, *set_rev, propname, propval, pool);
+ err = svn_ra_rev_prop(ra_session, *set_rev, propname, propval, pool);
+
+ /* Close RA session */
+ svn_pool_destroy(subpool);
+ return svn_error_trace(err);
}
@@ -1109,12 +1066,12 @@ remote_proplist(const char *target_prefi
svn_depth_t depth,
svn_proplist_receiver2_t receiver,
void *receiver_baton,
- apr_pool_t *result_pool,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
apr_pool_t *scratch_pool)
{
apr_hash_t *dirents;
apr_hash_t *prop_hash = NULL;
- apr_hash_t *final_hash = NULL;
apr_hash_index_t *hi;
const char *target_full_url =
svn_path_url_add_component2(target_prefix, target_relative, scratch_pool);
@@ -1148,12 +1105,12 @@ remote_proplist(const char *target_prefi
SVN_ERR(svn_ra_get_inherited_props(ra_session, &inherited_props,
target_relative, revnum,
- result_pool, scratch_pool));
+ scratch_pool, scratch_pool));
SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root_url,
scratch_pool));
SVN_ERR(svn_client__iprop_relpaths_to_urls(inherited_props,
repos_root_url,
- result_pool,
+ scratch_pool,
scratch_pool));
}
else
@@ -1161,41 +1118,39 @@ remote_proplist(const char *target_prefi
inherited_props = NULL;
}
- if (get_explicit_props)
+ if (!get_explicit_props)
+ prop_hash = NULL;
+ else
{
/* Filter out non-regular properties, since the RA layer returns all
kinds. Copy regular properties keys/vals from the prop_hash
allocated in SCRATCH_POOL to the "final" hash allocated in
RESULT_POOL. */
- final_hash = apr_hash_make(result_pool);
for (hi = apr_hash_first(scratch_pool, prop_hash);
hi;
hi = apr_hash_next(hi))
{
const char *name = svn__apr_hash_index_key(hi);
apr_ssize_t klen = svn__apr_hash_index_klen(hi);
- svn_string_t *value = svn__apr_hash_index_val(hi);
svn_prop_kind_t prop_kind;
-
+
prop_kind = svn_property_kind2(name);
-
- if (prop_kind == svn_prop_regular_kind)
+
+ if (prop_kind != svn_prop_regular_kind)
{
- name = apr_pstrdup(result_pool, name);
- value = svn_string_dup(value, result_pool);
- apr_hash_set(final_hash, name, klen, value);
+ apr_hash_set(prop_hash, name, klen, NULL);
}
- }
+ }
}
- SVN_ERR(call_receiver(target_full_url, final_hash, inherited_props,
- receiver, receiver_baton, result_pool));
+ SVN_ERR(call_receiver(target_full_url, prop_hash, inherited_props,
+ receiver, receiver_baton, scratch_pool));
if (depth > svn_depth_empty
&& get_explicit_props
&& (kind == svn_node_dir) && (apr_hash_count(dirents) > 0))
{
- apr_pool_t *subpool = svn_pool_create(scratch_pool);
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
for (hi = apr_hash_first(scratch_pool, dirents);
hi;
@@ -1205,10 +1160,13 @@ remote_proplist(const char *target_prefi
svn_dirent_t *this_ent = svn__apr_hash_index_val(hi);
const char *new_target_relative;
- svn_pool_clear(subpool);
+ if (cancel_func)
+ SVN_ERR(cancel_func(cancel_baton));
+
+ svn_pool_clear(iterpool);
new_target_relative = svn_relpath_join(target_relative,
- this_name, subpool);
+ this_name, iterpool);
if (this_ent->kind == svn_node_file
|| depth > svn_depth_files)
@@ -1223,17 +1181,16 @@ remote_proplist(const char *target_prefi
this_ent->kind,
revnum,
ra_session,
- TRUE,
- FALSE,
+ TRUE /* get_explicit_props */,
+ FALSE /* get_target_inherited_props */,
depth_below_here,
- receiver,
- receiver_baton,
- result_pool,
- subpool));
+ receiver, receiver_baton,
+ cancel_func, cancel_baton,
+ iterpool));
}
}
- svn_pool_destroy(subpool);
+ svn_pool_destroy(iterpool);
}
return SVN_NO_ERROR;
@@ -1294,7 +1251,6 @@ get_remote_props(const char *path_or_url
svn_proplist_receiver2_t receiver,
void *receiver_baton,
svn_client_ctx_t *ctx,
- apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
svn_ra_session_t *ra_session;
@@ -1331,7 +1287,7 @@ get_remote_props(const char *path_or_url
ctx->wc_ctx,
local_abspath,
FALSE, /* scan_deleted */
- result_pool,
+ scratch_pool,
scratch_pool));
if (repos_relpath)
{
@@ -1384,16 +1340,17 @@ get_remote_props(const char *path_or_url
path_or_url, NULL,
peg_revision,
revision, ctx,
- result_pool));
+ scratch_pool));
SVN_ERR(svn_ra_check_path(ra_session, "", loc->rev, &kind,
- result_pool));
+ scratch_pool));
SVN_ERR(remote_proplist(loc->url, "", kind, loc->rev, ra_session,
get_explicit_props,
get_target_inherited_props,
depth, receiver, receiver_baton,
- result_pool, scratch_pool));
+ ctx->cancel_func, ctx->cancel_baton,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -1409,7 +1366,6 @@ get_local_props(const char *path_or_url,
svn_proplist_receiver2_t receiver,
void *receiver_baton,
svn_client_ctx_t *ctx,
- apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
svn_boolean_t pristine;
@@ -1423,8 +1379,8 @@ get_local_props(const char *path_or_url,
pristine = ((revision->kind == svn_opt_revision_committed)
|| (revision->kind == svn_opt_revision_base));
- SVN_ERR(svn_wc_read_kind(&kind, ctx->wc_ctx, local_abspath, FALSE,
- scratch_pool));
+ SVN_ERR(svn_wc_read_kind2(&kind, ctx->wc_ctx, local_abspath,
+ pristine, FALSE, scratch_pool));
if (kind == svn_node_unknown || kind == svn_node_none)
{
@@ -1479,18 +1435,38 @@ get_local_props(const char *path_or_url,
SVN_ERR(svn_wc__prop_list_recursive(ctx->wc_ctx, local_abspath, NULL,
depth, pristine, changelists,
recursive_proplist_receiver, &rb,
- ctx->cancel_func,
- ctx->cancel_baton, result_pool));
+ ctx->cancel_func, ctx->cancel_baton,
+ scratch_pool));
}
else if (svn_wc__changelist_match(ctx->wc_ctx, local_abspath,
changelist_hash, scratch_pool))
{
- apr_hash_t *hash;
+ apr_hash_t *props;
- SVN_ERR(pristine_or_working_props(&hash, ctx->wc_ctx, local_abspath,
- pristine, result_pool,
- scratch_pool));
- SVN_ERR(call_receiver(path_or_url, hash, NULL,
+ if (pristine)
+ SVN_ERR(svn_wc_get_pristine_props(&props,
+ ctx->wc_ctx, local_abspath,
+ scratch_pool, scratch_pool));
+ else
+ {
+ svn_error_t *err;
+
+ err = svn_wc_prop_list2(&props, ctx->wc_ctx, local_abspath,
+ scratch_pool, scratch_pool);
+
+
+ if (err)
+ {
+ if (err->apr_err != SVN_ERR_WC_PATH_UNEXPECTED_STATUS)
+ return svn_error_trace(err);
+ /* As svn_wc_prop_list2() doesn't return NULL for locally-deleted
+ let's do that here. */
+ svn_error_clear(err);
+ props = apr_hash_make(scratch_pool);
+ }
+ }
+
+ SVN_ERR(call_receiver(path_or_url, props, NULL,
receiver, receiver_baton, scratch_pool));
}
@@ -1507,7 +1483,6 @@ svn_client_proplist4(const char *path_or
svn_proplist_receiver2_t receiver,
void *receiver_baton,
svn_client_ctx_t *ctx,
- apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
svn_boolean_t local_explicit_props;
@@ -1526,7 +1501,7 @@ svn_client_proplist4(const char *path_or
&& SVN_CLIENT__REVKIND_IS_LOCAL_TO_WC(peg_revision->kind)
&& SVN_CLIENT__REVKIND_IS_LOCAL_TO_WC(revision->kind));
- /* If we want iprops are they avaiable locally? */
+ /* If we want iprops are they available locally? */
local_iprops =
(get_target_inherited_props /* We want iprops */
&& local_explicit_props /* No local explicit props means no local iprops. */
@@ -1541,15 +1516,14 @@ svn_client_proplist4(const char *path_or
SVN_ERR(get_remote_props(path_or_url, peg_revision, revision, depth,
!local_explicit_props,
(get_target_inherited_props && !local_iprops),
- receiver, receiver_baton, ctx, result_pool,
- scratch_pool));
+ receiver, receiver_baton, ctx, scratch_pool));
}
if (local_explicit_props)
{
SVN_ERR(get_local_props(path_or_url, revision, depth, changelists,
local_iprops, receiver, receiver_baton, ctx,
- result_pool, scratch_pool));
+ scratch_pool));
}
return SVN_NO_ERROR;
@@ -1565,20 +1539,23 @@ svn_client_revprop_list(apr_hash_t **pro
{
svn_ra_session_t *ra_session;
apr_hash_t *proplist;
+ apr_pool_t *subpool = svn_pool_create(pool);
+ svn_error_t *err;
/* Open an RA session for the URL. Note that we don't have a local
directory, nor a place to put temp files. */
- SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, URL, NULL,
- NULL, FALSE, TRUE, ctx, pool));
+ SVN_ERR(svn_client_open_ra_session2(&ra_session, URL, NULL,
+ ctx, subpool, subpool));
/* Resolve the revision into something real, and return that to the
caller as well. */
SVN_ERR(svn_client__get_revision_number(set_rev, NULL, ctx->wc_ctx, NULL,
- ra_session, revision, pool));
+ ra_session, revision, subpool));
/* The actual RA call. */
- SVN_ERR(svn_ra_rev_proplist(ra_session, *set_rev, &proplist, pool));
+ err = svn_ra_rev_proplist(ra_session, *set_rev, &proplist, pool);
*props = proplist;
- return SVN_NO_ERROR;
+ svn_pool_destroy(subpool); /* Close RA session */
+ return svn_error_trace(err);
}
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/ra.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/ra.c Wed Mar 6 11:10:01 2013
@@ -59,6 +59,9 @@ typedef struct callback_baton_t
happens to work most of the time but is ultimately incorrect. */
svn_boolean_t base_dir_isversioned;
+ /* Used as wri_abspath for obtaining access to the pristine store */
+ const char *wcroot_abspath;
+
/* An array of svn_client_commit_item3_t * structures, present only
during working copy commits. */
const apr_array_header_t *commit_items;
@@ -250,7 +253,7 @@ get_wc_contents(void *baton,
{
callback_baton_t *cb = baton;
- if (! (cb->base_dir_abspath && cb->base_dir_isversioned))
+ if (! cb->wcroot_abspath)
{
*contents = NULL;
return SVN_NO_ERROR;
@@ -259,7 +262,7 @@ get_wc_contents(void *baton,
return svn_error_trace(
svn_wc__get_pristine_contents_by_checksum(contents,
cb->ctx->wc_ctx,
- cb->base_dir_abspath,
+ cb->wcroot_abspath,
checksum,
pool, pool));
}
@@ -292,42 +295,47 @@ svn_client__open_ra_session_internal(svn
const char *base_url,
const char *base_dir_abspath,
const apr_array_header_t *commit_items,
- svn_boolean_t use_admin,
- svn_boolean_t read_only_wc,
+ svn_boolean_t write_dav_props,
+ svn_boolean_t read_dav_props,
svn_client_ctx_t *ctx,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_ra_callbacks2_t *cbtable;
- callback_baton_t *cb = apr_pcalloc(pool, sizeof(*cb));
+ callback_baton_t *cb = apr_pcalloc(result_pool, sizeof(*cb));
const char *uuid = NULL;
- SVN_ERR_ASSERT(base_dir_abspath != NULL || ! use_admin);
+ SVN_ERR_ASSERT(!write_dav_props || read_dav_props);
+ SVN_ERR_ASSERT(!read_dav_props || base_dir_abspath != NULL);
SVN_ERR_ASSERT(base_dir_abspath == NULL
|| svn_dirent_is_absolute(base_dir_abspath));
- SVN_ERR(svn_ra_create_callbacks(&cbtable, pool));
+ SVN_ERR(svn_ra_create_callbacks(&cbtable, result_pool));
cbtable->open_tmp_file = open_tmp_file;
- cbtable->get_wc_prop = use_admin ? get_wc_prop : NULL;
- cbtable->set_wc_prop = read_only_wc ? NULL : set_wc_prop;
+ cbtable->get_wc_prop = read_dav_props ? get_wc_prop : NULL;
+ cbtable->set_wc_prop = (write_dav_props && read_dav_props)
+ ? set_wc_prop : NULL;
cbtable->push_wc_prop = commit_items ? push_wc_prop : NULL;
- cbtable->invalidate_wc_props = read_only_wc ? NULL : invalidate_wc_props;
+ cbtable->invalidate_wc_props = (write_dav_props && read_dav_props)
+ ? invalidate_wc_props : NULL;
cbtable->auth_baton = ctx->auth_baton; /* new-style */
cbtable->progress_func = ctx->progress_func;
cbtable->progress_baton = ctx->progress_baton;
cbtable->cancel_func = ctx->cancel_func ? cancel_callback : NULL;
cbtable->get_client_string = get_client_string;
- cbtable->get_wc_contents = get_wc_contents;
+ if (base_dir_abspath)
+ cbtable->get_wc_contents = get_wc_contents;
- cb->base_dir_abspath = base_dir_abspath;
cb->commit_items = commit_items;
cb->ctx = ctx;
- if (base_dir_abspath)
+ if (base_dir_abspath && (read_dav_props || write_dav_props))
{
svn_error_t *err = svn_wc__node_get_repos_info(NULL, NULL, NULL, &uuid,
ctx->wc_ctx,
base_dir_abspath,
- pool, pool);
+ result_pool,
+ scratch_pool);
if (err && (err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY
|| err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND
@@ -341,6 +349,25 @@ svn_client__open_ra_session_internal(svn
SVN_ERR(err);
cb->base_dir_isversioned = TRUE;
}
+ cb->base_dir_abspath = apr_pstrdup(result_pool, base_dir_abspath);
+ }
+
+ if (base_dir_abspath)
+ {
+ svn_error_t *err = svn_wc__get_wcroot(&cb->wcroot_abspath,
+ ctx->wc_ctx, base_dir_abspath,
+ result_pool, scratch_pool);
+
+ if (err)
+ {
+ if (err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY
+ && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND
+ && err->apr_err != SVN_ERR_WC_UPGRADE_REQUIRED)
+ return svn_error_trace(err);
+
+ svn_error_clear(err);
+ cb->wcroot_abspath = NULL;
+ }
}
/* If the caller allows for auto-following redirections, and the
@@ -349,7 +376,7 @@ svn_client__open_ra_session_internal(svn
attempts. */
if (corrected_url)
{
- apr_hash_t *attempted = apr_hash_make(pool);
+ apr_hash_t *attempted = apr_hash_make(scratch_pool);
int attempts_left = SVN_CLIENT__MAX_REDIRECT_ATTEMPTS;
*corrected_url = NULL;
@@ -361,7 +388,8 @@ svn_client__open_ra_session_internal(svn
don't accept corrected URLs from the RA provider. */
SVN_ERR(svn_ra_open4(ra_session,
attempts_left == 0 ? NULL : &corrected,
- base_url, uuid, cbtable, cb, ctx->config, pool));
+ base_url, uuid, cbtable, cb, ctx->config,
+ result_pool));
/* No error and no corrected URL? We're done here. */
if (! corrected)
@@ -372,8 +400,9 @@ svn_client__open_ra_session_internal(svn
{
svn_wc_notify_t *notify =
svn_wc_create_notify_url(corrected,
- svn_wc_notify_url_redirect, pool);
- (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+ svn_wc_notify_url_redirect,
+ scratch_pool);
+ (*ctx->notify_func2)(ctx->notify_baton2, notify, scratch_pool);
}
/* Our caller will want to know what our final corrected URL was. */
@@ -393,7 +422,7 @@ svn_client__open_ra_session_internal(svn
else
{
SVN_ERR(svn_ra_open4(ra_session, NULL, base_url,
- uuid, cbtable, cb, ctx->config, pool));
+ uuid, cbtable, cb, ctx->config, result_pool));
}
return SVN_NO_ERROR;
@@ -402,15 +431,19 @@ svn_client__open_ra_session_internal(svn
svn_error_t *
-svn_client_open_ra_session(svn_ra_session_t **session,
- const char *url,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool)
+svn_client_open_ra_session2(svn_ra_session_t **session,
+ const char *url,
+ const char *wri_abspath,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
return svn_error_trace(
svn_client__open_ra_session_internal(session, NULL, url,
- NULL, NULL, FALSE, TRUE,
- ctx, pool));
+ wri_abspath, NULL,
+ FALSE, FALSE,
+ ctx, result_pool,
+ scratch_pool));
}
@@ -483,6 +516,7 @@ svn_client__ra_session_from_path2(svn_ra
const char *initial_url;
const char *corrected_url;
svn_client__pathrev_t *resolved_loc;
+ const char *wri_abspath;
SVN_ERR(svn_client_url_from_path2(&initial_url, path_or_url, ctx, pool,
pool));
@@ -490,12 +524,20 @@ svn_client__ra_session_from_path2(svn_ra
return svn_error_createf(SVN_ERR_ENTRY_MISSING_URL, NULL,
_("'%s' has no URL"), path_or_url);
+ if (base_dir_abspath)
+ wri_abspath = base_dir_abspath;
+ else if (!svn_path_is_url(path_or_url))
+ SVN_ERR(svn_dirent_get_absolute(&wri_abspath, path_or_url, pool));
+ else
+ wri_abspath = NULL;
+
SVN_ERR(svn_client__open_ra_session_internal(&ra_session, &corrected_url,
initial_url,
- base_dir_abspath, NULL,
+ wri_abspath,
+ NULL /* commit_items */,
+ base_dir_abspath != NULL,
base_dir_abspath != NULL,
- base_dir_abspath == NULL,
- ctx, pool));
+ ctx, pool, pool));
/* If we got a CORRECTED_URL, we'll want to refer to that as the
URL-ized form of PATH_OR_URL from now on. */
@@ -807,9 +849,8 @@ svn_client__repos_locations(const char *
/* Open a RA session to this URL if we don't have one already. */
if (! ra_session)
- SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, url, NULL,
- NULL, FALSE, TRUE,
- ctx, subpool));
+ SVN_ERR(svn_client_open_ra_session2(&ra_session, url, NULL,
+ ctx, subpool, subpool));
/* Resolve the opt_revision_ts. */
if (peg_revnum == SVN_INVALID_REVNUM)
@@ -873,7 +914,8 @@ svn_client__get_youngest_common_ancestor
if (session == NULL)
{
sesspool = svn_pool_create(scratch_pool);
- SVN_ERR(svn_client_open_ra_session(&session, loc1->url, ctx, sesspool));
+ SVN_ERR(svn_client_open_ra_session2(&session, loc1->url, NULL, ctx,
+ sesspool, sesspool));
}
/* We're going to cheat and use history-as-mergeinfo because it
@@ -1109,8 +1151,8 @@ svn_client__ra_get_copysrc_kind(svn_kind
/* ### what to do with SRC_REVISION? */
- SVN_ERR(svn_wc_read_kind(&node_kind, reb->wc_ctx, local_abspath, FALSE,
- scratch_pool));
+ SVN_ERR(svn_wc_read_kind2(&node_kind, reb->wc_ctx, local_abspath,
+ FALSE, FALSE, scratch_pool));
*kind = svn__kind_from_node_kind(node_kind, FALSE);
return SVN_NO_ERROR;
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/relocate.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/relocate.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/relocate.c Wed Mar 6 11:10:01 2013
@@ -100,13 +100,13 @@ validator_func(void *baton,
if (! url_uuid)
{
apr_pool_t *sesspool = svn_pool_create(pool);
- svn_ra_session_t *ra_session;
- SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, url, NULL,
- NULL, FALSE, TRUE,
- b->ctx, sesspool));
+
url_uuid = &APR_ARRAY_PUSH(uuids, struct url_uuid_t);
- SVN_ERR(svn_ra_get_uuid2(ra_session, &(url_uuid->uuid), pool));
- SVN_ERR(svn_ra_get_repos_root2(ra_session, &(url_uuid->root), pool));
+ SVN_ERR(svn_client_get_repos_root(&url_uuid->root,
+ &url_uuid->uuid,
+ url, b->ctx,
+ pool, sesspool));
+
svn_pool_destroy(sesspool);
}
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/resolved.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/resolved.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/resolved.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/resolved.c Wed Mar 6 11:10:01 2013
@@ -48,6 +48,8 @@ svn_client_resolve(const char *path,
apr_pool_t *pool)
{
const char *local_abspath;
+ svn_error_t *err;
+ const char *lock_abspath;
if (svn_path_is_url(path))
return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
@@ -55,19 +57,25 @@ svn_client_resolve(const char *path,
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
- SVN_WC__CALL_WITH_WRITE_LOCK(
- svn_wc__resolve_conflicts(ctx->wc_ctx, local_abspath,
- depth,
- TRUE /* resolve_text */,
- "" /* resolve_prop (ALL props) */,
- TRUE /* resolve_tree */,
- conflict_choice,
- ctx->conflict_func2,
- ctx->conflict_baton2,
- ctx->cancel_func, ctx->cancel_baton,
- ctx->notify_func2, ctx->notify_baton2,
- pool),
- ctx->wc_ctx, local_abspath, TRUE, pool);
+ /* Similar to SVN_WC__CALL_WITH_WRITE_LOCK but using a custom
+ locking function. */
- return SVN_NO_ERROR;
+ SVN_ERR(svn_wc__acquire_write_lock_for_resolve(&lock_abspath, ctx->wc_ctx,
+ local_abspath, pool, pool));
+ err = svn_wc__resolve_conflicts(ctx->wc_ctx, local_abspath,
+ depth,
+ TRUE /* resolve_text */,
+ "" /* resolve_prop (ALL props) */,
+ TRUE /* resolve_tree */,
+ conflict_choice,
+ ctx->conflict_func2,
+ ctx->conflict_baton2,
+ ctx->cancel_func, ctx->cancel_baton,
+ ctx->notify_func2, ctx->notify_baton2,
+ pool);
+
+ err = svn_error_compose_create(err, svn_wc__release_write_lock(ctx->wc_ctx,
+ lock_abspath,
+ pool));
+ return svn_error_trace(err);
}
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/status.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/status.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/status.c Wed Mar 6 11:10:01 2013
@@ -189,9 +189,8 @@ reporter_finish_report(void *report_bato
/* Open an RA session to our common ancestor and grab the locks under it.
*/
- SVN_ERR(svn_client__open_ra_session_internal(&ras, NULL, rb->ancestor, NULL,
- NULL, FALSE, TRUE,
- rb->ctx, subpool));
+ SVN_ERR(svn_client_open_ra_session2(&ras, rb->ancestor, NULL,
+ rb->ctx, subpool, subpool));
/* The locks need to live throughout the edit. Note that if the
server doesn't support lock discovery, we'll just not do locky
@@ -236,6 +235,92 @@ static svn_ra_reporter3_t lock_fetch_rep
reporter_abort_report
};
+/* Perform status operations on each external in EXTERNAL_MAP, a const char *
+ local_abspath of all externals mapping to the const char* defining_abspath.
+ All other options are the same as those passed to svn_client_status().
+
+ If ANCHOR_ABSPATH and ANCHOR-RELPATH are not null, use them to provide
+ properly formatted relative paths */
+static svn_error_t *
+do_external_status(svn_client_ctx_t *ctx,
+ apr_hash_t *external_map,
+ svn_depth_t depth,
+ svn_boolean_t get_all,
+ svn_boolean_t update,
+ svn_boolean_t no_ignore,
+ const char *anchor_abspath,
+ const char *anchor_relpath,
+ svn_client_status_func_t status_func,
+ void *status_baton,
+ apr_pool_t *scratch_pool)
+{
+ apr_hash_index_t *hi;
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+
+ /* Loop over the hash of new values (we don't care about the old
+ ones). This is a mapping of versioned directories to property
+ values. */
+ for (hi = apr_hash_first(scratch_pool, external_map);
+ hi;
+ hi = apr_hash_next(hi))
+ {
+ svn_node_kind_t external_kind;
+ const char *local_abspath = svn__apr_hash_index_key(hi);
+ const char *defining_abspath = svn__apr_hash_index_val(hi);
+ svn_node_kind_t kind;
+ svn_opt_revision_t opt_rev;
+ const char *status_path;
+
+ svn_pool_clear(iterpool);
+
+ /* Obtain information on the expected external. */
+ SVN_ERR(svn_wc__read_external_info(&external_kind, NULL, NULL, NULL,
+ &opt_rev.value.number,
+ ctx->wc_ctx, defining_abspath,
+ local_abspath, FALSE,
+ iterpool, iterpool));
+
+ if (external_kind != svn_node_dir)
+ continue;
+
+ SVN_ERR(svn_io_check_path(local_abspath, &kind, iterpool));
+ if (kind != svn_node_dir)
+ continue;
+
+ if (SVN_IS_VALID_REVNUM(opt_rev.value.number))
+ opt_rev.kind = svn_opt_revision_number;
+ else
+ opt_rev.kind = svn_opt_revision_unspecified;
+
+ /* Tell the client we're starting an external status set. */
+ if (ctx->notify_func2)
+ ctx->notify_func2(
+ ctx->notify_baton2,
+ svn_wc_create_notify(local_abspath,
+ svn_wc_notify_status_external,
+ iterpool), iterpool);
+
+ status_path = local_abspath;
+ if (anchor_abspath)
+ {
+ status_path = svn_dirent_join(anchor_relpath,
+ svn_dirent_skip_ancestor(anchor_abspath,
+ status_path),
+ iterpool);
+ }
+
+ /* And then do the status. */
+ SVN_ERR(svn_client_status5(NULL, ctx, status_path, &opt_rev, depth,
+ get_all, update, no_ignore, FALSE, FALSE,
+ NULL, status_func, status_baton,
+ iterpool));
+ }
+
+ /* Destroy SUBPOOL and (implicitly) ITERPOOL. */
+ svn_pool_destroy(iterpool);
+
+ return SVN_NO_ERROR;
+}
/*** Public Interface. ***/
@@ -289,8 +374,8 @@ svn_client_status5(svn_revnum_t *result_
svn_node_kind_t kind;
- SVN_ERR(svn_wc_read_kind(&kind, ctx->wc_ctx, target_abspath, FALSE,
- pool));
+ SVN_ERR(svn_wc_read_kind2(&kind, ctx->wc_ctx, target_abspath,
+ TRUE, FALSE, pool));
/* Dir must be a working copy directory or the status editor fails */
if (kind == svn_node_dir)
@@ -312,8 +397,8 @@ svn_client_status5(svn_revnum_t *result_
}
else
{
- err = svn_wc_read_kind(&kind, ctx->wc_ctx, dir_abspath, FALSE,
- pool);
+ err = svn_wc_read_kind2(&kind, ctx->wc_ctx, dir_abspath,
+ FALSE, FALSE, pool);
svn_error_clear(err);
@@ -372,9 +457,9 @@ svn_client_status5(svn_revnum_t *result_
/* Open a repository session to the URL. */
SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, URL,
- dir_abspath,
- NULL, FALSE, TRUE,
- ctx, pool));
+ dir_abspath, NULL,
+ FALSE, TRUE,
+ ctx, pool, pool));
SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
SVN_RA_CAPABILITY_DEPTH, pool));
@@ -527,11 +612,11 @@ svn_client_status5(svn_revnum_t *result_
pool, pool));
- SVN_ERR(svn_client__do_external_status(ctx, external_map,
- depth, get_all,
- update, no_ignore,
- sb.anchor_abspath, sb.anchor_relpath,
- status_func, status_baton, pool));
+ SVN_ERR(do_external_status(ctx, external_map,
+ depth, get_all,
+ update, no_ignore,
+ sb.anchor_abspath, sb.anchor_relpath,
+ status_func, status_baton, pool));
}
return SVN_NO_ERROR;
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/switch.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/switch.c Wed Mar 6 11:10:01 2013
@@ -168,8 +168,8 @@ switch_internal(svn_revnum_t *result_rev
return SVN_NO_ERROR;
}
- SVN_ERR(svn_wc_read_kind(&target_kind, ctx->wc_ctx, local_abspath, TRUE,
- pool));
+ SVN_ERR(svn_wc_read_kind2(&target_kind, ctx->wc_ctx, local_abspath,
+ TRUE, TRUE, pool));
if (target_kind == svn_node_dir)
SVN_ERR(svn_wc_crop_tree2(ctx->wc_ctx, local_abspath, depth,
@@ -301,21 +301,19 @@ switch_internal(svn_revnum_t *result_rev
/* Tell RA to do an update of URL+TARGET to REVISION; if we pass an
invalid revnum, that means RA will use the latest revision. */
- SVN_ERR(svn_ra_do_switch2(ra_session, &reporter, &report_baton,
+ SVN_ERR(svn_ra_do_switch3(ra_session, &reporter, &report_baton,
switch_loc->rev,
target,
depth_is_sticky ? depth : svn_depth_unknown,
switch_loc->url,
- switch_editor, switch_edit_baton, pool));
+ FALSE /* send_copyfrom_args */,
+ ignore_ancestry,
+ switch_editor, switch_edit_baton,
+ pool, pool));
/* Drive the reporter structure, describing the revisions within
PATH. When we call reporter->finish_report, the update_editor
- will be driven by svn_repos_dir_delta2.
-
- We pass in an external_func for recording all externals. It
- shouldn't be needed for a switch if it wasn't for the relative
- externals of type '../path'. All of those must be resolved to
- the new location. */
+ will be driven by svn_repos_dir_delta2. */
err = svn_wc_crawl_revisions5(ctx->wc_ctx, local_abspath, reporter,
report_baton, TRUE, depth, (! depth_is_sticky),
(! server_supports_depth),
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/update.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/update.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/update.c Wed Mar 6 11:10:01 2013
@@ -193,7 +193,10 @@ update_internal(svn_revnum_t *result_rev
void *report_baton;
const char *corrected_url;
const char *target;
- svn_client__pathrev_t *anchor_loc;
+ const char *repos_root_url;
+ const char *repos_relpath;
+ const char *repos_uuid;
+ const char *anchor_url;
svn_error_t *err;
svn_revnum_t revnum;
svn_boolean_t use_commit_times;
@@ -208,7 +211,8 @@ update_internal(svn_revnum_t *result_rev
apr_array_header_t *preserved_exts;
struct svn_client__dirent_fetcher_baton_t dfb;
svn_boolean_t server_supports_depth;
- svn_boolean_t text_conflicted, prop_conflicted, tree_conflicted;
+ svn_boolean_t cropping_target;
+ svn_boolean_t target_conflicted = FALSE;
svn_config_t *cfg = ctx->config ? apr_hash_get(ctx->config,
SVN_CONFIG_CATEGORY_CONFIG,
APR_HASH_KEY_STRING) : NULL;
@@ -226,33 +230,42 @@ update_internal(svn_revnum_t *result_rev
target = "";
/* Check if our anchor exists in BASE. If it doesn't we can't update. */
- SVN_ERR(svn_client__wc_node_get_base(&anchor_loc, anchor_abspath,
- ctx->wc_ctx, pool, pool));
+ SVN_ERR(svn_wc__node_get_base(NULL, NULL, &repos_relpath, &repos_root_url,
+ &repos_uuid, NULL,
+ ctx->wc_ctx, anchor_abspath,
+ TRUE, FALSE,
+ pool, pool));
/* It does not make sense to update conflict victims. */
- err = svn_wc_conflicted_p3(&text_conflicted, &prop_conflicted,
- &tree_conflicted,
- ctx->wc_ctx, local_abspath, pool);
- if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+ if (repos_relpath)
{
+ svn_boolean_t text_conflicted, prop_conflicted, tree_conflicted;
+
+ anchor_url = svn_path_url_add_component2(repos_root_url, repos_relpath,
+ pool);
+
+ err = svn_wc_conflicted_p3(&text_conflicted, &prop_conflicted,
+ &tree_conflicted,
+ ctx->wc_ctx, local_abspath, pool);
+
+ if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+ return svn_error_trace(err);
svn_error_clear(err);
- text_conflicted = FALSE;
- prop_conflicted = FALSE;
- tree_conflicted = FALSE;
+
+ if (!err && (text_conflicted || prop_conflicted || tree_conflicted))
+ target_conflicted = TRUE;
}
else
- SVN_ERR(err);
+ anchor_url = NULL;
- if (! anchor_loc
- || text_conflicted || prop_conflicted || tree_conflicted)
+ if (! anchor_url || target_conflicted)
{
if (ctx->notify_func2)
{
svn_wc_notify_t *nt;
nt = svn_wc_create_notify(local_abspath,
- (text_conflicted || prop_conflicted
- || tree_conflicted)
+ target_conflicted
? svn_wc_notify_skip_conflicted
: svn_wc_notify_update_skip_working_only,
pool);
@@ -263,7 +276,8 @@ update_internal(svn_revnum_t *result_rev
}
/* We may need to crop the tree if the depth is sticky */
- if (depth_is_sticky && depth < svn_depth_infinity)
+ cropping_target = (depth_is_sticky && depth < svn_depth_infinity);
+ if (cropping_target)
{
svn_node_kind_t target_kind;
@@ -279,8 +293,8 @@ update_internal(svn_revnum_t *result_rev
return SVN_NO_ERROR;
}
- SVN_ERR(svn_wc_read_kind(&target_kind, ctx->wc_ctx, local_abspath, TRUE,
- pool));
+ SVN_ERR(svn_wc_read_kind2(&target_kind, ctx->wc_ctx, local_abspath,
+ TRUE, TRUE, pool));
if (target_kind == svn_node_dir)
{
SVN_ERR(svn_wc_crop_tree2(ctx->wc_ctx, local_abspath, depth,
@@ -329,9 +343,9 @@ update_internal(svn_revnum_t *result_rev
/* Open an RA session for the URL */
SVN_ERR(svn_client__open_ra_session_internal(&ra_session, &corrected_url,
- anchor_loc->url,
+ anchor_url,
anchor_abspath, NULL, TRUE,
- TRUE, ctx, pool));
+ TRUE, ctx, pool, pool));
/* If we got a corrected URL from the RA subsystem, we'll need to
relocate our working copy first. */
@@ -344,15 +358,15 @@ update_internal(svn_revnum_t *result_rev
SVN_ERR(svn_ra_get_repos_root2(ra_session, &new_repos_root_url, pool));
/* svn_client_relocate2() will check the uuid */
- SVN_ERR(svn_client_relocate2(anchor_abspath, anchor_loc->url,
+ SVN_ERR(svn_client_relocate2(anchor_abspath, anchor_url,
new_repos_root_url, ignore_externals,
ctx, pool));
/* Store updated repository root for externals */
- anchor_loc->repos_root_url = new_repos_root_url;
+ repos_root_url = new_repos_root_url;
/* ### We should update anchor_loc->repos_uuid too, although currently
* we don't use it. */
- anchor_loc->url = corrected_url;
+ anchor_url = corrected_url;
}
/* Resolve unspecified REVISION now, because we need to retrieve the
@@ -374,7 +388,7 @@ update_internal(svn_revnum_t *result_rev
dfb.ra_session = ra_session;
dfb.target_revision = revnum;
- dfb.anchor_url = anchor_loc->url;
+ dfb.anchor_url = anchor_url;
SVN_ERR(svn_client__get_inheritable_props(&wcroot_iprops, local_abspath,
revnum, depth, ra_session,
@@ -430,7 +444,8 @@ update_internal(svn_revnum_t *result_rev
/* We handle externals after the update is complete, so that
handling external items (and any errors therefrom) doesn't delay
the primary operation. */
- if (SVN_DEPTH_IS_RECURSIVE(depth) && (! ignore_externals))
+ if ((SVN_DEPTH_IS_RECURSIVE(depth) || cropping_target)
+ && (! ignore_externals))
{
apr_hash_t *new_externals;
apr_hash_t *new_depths;
@@ -441,7 +456,7 @@ update_internal(svn_revnum_t *result_rev
SVN_ERR(svn_client__handle_externals(new_externals,
new_depths,
- anchor_loc->repos_root_url, local_abspath,
+ repos_root_url, local_abspath,
depth, use_sleep,
ctx, pool));
}
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/upgrade.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/upgrade.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/upgrade.c Wed Mar 6 11:10:01 2013
@@ -63,8 +63,6 @@ fetch_repos_info(const char **repos_root
apr_pool_t *scratch_pool)
{
struct repos_info_baton *ri = baton;
- apr_pool_t *subpool;
- svn_ra_session_t *ra_session;
/* The same info is likely to retrieved multiple times (e.g. externals) */
if (ri->last_repos && svn_uri__is_ancestor(ri->last_repos, url))
@@ -74,19 +72,13 @@ fetch_repos_info(const char **repos_root
return SVN_NO_ERROR;
}
- subpool = svn_pool_create(scratch_pool);
-
- SVN_ERR(svn_client_open_ra_session(&ra_session, url, ri->ctx, subpool));
-
- SVN_ERR(svn_ra_get_repos_root2(ra_session, repos_root, result_pool));
- SVN_ERR(svn_ra_get_uuid2(ra_session, repos_uuid, result_pool));
+ SVN_ERR(svn_client_get_repos_root(repos_root, repos_uuid, url, ri->ctx,
+ result_pool, scratch_pool));
/* Store data for further calls */
ri->last_repos = apr_pstrdup(ri->state_pool, *repos_root);
ri->last_uuid = apr_pstrdup(ri->state_pool, *repos_uuid);
- svn_pool_destroy(subpool);
-
return SVN_NO_ERROR;
}
@@ -226,8 +218,8 @@ svn_client_upgrade(const char *path,
* already been upgraded) and no error is returned. If it doesn't
* exist (external that isn't checked out yet), we'll just get
* svn_node_none. */
- err = svn_wc_read_kind(&external_kind, ctx->wc_ctx,
- external_abspath, FALSE, iterpool2);
+ err = svn_wc_read_kind2(&external_kind, ctx->wc_ctx,
+ external_abspath, TRUE, FALSE, iterpool2);
if (err && err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED)
{
svn_error_clear(err);
@@ -241,8 +233,8 @@ svn_client_upgrade(const char *path,
/* The upgrade of any dir should be done now, get the now reliable
* kind. */
- err = svn_wc_read_kind(&external_kind, ctx->wc_ctx, external_abspath,
- FALSE, iterpool2);
+ err = svn_wc_read_kind2(&external_kind, ctx->wc_ctx, external_abspath,
+ TRUE, FALSE, iterpool2);
if (err)
goto handle_error;
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/util.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/util.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/util.c Wed Mar 6 11:10:01 2013
@@ -179,12 +179,15 @@ svn_client__wc_node_get_base(svn_client_
*base_p = apr_palloc(result_pool, sizeof(**base_p));
- SVN_ERR(svn_wc__node_get_base(&(*base_p)->rev,
+ SVN_ERR(svn_wc__node_get_base(NULL,
+ &(*base_p)->rev,
&relpath,
&(*base_p)->repos_root_url,
&(*base_p)->repos_uuid,
NULL,
wc_ctx, wc_abspath,
+ TRUE /* ignore_enoent */,
+ TRUE /* show_hidden */,
result_pool, scratch_pool));
if ((*base_p)->repos_root_url && relpath)
{
@@ -263,10 +266,8 @@ svn_client_get_repos_root(const char **r
}
/* If PATH_OR_URL was a URL, we use the RA layer to look it up. */
- SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL,
- abspath_or_url,
- NULL, NULL, FALSE, TRUE,
- ctx, scratch_pool));
+ SVN_ERR(svn_client_open_ra_session2(&ra_session, abspath_or_url, NULL,
+ ctx, scratch_pool, scratch_pool));
if (repos_root)
SVN_ERR(svn_ra_get_repos_root2(ra_session, repos_root, result_pool));
@@ -355,6 +356,7 @@ fetch_props_func(apr_hash_t **props,
return SVN_NO_ERROR;
}
+ /* Reads the pristine properties of WORKING, not those of BASE */
SVN_ERR(svn_wc_get_pristine_props(props, scb->wc_ctx, local_abspath,
result_pool, scratch_pool));
@@ -381,9 +383,9 @@ fetch_kind_func(svn_kind_t *kind,
*kind = svn_kind_unknown;
return SVN_NO_ERROR;
}
-
- SVN_ERR(svn_wc_read_kind(&node_kind, scb->wc_ctx, local_abspath, FALSE,
- scratch_pool));
+ /* Reads the WORKING kind. Not the BASE kind */
+ SVN_ERR(svn_wc_read_kind2(&node_kind, scb->wc_ctx, local_abspath,
+ TRUE, FALSE, scratch_pool));
*kind = svn__kind_from_node_kind(node_kind, FALSE);
return SVN_NO_ERROR;
@@ -410,6 +412,7 @@ fetch_base_func(const char **filename,
return SVN_NO_ERROR;
}
+ /* Reads the pristine of WORKING, not of BASE */
err = svn_wc_get_pristine_contents2(&pristine_stream, scb->wc_ctx,
local_abspath, scratch_pool,
scratch_pool);
Modified: subversion/branches/fsfs-format7/subversion/libsvn_delta/svndiff.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_delta/svndiff.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_delta/svndiff.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_delta/svndiff.c Wed Mar 6 11:10:01 2013
@@ -903,6 +903,14 @@ write_handler(void *baton,
/* NOTREACHED */
}
+/* Minimal svn_stream_t write handler, doing nothing */
+static svn_error_t *
+noop_write_handler(void *baton,
+ const char *buffer,
+ apr_size_t *len)
+{
+ return SVN_NO_ERROR;
+}
static svn_error_t *
close_handler(void *baton)
@@ -944,8 +952,18 @@ svn_txdelta_parse_svndiff(svn_txdelta_wi
db->header_bytes = 0;
db->error_on_early_close = error_on_early_close;
stream = svn_stream_create(db, pool);
- svn_stream_set_write(stream, write_handler);
- svn_stream_set_close(stream, close_handler);
+
+ if (handler != svn_delta_noop_window_handler)
+ {
+ svn_stream_set_write(stream, write_handler);
+ svn_stream_set_close(stream, close_handler);
+ }
+ else
+ {
+ /* And else we just ignore everything as efficiently as we can.
+ by only hooking a no-op handler */
+ svn_stream_set_write(stream, noop_write_handler);
+ }
return stream;
}
Modified: subversion/branches/fsfs-format7/subversion/libsvn_diff/diff_tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_diff/diff_tree.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_diff/diff_tree.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_diff/diff_tree.c Wed Mar 6 11:10:01 2013
@@ -29,6 +29,7 @@
#include "svn_dirent_uri.h"
#include "svn_error.h"
+#include "svn_io.h"
#include "svn_pools.h"
#include "svn_props.h"
#include "svn_types.h"
@@ -1112,9 +1113,20 @@ copy_as_changed_file_added(const char *r
if (copyfrom_source)
{
apr_array_header_t *propchanges;
+ svn_boolean_t same;
SVN_ERR(svn_prop_diffs(&propchanges, right_props, copyfrom_props,
scratch_pool));
+ /* "" is sometimes a marker for just modified (E.g. no-textdeltas),
+ and it is certainly not a file */
+ if (*copyfrom_file && *right_file)
+ {
+ SVN_ERR(svn_io_files_contents_same_p(&same, copyfrom_file,
+ right_file, scratch_pool));
+ }
+ else
+ same = FALSE;
+
SVN_ERR(cb->processor->file_changed(relpath,
copyfrom_source,
right_source,
@@ -1122,7 +1134,7 @@ copy_as_changed_file_added(const char *r
right_file,
copyfrom_props,
right_props,
- copyfrom_file && right_file,
+ !same,
propchanges,
file_baton,
cb->processor,
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_base/bdb/locks-table.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_base/bdb/locks-table.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_base/bdb/locks-table.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_base/bdb/locks-table.c Wed Mar 6 11:10:01 2013
@@ -26,6 +26,7 @@
#include "bdb_compat.h"
#include "svn_pools.h"
+#include "svn_path.h"
#include "private/svn_skel.h"
#include "dbt.h"
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_base/reps-strings.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_base/reps-strings.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_base/reps-strings.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_base/reps-strings.c Wed Mar 6 11:10:01 2013
@@ -1464,14 +1464,16 @@ svn_fs_base__rep_deltify(svn_fs_t *fs,
TRUE, trail, pool));
/* Setup a stream to convert the textdelta data into svndiff windows. */
- svn_txdelta(&txdelta_stream, source_stream, target_stream, pool);
+ svn_txdelta2(&txdelta_stream, source_stream, target_stream, TRUE, pool);
if (bfd->format >= SVN_FS_BASE__MIN_SVNDIFF1_FORMAT)
- svn_txdelta_to_svndiff2(&new_target_handler, &new_target_handler_baton,
- new_target_stream, 1, pool);
+ svn_txdelta_to_svndiff3(&new_target_handler, &new_target_handler_baton,
+ new_target_stream, 1,
+ SVN_DELTA_COMPRESSION_LEVEL_DEFAULT, pool);
else
- svn_txdelta_to_svndiff2(&new_target_handler, &new_target_handler_baton,
- new_target_stream, 0, pool);
+ svn_txdelta_to_svndiff3(&new_target_handler, &new_target_handler_baton,
+ new_target_stream, 0,
+ SVN_DELTA_COMPRESSION_LEVEL_DEFAULT, pool);
/* subpool for the windows */
wpool = svn_pool_create(pool);
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_base/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_base/tree.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_base/tree.c Wed Mar 6 11:10:01 2013
@@ -4041,7 +4041,7 @@ base_get_file_delta_stream(svn_txdelta_s
SVN_ERR(base_file_contents(&target, target_root, target_path, pool));
/* Create a delta stream that turns the ancestor into the target. */
- svn_txdelta(&delta_stream, source, target, pool);
+ svn_txdelta2(&delta_stream, source, target, TRUE, pool);
*stream_p = delta_stream;
return SVN_NO_ERROR;
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c Wed Mar 6 11:10:01 2013
@@ -640,6 +640,7 @@ create_rep_state_body(rep_state_t **rep_
/* If the hint is
* - given,
+ * - refers to a valid revision,
* - refers to a packed revision,
* - as does the rep we want to read, and
* - refers to the same pack file as the rep
@@ -647,6 +648,7 @@ create_rep_state_body(rep_state_t **rep_
*/
svn_boolean_t reuse_shared_file
= shared_file && *shared_file && (*shared_file)->file
+ && SVN_IS_VALID_REVNUM((*shared_file)->revision)
&& (*shared_file)->revision < ffd->min_unpacked_rev
&& rep->revision < ffd->min_unpacked_rev
&& ( ((*shared_file)->revision / ffd->max_files_per_dir)
@@ -2552,4 +2554,4 @@ block_read(void **result,
svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
-}
\ No newline at end of file
+}
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/dag.c Wed Mar 6 11:10:01 2013
@@ -1099,7 +1099,7 @@ svn_fs_fs__dag_serialize(void **data,
svn_temp_serializer__context_t *context =
svn_temp_serializer__init(node,
sizeof(*node),
- 1007,
+ 1024 - SVN_TEMP_SERIALIZER__OVERHEAD,
pool);
/* for mutable nodes, we will _never_ cache the noderev */
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c Wed Mar 6 11:10:01 2013
@@ -27,6 +27,7 @@
#include "svn_hash.h"
#include "svn_props.h"
#include "svn_time.h"
+#include "svn_dirent_uri.h"
#include "cached_data.h"
#include "id.h"
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/temp_serializer.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/temp_serializer.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/temp_serializer.c Wed Mar 6 11:10:01 2013
@@ -737,9 +737,12 @@ svn_fs_fs__serialize_node_revision(void
svn_stringbuf_t *serialized;
node_revision_t *noderev = item;
- /* create an (empty) serialization context with plenty of buffer space */
+ /* create an (empty) serialization context with plenty of (initial)
+ * buffer space. */
svn_temp_serializer__context_t *context =
- svn_temp_serializer__init(NULL, 0, 1007, pool);
+ svn_temp_serializer__init(NULL, 0,
+ 1024 - SVN_TEMP_SERIALIZER__OVERHEAD,
+ pool);
/* serialize the noderev */
svn_fs_fs__noderev_serialize(context, &noderev);
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c Wed Mar 6 11:10:01 2013
@@ -29,6 +29,7 @@
#include "svn_props.h"
#include "svn_sorts.h"
#include "svn_time.h"
+#include "svn_dirent_uri.h"
#include "fs_fs.h"
#include "tree.h"
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/tree.c?rev=1453290&r1=1453289&r2=1453290&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/tree.c Wed Mar 6 11:10:01 2013
@@ -860,24 +860,21 @@ typedef enum open_path_flags_t {
has no functional impact. */
open_path_uncached = 2,
- /* Assume that the path parameter is already in canonical form. */
- open_path_is_canonical = 4,
-
/* The caller does not care about the parent node chain but only
the final DAG node. */
- open_path_node_only = 8
+ open_path_node_only = 4
} open_path_flags_t;
/* Open the node identified by PATH in ROOT, allocating in POOL. Set
*PARENT_PATH_P to a path from the node up to ROOT. The resulting
**PARENT_PATH_P value is guaranteed to contain at least one
- *element, for the root directory.
+ *element, for the root directory. PATH must be in canonical form.
If resulting *PARENT_PATH_P will eventually be made mutable and
modified, or if copy ID inheritance information is otherwise
needed, TXN_ID should be the ID of the mutability transaction. If
- TXN_ID is NULL, no copy ID in heritance information will be
+ TXN_ID is NULL, no copy ID inheritance information will be
calculated for the *PARENT_PATH_P chain.
If FLAGS & open_path_last_optional is zero, return the error
@@ -890,7 +887,8 @@ typedef enum open_path_flags_t {
The remaining bits in FLAGS are hints that allow this function
to take shortcuts based on knowledge that the caller provides,
- such as the fact that PATH is already in canonical form.
+ such as the caller is not actually being interested in PARENT_PATH_P,
+ but only in (*PARENT_PATH_P)->NODE.
NOTE: Public interfaces which only *read* from the filesystem
should not call this function directly, but should instead use
@@ -910,21 +908,18 @@ open_path(parent_path_t **parent_path_p,
const char *rest; /* The portion of PATH we haven't traversed yet. */
/* ensure a canonical path representation */
- const char *canon_path = ( (flags & open_path_is_canonical)
- || svn_fs__is_canonical_abspath(path))
- ? path
- : svn_fs__canonicalize_abspath(path, pool);
const char *path_so_far = "/";
apr_pool_t *iterpool = svn_pool_create(pool);
/* callers often traverse the tree in some path-based order. That means
- a sibbling of PATH has been resently accessed. Try to start the lookup
+ a sibling of PATH has been presently accessed. Try to start the lookup
directly at the parent node, if the caller did not requested the full
parent chain. */
const char *directory;
+ assert(svn_fs__is_canonical_abspath(path));
if (flags & open_path_node_only)
{
- directory = svn_dirent_dirname(canon_path, pool);
+ directory = svn_dirent_dirname(path, pool);
if (directory[1] != 0) /* root nodes are covered anyway */
SVN_ERR(dag_node_cache_get(&here, root, directory, TRUE, pool));
}
@@ -933,14 +928,14 @@ open_path(parent_path_t **parent_path_p,
if (here)
{
path_so_far = directory;
- rest = canon_path + strlen(directory) + 1;
+ rest = path + strlen(directory) + 1;
}
else
{
/* Make a parent_path item for the root node, using its own current
copy id. */
SVN_ERR(root_node(&here, root, pool));
- rest = canon_path + 1; /* skip the leading '/', it saves in iteration */
+ rest = path + 1; /* skip the leading '/', it saves in iteration */
}
parent_path = make_parent_path(here, 0, 0, pool);
@@ -1185,7 +1180,7 @@ get_dag(dag_node_t **dag_node_p,
if (! node)
{
/* Canonicalize the input PATH. */
- if (!svn_fs__is_canonical_abspath(path))
+ if (! svn_fs__is_canonical_abspath(path))
{
path = svn_fs__canonicalize_abspath(path, pool);
@@ -1199,8 +1194,8 @@ get_dag(dag_node_t **dag_node_p,
/* Call open_path with no flags, as we want this to return an
* error if the node for which we are searching doesn't exist. */
SVN_ERR(open_path(&parent_path, root, path,
- open_path_uncached | open_path_is_canonical
- | open_path_node_only, NULL, pool));
+ open_path_uncached | open_path_node_only,
+ NULL, pool));
node = parent_path->node;
/* No need to cache our find -- open_path() will do that for us. */
@@ -1427,6 +1422,7 @@ fs_change_node_prop(svn_fs_root_t *root,
return SVN_FS__NOT_TXN(root);
txn_id = root->txn;
+ path = svn_fs__canonicalize_abspath(path, pool);
SVN_ERR(open_path(&parent_path, root, path, 0, txn_id, pool));
/* Check (non-recursively) to see if path is locked; if so, check
@@ -2209,6 +2205,7 @@ fs_make_dir(svn_fs_root_t *root,
dag_node_t *sub_dir;
const char *txn_id = root->txn;
+ path = svn_fs__canonicalize_abspath(path, pool);
SVN_ERR(open_path(&parent_path, root, path, open_path_last_optional,
txn_id, pool));
@@ -2260,6 +2257,7 @@ fs_delete_node(svn_fs_root_t *root,
if (! root->is_txn_root)
return SVN_FS__NOT_TXN(root);
+ path = svn_fs__canonicalize_abspath(path, pool);
SVN_ERR(open_path(&parent_path, root, path, 0, txn_id, pool));
kind = svn_fs_fs__dag_node_kind(parent_path->node);
@@ -2459,7 +2457,12 @@ fs_copy(svn_fs_root_t *from_root,
const char *to_path,
apr_pool_t *pool)
{
- return svn_error_trace(copy_helper(from_root, from_path, to_root, to_path,
+ return svn_error_trace(copy_helper(from_root,
+ svn_fs__canonicalize_abspath(from_path,
+ pool),
+ to_root,
+ svn_fs__canonicalize_abspath(to_path,
+ pool),
TRUE, pool));
}
@@ -2476,6 +2479,7 @@ fs_revision_link(svn_fs_root_t *from_roo
if (! to_root->is_txn_root)
return SVN_FS__NOT_TXN(to_root);
+ path = svn_fs__canonicalize_abspath(path, pool);
return svn_error_trace(copy_helper(from_root, path, to_root, path,
FALSE, pool));
}
@@ -2551,8 +2555,9 @@ fs_make_file(svn_fs_root_t *root,
dag_node_t *child;
const char *txn_id = root->txn;
+ path = svn_fs__canonicalize_abspath(path, pool);
SVN_ERR(open_path(&parent_path, root, path, open_path_last_optional,
- txn_id, pool));
+ txn_id, pool));
/* If there's already a file by that name, complain.
This also catches the case of trying to make a file named `/'. */
@@ -2860,7 +2865,7 @@ fs_apply_textdelta(svn_txdelta_window_ha
txdelta_baton_t *tb = apr_pcalloc(pool, sizeof(*tb));
tb->root = root;
- tb->path = path;
+ tb->path = svn_fs__canonicalize_abspath(path, pool);
tb->pool = pool;
tb->base_checksum = svn_checksum_dup(base_checksum, pool);
tb->result_checksum = svn_checksum_dup(result_checksum, pool);
@@ -2993,7 +2998,7 @@ fs_apply_text(svn_stream_t **contents_p,
struct text_baton_t *tb = apr_pcalloc(pool, sizeof(*tb));
tb->root = root;
- tb->path = path;
+ tb->path = svn_fs__canonicalize_abspath(path, pool);
tb->pool = pool;
tb->result_checksum = svn_checksum_dup(result_checksum, pool);
@@ -3213,6 +3218,7 @@ static svn_error_t *fs_closest_copy(svn_
*root_p = NULL;
*path_p = NULL;
+ path = svn_fs__canonicalize_abspath(path, pool);
SVN_ERR(open_path(&parent_path, root, path, 0, NULL, pool));
/* Find the youngest copyroot in the path of this node-rev, which
@@ -3691,7 +3697,7 @@ assemble_history(svn_fs_t *fs,
{
svn_fs_history_t *history = apr_pcalloc(pool, sizeof(*history));
fs_history_data_t *fhd = apr_pcalloc(pool, sizeof(*fhd));
- fhd->path = path;
+ fhd->path = svn_fs__canonicalize_abspath(path, pool);
fhd->revision = revision;
fhd->is_interesting = is_interesting;
fhd->path_hint = path_hint;
@@ -3844,8 +3850,7 @@ get_mergeinfo_for_path_internal(svn_merg
path = svn_fs__canonicalize_abspath(path, scratch_pool);
- SVN_ERR(open_path(&parent_path, rev_root, path, open_path_is_canonical,
- NULL, scratch_pool));
+ SVN_ERR(open_path(&parent_path, rev_root, path, 0, NULL, scratch_pool));
if (inherit == svn_mergeinfo_nearest_ancestor && ! parent_path->parent)
return SVN_NO_ERROR;