You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2013/05/10 16:58:56 UTC
svn commit: r1481041 [11/38] - in /subversion/branches/master-passphrase: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
contrib/client-side/svncopy/ contrib/hook-scripts/
contrib/server-side/fsfsfixer/ contrib/server-side/fsfsf...
Modified: subversion/branches/master-passphrase/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_client/prop_commands.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_client/prop_commands.c Fri May 10 14:58:47 2013
@@ -88,7 +88,7 @@ get_file_for_validation(const svn_string
pool));
if (mime_type)
- *mime_type = apr_hash_get(props, SVN_PROP_MIME_TYPE, APR_HASH_KEY_STRING);
+ *mime_type = svn_hash_gets(props, SVN_PROP_MIME_TYPE);
return SVN_NO_ERROR;
}
@@ -587,6 +587,9 @@ remote_propget(apr_hash_t *props,
if (inherited_props)
{
const char *repos_root_url;
+ int i;
+ apr_array_header_t *final_iprops =
+ apr_array_make(result_pool, 1, sizeof(svn_prop_inherited_item_t *));
/* We will filter out all but PROPNAME later, making a final copy
in RESULT_POOL, so pass SCRATCH_POOL for all pools. */
@@ -599,21 +602,13 @@ remote_propget(apr_hash_t *props,
repos_root_url,
scratch_pool,
scratch_pool));
- }
-
- /* Make a copy of any inherited PROPNAME properties in RESULT_POOL. */
- if (inherited_props)
- {
- int i;
- apr_array_header_t *final_iprops =
- apr_array_make(result_pool, 1, sizeof(svn_prop_inherited_item_t *));
+ /* Make a copy of any inherited PROPNAME properties in RESULT_POOL. */
for (i = 0; i < (*inherited_props)->nelts; i++)
{
svn_prop_inherited_item_t *iprop =
APR_ARRAY_IDX((*inherited_props), i, svn_prop_inherited_item_t *);
- svn_string_t *iprop_val = apr_hash_get(iprop->prop_hash, propname,
- APR_HASH_KEY_STRING);
+ svn_string_t *iprop_val = svn_hash_gets(iprop->prop_hash, propname);
if (iprop_val)
{
@@ -622,10 +617,9 @@ remote_propget(apr_hash_t *props,
new_iprop->path_or_url =
apr_pstrdup(result_pool, iprop->path_or_url);
new_iprop->prop_hash = apr_hash_make(result_pool);
- apr_hash_set(new_iprop->prop_hash,
- apr_pstrdup(result_pool, propname),
- APR_HASH_KEY_STRING,
- svn_string_dup(iprop_val, result_pool));
+ svn_hash_sets(new_iprop->prop_hash,
+ apr_pstrdup(result_pool, propname),
+ svn_string_dup(iprop_val, result_pool));
APR_ARRAY_PUSH(final_iprops, svn_prop_inherited_item_t *) =
new_iprop;
}
@@ -634,10 +628,11 @@ remote_propget(apr_hash_t *props,
}
if (prop_hash
- && (val = apr_hash_get(prop_hash, propname, APR_HASH_KEY_STRING)))
+ && (val = svn_hash_gets(prop_hash, propname)))
{
- apr_hash_set(props, apr_pstrdup(result_pool, target_full_url),
- APR_HASH_KEY_STRING, svn_string_dup(val, result_pool));
+ svn_hash_sets(props,
+ apr_pstrdup(result_pool, target_full_url),
+ svn_string_dup(val, result_pool));
}
if (depth >= svn_depth_files
@@ -704,9 +699,8 @@ recursive_propget_receiver(void *baton,
if (apr_hash_count(props))
{
apr_hash_index_t *hi = apr_hash_first(scratch_pool, props);
- apr_hash_set(b->props, apr_pstrdup(b->pool, local_abspath),
- APR_HASH_KEY_STRING,
- svn_string_dup(svn__apr_hash_index_val(hi), b->pool));
+ svn_hash_sets(b->props, apr_pstrdup(b->pool, local_abspath),
+ svn_string_dup(svn__apr_hash_index_val(hi), b->pool));
}
return SVN_NO_ERROR;
@@ -1044,7 +1038,7 @@ call_receiver(const char *path,
*
* The 'path' and keys for 'prop_hash' and 'inherited_prop' arguments to
* RECEIVER are all URLs.
- *
+ *
* RESULT_POOL is used to allocated the 'path', 'prop_hash', and
* 'inherited_prop' arguments to RECEIVER. SCRATCH_POOL is used for all
* other (temporary) allocations.
@@ -1133,9 +1127,9 @@ remote_proplist(const char *target_prefi
const char *name = svn__apr_hash_index_key(hi);
apr_ssize_t klen = svn__apr_hash_index_klen(hi);
svn_prop_kind_t prop_kind;
-
+
prop_kind = svn_property_kind2(name);
-
+
if (prop_kind != svn_prop_regular_kind)
{
apr_hash_set(prop_hash, name, klen, NULL);
@@ -1239,7 +1233,7 @@ recursive_proplist_receiver(void *baton,
/* Helper for svn_client_proplist4 when retrieving properties and/or
inherited properties from the repository. Except as noted below,
all arguments are as per svn_client_proplist4.
-
+
GET_EXPLICIT_PROPS controls if explicit props are retrieved. */
static svn_error_t *
get_remote_props(const char *path_or_url,
Modified: subversion/branches/master-passphrase/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_client/ra.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_client/ra.c Fri May 10 14:58:47 2013
@@ -26,6 +26,7 @@
#include <apr_pools.h>
#include "svn_error.h"
+#include "svn_hash.h"
#include "svn_pools.h"
#include "svn_string.h"
#include "svn_sorts.h"
@@ -157,7 +158,7 @@ push_wc_prop(void *baton,
if (! cb->commit_items)
return svn_error_createf
(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
- _("Attempt to set wc property '%s' on '%s' in a non-commit operation"),
+ _("Attempt to set wcprop '%s' on '%s' in a non-commit operation"),
name, svn_dirent_local_style(relpath, pool));
for (i = 0; i < cb->commit_items->nelts; i++)
@@ -409,13 +410,13 @@ svn_client__open_ra_session_internal(svn
*corrected_url = corrected;
/* Make sure we've not attempted this URL before. */
- if (apr_hash_get(attempted, corrected, APR_HASH_KEY_STRING))
+ if (svn_hash_gets(attempted, corrected))
return svn_error_createf(SVN_ERR_CLIENT_CYCLE_DETECTED, NULL,
_("Redirect cycle detected for URL '%s'"),
corrected);
/* Remember this CORRECTED_URL so we don't wind up in a loop. */
- apr_hash_set(attempted, corrected, APR_HASH_KEY_STRING, (void *)1);
+ svn_hash_sets(attempted, corrected, (void *)1);
base_url = corrected;
}
}
@@ -446,39 +447,14 @@ svn_client_open_ra_session2(svn_ra_sessi
scratch_pool));
}
-
-
-
-/* Given PATH_OR_URL, which contains either a working copy path or an
- absolute URL, a peg revision PEG_REVISION, and a desired revision
- REVISION, find the path at which that object exists in REVISION,
- following copy history if necessary. If REVISION is younger than
- PEG_REVISION, then check that PATH_OR_URL is the same node in both
- PEG_REVISION and REVISION, and return @c
- SVN_ERR_CLIENT_UNRELATED_RESOURCES if it is not the same node.
-
- If PEG_REVISION->kind is 'unspecified', the peg revision is 'head'
- for a URL or 'working' for a WC path. If REVISION->kind is
- 'unspecified', the operative revision is the peg revision.
-
- Store the actual location of the object in *RESOLVED_LOC_P.
-
- RA_SESSION should be an open RA session pointing at the URL of
- PATH_OR_URL, or NULL, in which case this function will open its own
- temporary session.
-
- Use authentication baton cached in CTX to authenticate against the
- repository.
-
- Use POOL for all allocations. */
-static svn_error_t *
-resolve_rev_and_url(svn_client__pathrev_t **resolved_loc_p,
- svn_ra_session_t *ra_session,
- const char *path_or_url,
- const svn_opt_revision_t *peg_revision,
- const svn_opt_revision_t *revision,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool)
+svn_error_t *
+svn_client__resolve_rev_and_url(svn_client__pathrev_t **resolved_loc_p,
+ svn_ra_session_t *ra_session,
+ const char *path_or_url,
+ const svn_opt_revision_t *peg_revision,
+ const svn_opt_revision_t *revision,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
{
svn_opt_revision_t peg_rev = *peg_revision;
svn_opt_revision_t start_rev = *revision;
@@ -544,9 +520,9 @@ svn_client__ra_session_from_path2(svn_ra
if (corrected_url && svn_path_is_url(path_or_url))
path_or_url = corrected_url;
- SVN_ERR(resolve_rev_and_url(&resolved_loc, ra_session,
- path_or_url, peg_revision, revision,
- ctx, pool));
+ SVN_ERR(svn_client__resolve_rev_and_url(&resolved_loc, ra_session,
+ path_or_url, peg_revision, revision,
+ ctx, pool));
/* Make the session point to the real URL. */
SVN_ERR(svn_ra_reparent(ra_session, resolved_loc->url, pool));
@@ -1008,9 +984,9 @@ svn_client__youngest_common_ancestor(con
path_or_url1, NULL,
revision1, revision1,
ctx, sesspool));
- SVN_ERR(resolve_rev_and_url(&loc2, session,
- path_or_url2, revision2, revision2,
- ctx, scratch_pool));
+ SVN_ERR(svn_client__resolve_rev_and_url(&loc2, session,
+ path_or_url2, revision2, revision2,
+ ctx, scratch_pool));
SVN_ERR(svn_client__get_youngest_common_ancestor(
&ancestor, loc1, loc2, session, ctx, result_pool, scratch_pool));
@@ -1052,8 +1028,7 @@ svn_client__ra_provide_base(svn_stream_t
const char *local_abspath;
svn_error_t *err;
- local_abspath = apr_hash_get(reb->relpath_map, repos_relpath,
- APR_HASH_KEY_STRING);
+ local_abspath = svn_hash_gets(reb->relpath_map, repos_relpath);
if (!local_abspath)
{
*contents = NULL;
@@ -1097,8 +1072,7 @@ svn_client__ra_provide_props(apr_hash_t
const char *local_abspath;
svn_error_t *err;
- local_abspath = apr_hash_get(reb->relpath_map, repos_relpath,
- APR_HASH_KEY_STRING);
+ local_abspath = svn_hash_gets(reb->relpath_map, repos_relpath);
if (!local_abspath)
{
*props = NULL;
@@ -1131,29 +1105,26 @@ svn_client__ra_provide_props(apr_hash_t
svn_error_t *
-svn_client__ra_get_copysrc_kind(svn_kind_t *kind,
+svn_client__ra_get_copysrc_kind(svn_node_kind_t *kind,
void *baton,
const char *repos_relpath,
svn_revnum_t src_revision,
apr_pool_t *scratch_pool)
{
struct ra_ev2_baton *reb = baton;
- svn_node_kind_t node_kind;
const char *local_abspath;
- local_abspath = apr_hash_get(reb->relpath_map, repos_relpath,
- APR_HASH_KEY_STRING);
+ local_abspath = svn_hash_gets(reb->relpath_map, repos_relpath);
if (!local_abspath)
{
- *kind = svn_kind_unknown;
+ *kind = svn_node_unknown;
return SVN_NO_ERROR;
}
/* ### what to do with SRC_REVISION? */
- SVN_ERR(svn_wc_read_kind2(&node_kind, reb->wc_ctx, local_abspath,
+ SVN_ERR(svn_wc_read_kind2(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/master-passphrase/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_client/repos_diff.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_client/repos_diff.c Fri May 10 14:58:47 2013
@@ -328,7 +328,7 @@ get_file_from_ra(struct file_baton *fb,
fb->pool, scratch_pool));
fstream = svn_stream_checksummed2(fstream, NULL, &fb->start_md5_checksum,
- svn_checksum_md5, TRUE, scratch_pool);
+ svn_checksum_md5, TRUE, fb->pool);
/* Retrieve the file and its properties */
SVN_ERR(svn_ra_get_file(fb->edit_baton->ra_session,
@@ -395,9 +395,8 @@ remove_non_prop_changes(apr_hash_t *pris
if (change->value)
{
- const svn_string_t *old_val = apr_hash_get(pristine_props,
- change->name,
- APR_HASH_KEY_STRING);
+ const svn_string_t *old_val = svn_hash_gets(pristine_props,
+ change->name);
if (old_val && svn_string_compare(old_val, change->value))
{
@@ -844,6 +843,37 @@ window_handler(svn_txdelta_window_t *win
return SVN_NO_ERROR;
}
+/* Implements svn_stream_lazyopen_func_t. */
+static svn_error_t *
+lazy_open_source(svn_stream_t **stream,
+ void *baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ struct file_baton *fb = baton;
+
+ SVN_ERR(svn_stream_open_readonly(stream, fb->path_start_revision,
+ result_pool, scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
+/* Implements svn_stream_lazyopen_func_t. */
+static svn_error_t *
+lazy_open_result(svn_stream_t **stream,
+ void *baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ struct file_baton *fb = baton;
+
+ SVN_ERR(svn_stream_open_unique(stream, &fb->path_end_revision, NULL,
+ svn_io_file_del_on_pool_cleanup,
+ result_pool, scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
/* An svn_delta_editor_t function. */
static svn_error_t *
apply_textdelta(void *file_baton,
@@ -903,14 +933,13 @@ apply_textdelta(void *file_baton,
}
/* Open the file to be used as the base for second revision */
- SVN_ERR(svn_stream_open_readonly(&src_stream, fb->path_start_revision,
- scratch_pool, scratch_pool));
+ src_stream = svn_stream_lazyopen_create(lazy_open_source, fb, FALSE,
+ scratch_pool);
/* Open the file that will become the second revision after applying the
text delta, it starts empty */
- SVN_ERR(svn_stream_open_unique(&result_stream, &fb->path_end_revision, NULL,
- svn_io_file_del_on_pool_cleanup,
- scratch_pool, scratch_pool));
+ result_stream = svn_stream_lazyopen_create(lazy_open_result, fb, FALSE,
+ scratch_pool);
svn_txdelta_apply(src_stream,
result_stream,
@@ -1213,22 +1242,20 @@ absent_file(const char *path,
}
static svn_error_t *
-fetch_kind_func(svn_kind_t *kind,
+fetch_kind_func(svn_node_kind_t *kind,
void *baton,
const char *path,
svn_revnum_t base_revision,
apr_pool_t *scratch_pool)
{
struct edit_baton *eb = baton;
- svn_node_kind_t node_kind;
if (!SVN_IS_VALID_REVNUM(base_revision))
base_revision = eb->revision;
- SVN_ERR(svn_ra_check_path(eb->ra_session, path, base_revision, &node_kind,
+ SVN_ERR(svn_ra_check_path(eb->ra_session, path, base_revision, kind,
scratch_pool));
- *kind = svn__kind_from_node_kind(node_kind, FALSE);
return SVN_NO_ERROR;
}
Modified: subversion/branches/master-passphrase/subversion/libsvn_client/resolved.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_client/resolved.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_client/resolved.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_client/resolved.c Fri May 10 14:58:47 2013
@@ -27,12 +27,17 @@
/*** Includes. ***/
+#include <stdlib.h>
+
#include "svn_types.h"
#include "svn_wc.h"
#include "svn_client.h"
#include "svn_error.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
+#include "svn_pools.h"
+#include "svn_hash.h"
+#include "svn_sorts.h"
#include "client.h"
#include "private/svn_wc_private.h"
@@ -41,6 +46,66 @@
/*** Code. ***/
svn_error_t *
+svn_client__resolve_conflicts(svn_boolean_t *conflicts_remain,
+ apr_hash_t *conflicted_paths,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool)
+{
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+ apr_array_header_t *array;
+ int i;
+
+ if (conflicts_remain)
+ *conflicts_remain = FALSE;
+
+ SVN_ERR(svn_hash_keys(&array, conflicted_paths, scratch_pool));
+ qsort(array->elts, array->nelts, array->elt_size,
+ svn_sort_compare_paths);
+
+ for (i = 0; i < array->nelts; i++)
+ {
+ const char *local_abspath = APR_ARRAY_IDX(array, i, const char *);
+
+ svn_pool_clear(iterpool);
+ SVN_ERR(svn_wc__resolve_conflicts(ctx->wc_ctx, local_abspath,
+ svn_depth_empty,
+ TRUE /* resolve_text */,
+ "" /* resolve_prop (ALL props) */,
+ TRUE /* resolve_tree */,
+ svn_wc_conflict_choose_unspecified,
+ ctx->conflict_func2,
+ ctx->conflict_baton2,
+ ctx->cancel_func, ctx->cancel_baton,
+ ctx->notify_func2, ctx->notify_baton2,
+ iterpool));
+
+ if (conflicts_remain)
+ {
+ svn_error_t *err;
+ svn_boolean_t text_c, prop_c, tree_c;
+
+ err = svn_wc_conflicted_p3(&text_c, &prop_c, &tree_c,
+ ctx->wc_ctx, local_abspath,
+ iterpool);
+ if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+ {
+ svn_error_clear(err);
+ text_c = prop_c = tree_c = FALSE;
+ }
+ else
+ {
+ SVN_ERR(err);
+ }
+ if (text_c || prop_c || tree_c)
+ *conflicts_remain = TRUE;
+ }
+ }
+ svn_pool_destroy(iterpool);
+
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
svn_client_resolve(const char *path,
svn_depth_t depth,
svn_wc_conflict_choice_t conflict_choice,
@@ -77,5 +142,7 @@ svn_client_resolve(const char *path,
err = svn_error_compose_create(err, svn_wc__release_write_lock(ctx->wc_ctx,
lock_abspath,
pool));
+ svn_io_sleep_for_timestamps(path, pool);
+
return svn_error_trace(err);
}
Modified: subversion/branches/master-passphrase/subversion/libsvn_client/revert.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_client/revert.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_client/revert.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_client/revert.c Fri May 10 14:58:47 2013
@@ -31,6 +31,7 @@
#include "svn_wc.h"
#include "svn_client.h"
#include "svn_dirent_uri.h"
+#include "svn_hash.h"
#include "svn_pools.h"
#include "svn_error.h"
#include "svn_time.h"
@@ -135,8 +136,9 @@ svn_client_revert2(const apr_array_heade
_("'%s' is not a local path"), path);
}
- cfg = ctx->config ? apr_hash_get(ctx->config, SVN_CONFIG_CATEGORY_CONFIG,
- APR_HASH_KEY_STRING) : NULL;
+ cfg = ctx->config
+ ? svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_CONFIG)
+ : NULL;
SVN_ERR(svn_config_get_bool(cfg, &use_commit_times,
SVN_CONFIG_SECTION_MISCELLANY,
@@ -158,7 +160,9 @@ svn_client_revert2(const apr_array_heade
&& ((err = ctx->cancel_func(ctx->cancel_baton))))
goto errorful;
- SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
+ err = svn_dirent_get_absolute(&local_abspath, path, pool);
+ if (err)
+ goto errorful;
baton.local_abspath = local_abspath;
baton.depth = depth;
@@ -166,8 +170,9 @@ svn_client_revert2(const apr_array_heade
baton.changelists = changelists;
baton.ctx = ctx;
- SVN_ERR(svn_wc__is_wcroot(&wc_root, ctx->wc_ctx, local_abspath,
- pool));
+ err = svn_wc__is_wcroot(&wc_root, ctx->wc_ctx, local_abspath, pool);
+ if (err)
+ goto errorful;
lock_target = wc_root ? local_abspath
: svn_dirent_dirname(local_abspath, pool);
err = svn_wc__call_with_write_lock(revert, &baton, ctx->wc_ctx,
@@ -178,18 +183,17 @@ svn_client_revert2(const apr_array_heade
errorful:
- if (!use_commit_times)
- {
- /* Sleep to ensure timestamp integrity. */
- const char* sleep_path = NULL;
-
- /* Only specify a path if we are certain all paths are on the
- same filesystem */
- if (paths->nelts == 1)
- sleep_path = APR_ARRAY_IDX(paths, 0, const char *);
+ {
+ /* Sleep to ensure timestamp integrity. */
+ const char *sleep_path = NULL;
+
+ /* Only specify a path if we are certain all paths are on the
+ same filesystem */
+ if (paths->nelts == 1)
+ sleep_path = APR_ARRAY_IDX(paths, 0, const char *);
- svn_io_sleep_for_timestamps(sleep_path, subpool);
- }
+ svn_io_sleep_for_timestamps(sleep_path, subpool);
+ }
svn_pool_destroy(subpool);
Modified: subversion/branches/master-passphrase/subversion/libsvn_client/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_client/status.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_client/status.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_client/status.c Fri May 10 14:58:47 2013
@@ -87,8 +87,7 @@ tweak_status(void *baton,
transmission. */
if (sb->changelist_hash
&& (! status->changelist
- || ! apr_hash_get(sb->changelist_hash, status->changelist,
- APR_HASH_KEY_STRING)))
+ || ! svn_hash_gets(sb->changelist_hash, status->changelist)))
{
return SVN_NO_ERROR;
}
@@ -373,10 +372,10 @@ svn_client_status5(svn_revnum_t *result_
if necessary */
svn_node_kind_t kind;
-
+
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)
{
@@ -389,7 +388,7 @@ svn_client_status5(svn_revnum_t *result_
dir_abspath = svn_dirent_dirname(target_abspath, pool);
target_basename = svn_dirent_basename(target_abspath, NULL);
dir = svn_dirent_dirname(path, pool);
-
+
if (kind == svn_node_file)
{
if (depth == svn_depth_empty)
@@ -399,9 +398,9 @@ svn_client_status5(svn_revnum_t *result_
{
err = svn_wc_read_kind2(&kind, ctx->wc_ctx, dir_abspath,
FALSE, FALSE, pool);
-
+
svn_error_clear(err);
-
+
if (err || kind != svn_node_dir)
{
return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
Modified: subversion/branches/master-passphrase/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_client/switch.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_client/switch.c Fri May 10 14:58:47 2013
@@ -29,6 +29,7 @@
#include "svn_client.h"
#include "svn_error.h"
+#include "svn_hash.h"
#include "svn_time.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
@@ -55,8 +56,35 @@
*/
+/* A conflict callback that simply records the conflicted path in BATON.
+
+ Implements svn_wc_conflict_resolver_func2_t.
+*/
+static svn_error_t *
+record_conflict(svn_wc_conflict_result_t **result,
+ const svn_wc_conflict_description2_t *description,
+ void *baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ apr_hash_t *conflicted_paths = baton;
+
+ svn_hash_sets(conflicted_paths,
+ apr_pstrdup(apr_hash_pool_get(conflicted_paths),
+ description->local_abspath), "");
+ *result = svn_wc_create_conflict_result(svn_wc_conflict_choose_postpone,
+ NULL, result_pool);
+ return SVN_NO_ERROR;
+}
+
+/* ...
+
+ Add the paths of any conflict victims to CONFLICTED_PATHS, if that
+ is not null.
+*/
static svn_error_t *
switch_internal(svn_revnum_t *result_rev,
+ apr_hash_t *conflicted_paths,
const char *local_abspath,
const char *anchor_abspath,
const char *switch_url,
@@ -77,23 +105,19 @@ switch_internal(svn_revnum_t *result_rev
svn_client__pathrev_t *switch_loc;
svn_ra_session_t *ra_session;
svn_revnum_t revnum;
- svn_error_t *err = SVN_NO_ERROR;
const char *diff3_cmd;
apr_hash_t *wcroot_iprops;
apr_array_header_t *inherited_props;
svn_boolean_t use_commit_times;
- svn_boolean_t sleep_here = FALSE;
- svn_boolean_t *use_sleep = timestamp_sleep ? timestamp_sleep : &sleep_here;
const svn_delta_editor_t *switch_editor;
void *switch_edit_baton;
const char *preserved_exts_str;
apr_array_header_t *preserved_exts;
svn_boolean_t server_supports_depth;
struct svn_client__dirent_fetcher_baton_t dfb;
- svn_config_t *cfg = ctx->config ? apr_hash_get(ctx->config,
- SVN_CONFIG_CATEGORY_CONFIG,
- APR_HASH_KEY_STRING)
- : NULL;
+ svn_config_t *cfg = ctx->config
+ ? svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_CONFIG)
+ : NULL;
/* An unknown depth can't be sticky. */
if (depth == svn_depth_unknown)
@@ -221,7 +245,7 @@ switch_internal(svn_revnum_t *result_rev
}
wcroot_iprops = apr_hash_make(pool);
-
+
/* Will the base of LOCAL_ABSPATH require an iprop cache post-switch?
If we are switching LOCAL_ABSPATH to the root of the repository then
we don't need to cache inherited properties. In all other cases we
@@ -235,7 +259,7 @@ switch_internal(svn_revnum_t *result_rev
pool));
/* Switching the WC root to anything but the repos root means
- we need an iprop cache. */
+ we need an iprop cache. */
if (!wc_root)
{
/* We know we are switching a subtree to something other than the
@@ -269,8 +293,7 @@ switch_internal(svn_revnum_t *result_rev
SVN_ERR(svn_ra_get_inherited_props(ra_session, &inherited_props,
"", switch_loc->rev, pool,
pool));
- apr_hash_set(wcroot_iprops, local_abspath, APR_HASH_KEY_STRING,
- inherited_props);
+ svn_hash_sets(wcroot_iprops, local_abspath, inherited_props);
}
}
@@ -293,7 +316,8 @@ switch_internal(svn_revnum_t *result_rev
server_supports_depth,
diff3_cmd, preserved_exts,
svn_client__dirent_fetcher, &dfb,
- ctx->conflict_func2, ctx->conflict_baton2,
+ conflicted_paths ? record_conflict : NULL,
+ conflicted_paths,
NULL, NULL,
ctx->cancel_func, ctx->cancel_baton,
ctx->notify_func2, ctx->notify_baton2,
@@ -311,24 +335,21 @@ switch_internal(svn_revnum_t *result_rev
switch_editor, switch_edit_baton,
pool, pool));
+ /* Past this point, we assume the WC is going to be modified so we will
+ * need to sleep for timestamps. */
+ *timestamp_sleep = TRUE;
+
/* 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. */
- err = svn_wc_crawl_revisions5(ctx->wc_ctx, local_abspath, reporter,
- report_baton, TRUE, depth, (! depth_is_sticky),
- (! server_supports_depth),
- use_commit_times,
- ctx->cancel_func, ctx->cancel_baton,
- ctx->notify_func2, ctx->notify_baton2, pool);
-
- if (err)
- {
- /* Don't rely on the error handling to handle the sleep later, do
- it now */
- svn_io_sleep_for_timestamps(local_abspath, pool);
- return svn_error_trace(err);
- }
- *use_sleep = TRUE;
+ SVN_ERR(svn_wc_crawl_revisions5(ctx->wc_ctx, local_abspath, reporter,
+ report_baton, TRUE,
+ depth, (! depth_is_sticky),
+ (! server_supports_depth),
+ use_commit_times,
+ ctx->cancel_func, ctx->cancel_baton,
+ ctx->notify_func2, ctx->notify_baton2,
+ pool));
/* We handle externals after the switch is complete, so that
handling external items (and any errors therefrom) doesn't delay
@@ -346,19 +367,10 @@ switch_internal(svn_revnum_t *result_rev
new_depths,
switch_loc->repos_root_url,
local_abspath,
- depth, use_sleep,
+ depth, timestamp_sleep,
ctx, pool));
}
- /* Sleep to ensure timestamp integrity (we do this regardless of
- errors in the actual switch operation(s)). */
- if (sleep_here)
- svn_io_sleep_for_timestamps(local_abspath, pool);
-
- /* Return errors we might have sustained. */
- if (err)
- return svn_error_trace(err);
-
/* Let everyone know we're finished here. */
if (ctx->notify_func2)
{
@@ -398,6 +410,8 @@ svn_client__switch_internal(svn_revnum_t
const char *local_abspath, *anchor_abspath;
svn_boolean_t acquired_lock;
svn_error_t *err, *err1, *err2;
+ apr_hash_t *conflicted_paths
+ = ctx->conflict_func2 ? apr_hash_make(pool) : NULL;
SVN_ERR_ASSERT(path);
@@ -414,13 +428,21 @@ svn_client__switch_internal(svn_revnum_t
acquired_lock = (err == SVN_NO_ERROR);
svn_error_clear(err);
- err1 = switch_internal(result_rev, local_abspath, anchor_abspath,
+ err1 = switch_internal(result_rev, conflicted_paths,
+ local_abspath, anchor_abspath,
switch_url, peg_revision, revision,
depth, depth_is_sticky,
ignore_externals,
allow_unver_obstructions, ignore_ancestry,
timestamp_sleep, ctx, pool);
+ /* Give the conflict resolver callback the opportunity to
+ * resolve any conflicts that were raised. */
+ if (! err1 && ctx->conflict_func2)
+ {
+ err1 = svn_client__resolve_conflicts(NULL, conflicted_paths, ctx, pool);
+ }
+
if (acquired_lock)
err2 = svn_wc__release_write_lock(ctx->wc_ctx, anchor_abspath, pool);
else
@@ -443,13 +465,23 @@ svn_client_switch3(svn_revnum_t *result_
svn_client_ctx_t *ctx,
apr_pool_t *pool)
{
+ svn_error_t *err;
+ svn_boolean_t sleep_here = FALSE;
+
if (svn_path_is_url(path))
return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
_("'%s' is not a local path"), path);
- return svn_client__switch_internal(result_rev, path, switch_url,
- peg_revision, revision, depth,
- depth_is_sticky, ignore_externals,
- allow_unver_obstructions,
- ignore_ancestry, NULL, ctx, pool);
+ err = svn_client__switch_internal(result_rev, path, switch_url,
+ peg_revision, revision, depth,
+ depth_is_sticky, ignore_externals,
+ allow_unver_obstructions,
+ ignore_ancestry, &sleep_here, ctx, pool);
+
+ /* Sleep to ensure timestamp integrity (we do this regardless of
+ errors in the actual switch operation(s)). */
+ if (sleep_here)
+ svn_io_sleep_for_timestamps(path, pool);
+
+ return svn_error_trace(err);
}
Modified: subversion/branches/master-passphrase/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_client/update.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_client/update.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_client/update.c Fri May 10 14:58:47 2013
@@ -27,6 +27,7 @@
/*** Includes. ***/
+#include "svn_hash.h"
#include "svn_wc.h"
#include "svn_client.h"
#include "svn_error.h"
@@ -160,6 +161,27 @@ is_empty_wc(svn_boolean_t *clean_checkou
return svn_io_dir_close(dir);
}
+/* A conflict callback that simply records the conflicted path in BATON.
+
+ Implements svn_wc_conflict_resolver_func2_t.
+*/
+static svn_error_t *
+record_conflict(svn_wc_conflict_result_t **result,
+ const svn_wc_conflict_description2_t *description,
+ void *baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ apr_hash_t *conflicted_paths = baton;
+
+ svn_hash_sets(conflicted_paths,
+ apr_pstrdup(apr_hash_pool_get(conflicted_paths),
+ description->local_abspath), "");
+ *result = svn_wc_create_conflict_result(svn_wc_conflict_choose_postpone,
+ NULL, result_pool);
+ return SVN_NO_ERROR;
+}
+
/* This is a helper for svn_client__update_internal(), which see for
an explanation of most of these parameters. Some stuff that's
unique is as follows:
@@ -171,9 +193,13 @@ is_empty_wc(svn_boolean_t *clean_checkou
If NOTIFY_SUMMARY is set (and there's a notification handler in
CTX), transmit the final update summary upon successful
completion of the update.
+
+ Add the paths of any conflict victims to CONFLICTED_PATHS, if that
+ is not null.
*/
static svn_error_t *
update_internal(svn_revnum_t *result_rev,
+ apr_hash_t *conflicted_paths,
const char *local_abspath,
const char *anchor_abspath,
const svn_opt_revision_t *revision,
@@ -197,11 +223,8 @@ update_internal(svn_revnum_t *result_rev
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;
- svn_boolean_t sleep_here = FALSE;
- svn_boolean_t *use_sleep = timestamp_sleep ? timestamp_sleep : &sleep_here;
svn_boolean_t clean_checkout = FALSE;
const char *diff3_cmd;
apr_hash_t *wcroot_iprops;
@@ -213,9 +236,9 @@ update_internal(svn_revnum_t *result_rev
svn_boolean_t server_supports_depth;
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;
+ svn_config_t *cfg = ctx->config
+ ? svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_CONFIG)
+ : NULL;
if (result_rev)
*result_rev = SVN_INVALID_REVNUM;
@@ -239,20 +262,22 @@ update_internal(svn_revnum_t *result_rev
/* It does not make sense to update conflict victims. */
if (repos_relpath)
{
- svn_boolean_t text_conflicted, prop_conflicted, tree_conflicted;
+ svn_error_t *err;
+ svn_boolean_t text_conflicted, prop_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,
+ NULL,
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);
- if (!err && (text_conflicted || prop_conflicted || tree_conflicted))
+ /* tree-conflicts are handled by the update editor */
+ if (!err && (text_conflicted || prop_conflicted))
target_conflicted = TRUE;
}
else
@@ -406,7 +431,8 @@ update_internal(svn_revnum_t *result_rev
clean_checkout,
diff3_cmd, preserved_exts,
svn_client__dirent_fetcher, &dfb,
- ctx->conflict_func2, ctx->conflict_baton2,
+ conflicted_paths ? record_conflict : NULL,
+ conflicted_paths,
NULL, NULL,
ctx->cancel_func, ctx->cancel_baton,
ctx->notify_func2, ctx->notify_baton2,
@@ -414,32 +440,30 @@ update_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_update2(ra_session, &reporter, &report_baton,
+ SVN_ERR(svn_ra_do_update3(ra_session, &reporter, &report_baton,
revnum, target,
(!server_supports_depth || depth_is_sticky
? depth
: svn_depth_unknown),
- FALSE, update_editor, update_edit_baton, pool));
+ FALSE /* send_copyfrom_args */,
+ FALSE /* ignore_ancestry */,
+ update_editor, update_edit_baton, pool, pool));
+
+ /* Past this point, we assume the WC is going to be modified so we will
+ * need to sleep for timestamps. */
+ *timestamp_sleep = TRUE;
/* 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. */
- err = svn_wc_crawl_revisions5(ctx->wc_ctx, local_abspath, reporter,
- report_baton, TRUE, depth, (! depth_is_sticky),
- (! server_supports_depth),
- use_commit_times,
- ctx->cancel_func, ctx->cancel_baton,
- ctx->notify_func2, ctx->notify_baton2,
- pool);
-
- if (err)
- {
- /* Don't rely on the error handling to handle the sleep later, do
- it now */
- svn_io_sleep_for_timestamps(local_abspath, pool);
- return svn_error_trace(err);
- }
- *use_sleep = TRUE;
+ SVN_ERR(svn_wc_crawl_revisions5(ctx->wc_ctx, local_abspath, reporter,
+ report_baton, TRUE,
+ depth, (! depth_is_sticky),
+ (! server_supports_depth),
+ use_commit_times,
+ ctx->cancel_func, ctx->cancel_baton,
+ ctx->notify_func2, ctx->notify_baton2,
+ pool));
/* We handle externals after the update is complete, so that
handling external items (and any errors therefrom) doesn't delay
@@ -457,13 +481,10 @@ update_internal(svn_revnum_t *result_rev
SVN_ERR(svn_client__handle_externals(new_externals,
new_depths,
repos_root_url, local_abspath,
- depth, use_sleep,
+ depth, timestamp_sleep,
ctx, pool));
}
- if (sleep_here)
- svn_io_sleep_for_timestamps(local_abspath, pool);
-
/* Let everyone know we're finished here (unless we're asked not to). */
if (ctx->notify_func2 && notify_summary)
{
@@ -503,6 +524,8 @@ svn_client__update_internal(svn_revnum_t
const char *anchor_abspath, *lockroot_abspath;
svn_error_t *err;
svn_opt_revision_t peg_revision = *revision;
+ apr_hash_t *conflicted_paths
+ = ctx->conflict_func2 ? apr_hash_make(pool) : NULL;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
SVN_ERR_ASSERT(! (innerupdate && make_parents));
@@ -543,7 +566,9 @@ svn_client__update_internal(svn_revnum_t
{
const char *missing_parent =
APR_ARRAY_IDX(missing_parents, i, const char *);
- err = update_internal(result_rev, missing_parent, anchor_abspath,
+
+ err = update_internal(result_rev, conflicted_paths,
+ missing_parent, anchor_abspath,
&peg_revision, svn_depth_empty, FALSE,
ignore_externals, allow_unver_obstructions,
adds_as_modification, timestamp_sleep,
@@ -567,11 +592,20 @@ svn_client__update_internal(svn_revnum_t
anchor_abspath = lockroot_abspath;
}
- err = update_internal(result_rev, local_abspath, anchor_abspath,
+ err = update_internal(result_rev, conflicted_paths,
+ local_abspath, anchor_abspath,
&peg_revision, depth, depth_is_sticky,
ignore_externals, allow_unver_obstructions,
adds_as_modification, timestamp_sleep,
TRUE, ctx, pool);
+
+ /* Give the conflict resolver callback the opportunity to
+ * resolve any conflicts that were raised. */
+ if (! err && ctx->conflict_func2)
+ {
+ err = svn_client__resolve_conflicts(NULL, conflicted_paths, ctx, pool);
+ }
+
cleanup:
err = svn_error_compose_create(
err,
@@ -598,6 +632,7 @@ svn_client_update4(apr_array_header_t **
apr_pool_t *iterpool = svn_pool_create(pool);
const char *path = NULL;
svn_boolean_t sleep = FALSE;
+ svn_error_t *err = SVN_NO_ERROR;
if (result_revs)
*result_revs = apr_array_make(pool, paths->nelts, sizeof(svn_revnum_t));
@@ -613,7 +648,6 @@ svn_client_update4(apr_array_header_t **
for (i = 0; i < paths->nelts; ++i)
{
- svn_error_t *err = SVN_NO_ERROR;
svn_revnum_t result_rev;
const char *local_abspath;
path = APR_ARRAY_IDX(paths, i, const char *);
@@ -621,9 +655,15 @@ svn_client_update4(apr_array_header_t **
svn_pool_clear(iterpool);
if (ctx->cancel_func)
- SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
+ {
+ err = ctx->cancel_func(ctx->cancel_baton);
+ if (err)
+ goto cleanup;
+ }
- SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, iterpool));
+ err = svn_dirent_get_absolute(&local_abspath, path, iterpool);
+ if (err)
+ goto cleanup;
err = svn_client__update_internal(&result_rev, local_abspath,
revision, depth, depth_is_sticky,
ignore_externals,
@@ -636,10 +676,11 @@ svn_client_update4(apr_array_header_t **
if (err)
{
- if(err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY)
- return svn_error_trace(err);
+ if (err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY)
+ goto cleanup;
svn_error_clear(err);
+ err = SVN_NO_ERROR;
/* SVN_ERR_WC_NOT_WORKING_COPY: it's not versioned */
@@ -658,8 +699,9 @@ svn_client_update4(apr_array_header_t **
}
svn_pool_destroy(iterpool);
+ cleanup:
if (sleep)
svn_io_sleep_for_timestamps((paths->nelts == 1) ? path : NULL, pool);
- return SVN_NO_ERROR;
+ return svn_error_trace(err);
}
Modified: subversion/branches/master-passphrase/subversion/libsvn_client/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_client/util.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_client/util.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_client/util.c Fri May 10 14:58:47 2013
@@ -24,6 +24,7 @@
#include <apr_pools.h>
#include <apr_strings.h>
+#include "svn_hash.h"
#include "svn_pools.h"
#include "svn_error.h"
#include "svn_types.h"
@@ -349,7 +350,7 @@ fetch_props_func(apr_hash_t **props,
struct shim_callbacks_baton *scb = baton;
const char *local_abspath;
- local_abspath = apr_hash_get(scb->relpath_map, path, APR_HASH_KEY_STRING);
+ local_abspath = svn_hash_gets(scb->relpath_map, path);
if (!local_abspath)
{
*props = apr_hash_make(result_pool);
@@ -367,26 +368,24 @@ fetch_props_func(apr_hash_t **props,
}
static svn_error_t *
-fetch_kind_func(svn_kind_t *kind,
+fetch_kind_func(svn_node_kind_t *kind,
void *baton,
const char *path,
svn_revnum_t base_revision,
apr_pool_t *scratch_pool)
{
struct shim_callbacks_baton *scb = baton;
- svn_node_kind_t node_kind;
const char *local_abspath;
- local_abspath = apr_hash_get(scb->relpath_map, path, APR_HASH_KEY_STRING);
+ local_abspath = svn_hash_gets(scb->relpath_map, path);
if (!local_abspath)
{
- *kind = svn_kind_unknown;
+ *kind = svn_node_unknown;
return SVN_NO_ERROR;
}
/* Reads the WORKING kind. Not the BASE kind */
- SVN_ERR(svn_wc_read_kind2(&node_kind, scb->wc_ctx, local_abspath,
+ SVN_ERR(svn_wc_read_kind2(kind, scb->wc_ctx, local_abspath,
TRUE, FALSE, scratch_pool));
- *kind = svn__kind_from_node_kind(node_kind, FALSE);
return SVN_NO_ERROR;
}
@@ -405,7 +404,7 @@ fetch_base_func(const char **filename,
svn_stream_t *temp_stream;
svn_error_t *err;
- local_abspath = apr_hash_get(scb->relpath_map, path, APR_HASH_KEY_STRING);
+ local_abspath = svn_hash_gets(scb->relpath_map, path);
if (!local_abspath)
{
*filename = NULL;
Modified: subversion/branches/master-passphrase/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_delta/compat.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_delta/compat.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_delta/compat.c Fri May 10 14:58:47 2013
@@ -172,7 +172,7 @@ struct change_node
/* what kind of (tree) restructure is occurring at this node? */
enum restructure_action_t action;
- svn_kind_t kind; /* the NEW kind of this node */
+ svn_node_kind_t kind; /* the NEW kind of this node */
/* We need two revisions: one to specify the revision we are altering,
and a second to specify the revision to delete/replace. These are
@@ -205,8 +205,7 @@ static struct change_node *
locate_change(struct ev2_edit_baton *eb,
const char *relpath)
{
- struct change_node *change = apr_hash_get(eb->changes, relpath,
- APR_HASH_KEY_STRING);
+ struct change_node *change = svn_hash_gets(eb->changes, relpath);
if (change != NULL)
return change;
@@ -220,7 +219,7 @@ locate_change(struct ev2_edit_baton *eb,
change->changing = SVN_INVALID_REVNUM;
change->deleting = SVN_INVALID_REVNUM;
- apr_hash_set(eb->changes, relpath, APR_HASH_KEY_STRING, change);
+ svn_hash_sets(eb->changes, relpath, change);
return change;
}
@@ -229,7 +228,7 @@ locate_change(struct ev2_edit_baton *eb,
static svn_error_t *
apply_propedit(struct ev2_edit_baton *eb,
const char *relpath,
- svn_kind_t kind,
+ svn_node_kind_t kind,
svn_revnum_t base_revision,
const char *name,
const svn_string_t *value,
@@ -237,7 +236,7 @@ apply_propedit(struct ev2_edit_baton *eb
{
struct change_node *change = locate_change(eb, relpath);
- SVN_ERR_ASSERT(change->kind == svn_kind_unknown || change->kind == kind);
+ SVN_ERR_ASSERT(change->kind == svn_node_unknown || change->kind == kind);
change->kind = kind;
/* We're now changing the node. Record the revision. */
@@ -270,11 +269,11 @@ apply_propedit(struct ev2_edit_baton *eb
}
if (value == NULL)
- apr_hash_set(change->props, name, APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(change->props, name, NULL);
else
- apr_hash_set(change->props,
- apr_pstrdup(eb->edit_pool, name), APR_HASH_KEY_STRING,
- svn_string_dup(value, eb->edit_pool));
+ svn_hash_sets(change->props,
+ apr_pstrdup(eb->edit_pool, name),
+ svn_string_dup(value, eb->edit_pool));
return SVN_NO_ERROR;
}
@@ -321,7 +320,7 @@ process_actions(struct ev2_edit_baton *e
apr_hash_t *props = NULL;
svn_stream_t *contents = NULL;
svn_checksum_t *checksum = NULL;
- svn_kind_t kind = svn_kind_unknown;
+ svn_node_kind_t kind = svn_node_unknown;
SVN_ERR_ASSERT(change != NULL);
@@ -351,7 +350,7 @@ process_actions(struct ev2_edit_baton *e
{
/* We can only set text on files. */
/* ### validate we aren't overwriting KIND? */
- kind = svn_kind_file;
+ kind = svn_node_file;
/* ### the checksum might be in CHANGE->CHECKSUM */
SVN_ERR(svn_io_file_checksum2(&checksum, change->contents_abspath,
@@ -387,7 +386,7 @@ process_actions(struct ev2_edit_baton *e
if (props == NULL)
props = apr_hash_make(scratch_pool);
- if (kind == svn_kind_dir)
+ if (kind == svn_node_dir)
{
const apr_array_header_t *children;
@@ -435,7 +434,7 @@ process_actions(struct ev2_edit_baton *e
/* ### we need to gather up the target set of children */
- if (kind == svn_kind_dir)
+ if (kind == svn_node_dir)
SVN_ERR(svn_editor_alter_directory(eb->editor, repos_relpath,
change->changing, NULL, props));
else
@@ -462,9 +461,8 @@ run_ev2_actions(struct ev2_edit_baton *e
const char *repos_relpath = APR_ARRAY_IDX(eb->path_order,
eb->paths_processed,
const char *);
- const struct change_node *change = apr_hash_get(eb->changes,
- repos_relpath,
- APR_HASH_KEY_STRING);
+ const struct change_node *change = svn_hash_gets(eb->changes,
+ repos_relpath);
svn_pool_clear(iterpool);
@@ -573,7 +571,7 @@ ev2_add_directory(const char *path,
/* ### assert that RESTRUCTURE is NONE or DELETE? */
change->action = RESTRUCTURE_ADD;
- change->kind = svn_kind_dir;
+ change->kind = svn_node_dir;
cb->eb = pb->eb;
cb->path = apr_pstrdup(result_pool, relpath);
@@ -644,7 +642,7 @@ ev2_change_dir_prop(void *dir_baton,
{
struct ev2_dir_baton *db = dir_baton;
- SVN_ERR(apply_propedit(db->eb, db->path, svn_kind_dir, db->base_revision,
+ SVN_ERR(apply_propedit(db->eb, db->path, svn_node_dir, db->base_revision,
name, value, scratch_pool));
return SVN_NO_ERROR;
@@ -668,7 +666,7 @@ ev2_absent_directory(const char *path,
/* ### assert that RESTRUCTURE is NONE or DELETE? */
change->action = RESTRUCTURE_ADD_ABSENT;
- change->kind = svn_kind_dir;
+ change->kind = svn_node_dir;
return SVN_NO_ERROR;
}
@@ -690,7 +688,7 @@ ev2_add_file(const char *path,
/* ### assert that RESTRUCTURE is NONE or DELETE? */
change->action = RESTRUCTURE_ADD;
- change->kind = svn_kind_file;
+ change->kind = svn_node_file;
fb->eb = pb->eb;
fb->path = apr_pstrdup(result_pool, relpath);
@@ -856,7 +854,7 @@ ev2_change_file_prop(void *file_baton,
change->unlock = TRUE;
}
- SVN_ERR(apply_propedit(fb->eb, fb->path, svn_kind_file, fb->base_revision,
+ SVN_ERR(apply_propedit(fb->eb, fb->path, svn_node_file, fb->base_revision,
name, value, scratch_pool));
return SVN_NO_ERROR;
@@ -881,7 +879,7 @@ ev2_absent_file(const char *path,
/* ### assert that RESTRUCTURE is NONE or DELETE? */
change->action = RESTRUCTURE_ADD_ABSENT;
- change->kind = svn_kind_file;
+ change->kind = svn_node_file;
return SVN_NO_ERROR;
}
@@ -1037,7 +1035,7 @@ insert_change(const char *relpath,
apr_pool_t *result_pool;
struct change_node *change;
- change = apr_hash_get(changes, relpath, APR_HASH_KEY_STRING);
+ change = svn_hash_gets(changes, relpath);
if (change != NULL)
return change;
@@ -1048,9 +1046,7 @@ insert_change(const char *relpath,
change->changing = SVN_INVALID_REVNUM;
change->deleting = SVN_INVALID_REVNUM;
- apr_hash_set(changes,
- apr_pstrdup(result_pool, relpath), APR_HASH_KEY_STRING,
- change);
+ svn_hash_sets(changes, apr_pstrdup(result_pool, relpath), change);
return change;
}
@@ -1069,7 +1065,7 @@ add_directory_cb(void *baton,
struct change_node *change = insert_change(relpath, eb->changes);
change->action = RESTRUCTURE_ADD;
- change->kind = svn_kind_dir;
+ change->kind = svn_node_dir;
change->deleting = replaces_rev;
change->props = svn_prop_hash_dup(props, eb->edit_pool);
@@ -1106,7 +1102,7 @@ add_file_cb(void *baton,
SVN_ERR(svn_stream_copy3(contents, tmp_stream, NULL, NULL, scratch_pool));
change->action = RESTRUCTURE_ADD;
- change->kind = svn_kind_file;
+ change->kind = svn_node_file;
change->deleting = replaces_rev;
change->props = svn_prop_hash_dup(props, eb->edit_pool);
change->contents_abspath = tmp_filename;
@@ -1129,7 +1125,7 @@ add_symlink_cb(void *baton,
struct change_node *change = insert_change(relpath, eb->changes);
change->action = RESTRUCTURE_ADD;
- change->kind = svn_kind_symlink;
+ change->kind = svn_node_symlink;
change->deleting = replaces_rev;
change->props = svn_prop_hash_dup(props, eb->edit_pool);
/* ### target */
@@ -1142,7 +1138,7 @@ add_symlink_cb(void *baton,
static svn_error_t *
add_absent_cb(void *baton,
const char *relpath,
- svn_kind_t kind,
+ svn_node_kind_t kind,
svn_revnum_t replaces_rev,
apr_pool_t *scratch_pool)
{
@@ -1174,7 +1170,7 @@ alter_directory_cb(void *baton,
/* Note: this node may already have information in CHANGE as a result
of an earlier copy/move operation. */
- change->kind = svn_kind_dir;
+ change->kind = svn_node_dir;
change->changing = revision;
change->props = svn_prop_hash_dup(props, eb->edit_pool);
@@ -1220,7 +1216,7 @@ alter_file_cb(void *baton,
/* Note: this node may already have information in CHANGE as a result
of an earlier copy/move operation. */
- change->kind = svn_kind_file;
+ change->kind = svn_node_file;
change->changing = revision;
if (props != NULL)
change->props = svn_prop_hash_dup(props, eb->edit_pool);
@@ -1260,7 +1256,7 @@ delete_cb(void *baton,
struct change_node *change = insert_change(relpath, eb->changes);
change->action = RESTRUCTURE_DELETE;
- /* change->kind = svn_kind_unknown; */
+ /* change->kind = svn_node_unknown; */
change->deleting = revision;
return SVN_NO_ERROR;
@@ -1279,7 +1275,7 @@ copy_cb(void *baton,
struct change_node *change = insert_change(dst_relpath, eb->changes);
change->action = RESTRUCTURE_ADD;
- /* change->kind = svn_kind_unknown; */
+ /* change->kind = svn_node_unknown; */
change->deleting = replaces_rev;
change->copyfrom_path = apr_pstrdup(eb->edit_pool, src_relpath);
change->copyfrom_rev = src_revision;
@@ -1312,12 +1308,12 @@ move_cb(void *baton,
change = insert_change(src_relpath, eb->changes);
change->action = RESTRUCTURE_DELETE;
- /* change->kind = svn_kind_unknown; */
+ /* change->kind = svn_node_unknown; */
change->deleting = src_revision;
change = insert_change(dst_relpath, eb->changes);
change->action = RESTRUCTURE_ADD;
- /* change->kind = svn_kind_unknown; */
+ /* change->kind = svn_node_unknown; */
change->deleting = replaces_rev;
change->copyfrom_path = apr_pstrdup(eb->edit_pool, src_relpath);
change->copyfrom_rev = src_revision;
@@ -1531,7 +1527,7 @@ drive_ev1_props(const struct editor_bato
svn_pool_clear(iterpool);
- if (change->kind == svn_kind_dir)
+ if (change->kind == svn_node_dir)
SVN_ERR(eb->deditor->change_dir_prop(node_baton,
prop->name, prop->value,
iterpool));
@@ -1544,7 +1540,7 @@ drive_ev1_props(const struct editor_bato
/* Handle the funky unlock protocol. Note: only possibly on files. */
if (change->unlock)
{
- SVN_ERR_ASSERT(change->kind == svn_kind_file);
+ SVN_ERR_ASSERT(change->kind == svn_node_file);
SVN_ERR(eb->deditor->change_file_prop(node_baton,
SVN_PROP_ENTRY_LOCK_TOKEN, NULL,
iterpool));
@@ -1574,7 +1570,7 @@ apply_change(void **dir_baton,
*dir_baton = NULL;
relpath = svn_relpath_join(eb->base_relpath, ev1_relpath, scratch_pool);
- change = apr_hash_get(eb->changes, relpath, APR_HASH_KEY_STRING);
+ change = svn_hash_gets(eb->changes, relpath);
/* The callback should only be called for paths in CHANGES. */
SVN_ERR_ASSERT(change != NULL);
@@ -1603,11 +1599,11 @@ apply_change(void **dir_baton,
}
/* If we're not deleting this node, then we should know its kind. */
- SVN_ERR_ASSERT(change->kind != svn_kind_unknown);
+ SVN_ERR_ASSERT(change->kind != svn_node_unknown);
if (change->action == RESTRUCTURE_ADD_ABSENT)
{
- if (change->kind == svn_kind_dir)
+ if (change->kind == svn_node_dir)
SVN_ERR(eb->deditor->absent_directory(ev1_relpath, parent_baton,
scratch_pool));
else
@@ -1646,7 +1642,7 @@ apply_change(void **dir_baton,
copyfrom_rev = change->copyfrom_rev;
}
- if (change->kind == svn_kind_dir)
+ if (change->kind == svn_node_dir)
SVN_ERR(eb->deditor->add_directory(ev1_relpath, parent_baton,
copyfrom_url, copyfrom_rev,
result_pool, dir_baton));
@@ -1657,7 +1653,7 @@ apply_change(void **dir_baton,
}
else
{
- if (change->kind == svn_kind_dir)
+ if (change->kind == svn_node_dir)
SVN_ERR(eb->deditor->open_directory(ev1_relpath, parent_baton,
change->changing,
result_pool, dir_baton));
@@ -1668,7 +1664,7 @@ apply_change(void **dir_baton,
}
/* Apply any properties in CHANGE to the node. */
- if (change->kind == svn_kind_dir)
+ if (change->kind == svn_node_dir)
SVN_ERR(drive_ev1_props(eb, relpath, change, *dir_baton, scratch_pool));
else
SVN_ERR(drive_ev1_props(eb, relpath, change, file_baton, scratch_pool));
@@ -1720,7 +1716,7 @@ drive_changes(const struct editor_baton
did in start_edit_func(). We can forge up a change record, if one
does not already exist. */
change = insert_change(eb->base_relpath, eb->changes);
- change->kind = svn_kind_dir;
+ change->kind = svn_node_dir;
/* No property changes (tho they might exist from a real change). */
/* Get a sorted list of Ev1-relative paths. */
Modified: subversion/branches/master-passphrase/subversion/libsvn_delta/compose_delta.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_delta/compose_delta.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_delta/compose_delta.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_delta/compose_delta.c Fri May 10 14:58:47 2013
@@ -648,15 +648,17 @@ copy_source_ops(apr_size_t offset, apr_s
{
const svn_txdelta_op_t *const op = &window->ops[op_ndx];
const apr_size_t *const off = &ndx->offs[op_ndx];
- apr_size_t fix_offset;
- apr_size_t fix_limit;
+ const apr_size_t fix_offset = (offset > off[0] ? offset - off[0] : 0);
+ const apr_size_t fix_limit = (off[1] > limit ? off[1] - limit : 0);
+ /* Ideally, we'd do this check before assigning fix_offset and
+ fix_limit; but then we couldn't make them const whilst still
+ adhering to C90 rules. Instead, we're going to assume that a
+ smart optimizing compiler will reorder this check before the
+ local variable initialization. */
if (off[0] >= limit)
break;
- fix_offset = (offset > off[0] ? offset - off[0] : 0);
- fix_limit = (off[1] > limit ? off[1] - limit : 0);
-
/* It would be extremely weird if the fixed-up op had zero length. */
assert(fix_offset + fix_limit < op->length);
@@ -701,23 +703,22 @@ copy_source_ops(apr_size_t offset, apr_s
apr_size_t tgt_off = target_offset;
assert(ptn_length > ptn_overlap);
- /* ### FIXME: ptn_overlap is unsigned, so the if() condition
- below is always true! Either it should be '> 0', or the
- code block should be unconditional. See also r842362. */
- if (ptn_overlap >= 0)
- {
- /* Issue second subrange in the pattern. */
- const apr_size_t length =
- MIN(op->length - fix_off - fix_limit,
- ptn_length - ptn_overlap);
- copy_source_ops(op->offset + ptn_overlap,
- op->offset + ptn_overlap + length,
- tgt_off,
- op_ndx,
- build_baton, window, ndx, pool);
- fix_off += length;
- tgt_off += length;
- }
+ /* Unconditionally issue the second subrange of the
+ pattern. This is always correct, since the outer
+ condition already verifies that there is an overlap
+ in the target copy. */
+ {
+ const apr_size_t length =
+ MIN(op->length - fix_off - fix_limit,
+ ptn_length - ptn_overlap);
+ copy_source_ops(op->offset + ptn_overlap,
+ op->offset + ptn_overlap + length,
+ tgt_off,
+ op_ndx,
+ build_baton, window, ndx, pool);
+ fix_off += length;
+ tgt_off += length;
+ }
assert(fix_off + fix_limit <= op->length);
if (ptn_overlap > 0
Modified: subversion/branches/master-passphrase/subversion/libsvn_delta/editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_delta/editor.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_delta/editor.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_delta/editor.c Fri May 10 14:58:47 2013
@@ -35,7 +35,7 @@
introduce additional memory and runtime overhead, and should not be used
in production builds.
- ### Remove before release?
+ ### Remove before release?
### Disabled for now. If I call svn_editor_alter_directory(A) then
svn_editor_add_file(A/f) the latter fails on SHOULD_ALLOW_ADD.
@@ -110,19 +110,16 @@ static const int marker_added_dir = 0;
#define SHOULD_NOT_BE_FINISHED(editor) SVN_ERR_ASSERT(!(editor)->finished)
#define CLEAR_INCOMPLETE(editor, relpath) \
- apr_hash_set((editor)->pending_incomplete_children, relpath, \
- APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets((editor)->pending_incomplete_children, relpath, NULL);
#define MARK_RELPATH(editor, relpath, value) \
- apr_hash_set((editor)->completed_nodes, \
- apr_pstrdup((editor)->state_pool, relpath), \
- APR_HASH_KEY_STRING, value)
+ svn_hash_sets((editor)->completed_nodes, \
+ apr_pstrdup((editor)->state_pool, relpath), value)
#define MARK_COMPLETED(editor, relpath) \
MARK_RELPATH(editor, relpath, MARKER_DONE)
#define SHOULD_NOT_BE_COMPLETED(editor, relpath) \
- SVN_ERR_ASSERT(apr_hash_get((editor)->completed_nodes, relpath, \
- APR_HASH_KEY_STRING) == NULL)
+ SVN_ERR_ASSERT(svn_hash_gets((editor)->completed_nodes, relpath) == NULL)
#define MARK_ALLOW_ADD(editor, relpath) \
MARK_RELPATH(editor, relpath, MARKER_ALLOW_ADD)
@@ -148,10 +145,10 @@ static const int marker_added_dir = 0;
/* If the parent is MARKER_ALLOW_ADD, then it has been moved-away, and we
know it does not exist. All other cases: it might exist. */
#define VERIFY_PARENT_MAY_EXIST(editor, relpath) \
- SVN_ERR_ASSERT(apr_hash_get((editor)->completed_nodes, \
- svn_relpath_dirname(relpath, \
- (editor)->scratch_pool), \
- APR_HASH_KEY_STRING) != MARKER_ALLOW_ADD)
+ SVN_ERR_ASSERT(svn_hash_gets((editor)->completed_nodes, \
+ svn_relpath_dirname(relpath, \
+ (editor)->scratch_pool)) \
+ != MARKER_ALLOW_ADD)
/* If the parent is MARKER_ADDED_DIR, then we should not be deleting
children(*). If the parent is MARKER_ALLOW_ADD, then it has been
@@ -175,8 +172,7 @@ allow_either(const svn_editor_t *editor,
const void *marker1,
const void *marker2)
{
- void *value = apr_hash_get(editor->completed_nodes, relpath,
- APR_HASH_KEY_STRING);
+ void *value = svn_hash_gets(editor->completed_nodes, relpath);
return value == marker1 || value == marker2;
}
@@ -187,14 +183,13 @@ check_unknown_child(const svn_editor_t *
const char *parent;
/* If we already know about the new child, then exit early. */
- if (apr_hash_get(editor->pending_incomplete_children, relpath,
- APR_HASH_KEY_STRING) != NULL)
+ if (svn_hash_gets(editor->pending_incomplete_children, relpath) != NULL)
return TRUE;
parent = svn_relpath_dirname(relpath, editor->scratch_pool);
/* Was this parent created via svn_editor_add_directory() ? */
- if (apr_hash_get(editor->completed_nodes, parent, APR_HASH_KEY_STRING)
+ if (svn_hash_gets(editor->completed_nodes, parent)
== MARKER_ADDED_DIR)
{
/* Whoops. This child should have been listed in that add call,
@@ -211,8 +206,7 @@ mark_parent_stable(const svn_editor_t *e
const char *relpath)
{
const char *parent = svn_relpath_dirname(relpath, editor->scratch_pool);
- const void *marker = apr_hash_get(editor->completed_nodes,
- parent, APR_HASH_KEY_STRING);
+ const void *marker = svn_hash_gets(editor->completed_nodes, parent);
/* If RELPATH has already been marked (to disallow adds, or that it
has been fully-completed), then do nothing. */
@@ -511,8 +505,7 @@ svn_editor_add_directory(svn_editor_t *e
const char *child = svn_relpath_join(relpath, child_basename,
editor->state_pool);
- apr_hash_set(editor->pending_incomplete_children, child,
- APR_HASH_KEY_STRING, "");
+ svn_hash_sets(editor->pending_incomplete_children, child, "");
}
}
#endif
@@ -600,7 +593,7 @@ svn_editor_add_symlink(svn_editor_t *edi
svn_error_t *
svn_editor_add_absent(svn_editor_t *editor,
const char *relpath,
- svn_kind_t kind,
+ svn_node_kind_t kind,
svn_revnum_t replaces_rev)
{
svn_error_t *err = SVN_NO_ERROR;
Modified: subversion/branches/master-passphrase/subversion/libsvn_delta/svndiff.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_delta/svndiff.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_delta/svndiff.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_delta/svndiff.c Fri May 10 14:58:47 2013
@@ -216,7 +216,7 @@ send_simple_insertion_window(svn_txdelta
{
header_current = headers;
}
-
+
/* Encode the action code and length. */
if (window->tview_len >> 6 == 0)
{
@@ -242,7 +242,7 @@ send_simple_insertion_window(svn_txdelta
header_current[i] = ibuf[i];
header_len = header_current - headers + ip_len;
-
+
/* Write out the window. */
SVN_ERR(svn_stream_write(eb->output, (const char *)headers, &header_len));
if (len)
Modified: subversion/branches/master-passphrase/subversion/libsvn_delta/text_delta.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_delta/text_delta.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_delta/text_delta.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_delta/text_delta.c Fri May 10 14:58:47 2013
@@ -935,28 +935,28 @@ svn_error_t *svn_txdelta_send_stream(svn
while (1)
{
apr_size_t read_len = SVN__STREAM_CHUNK_SIZE;
-
+
SVN_ERR(svn_stream_read(stream, read_buf, &read_len));
if (read_len == 0)
break;
-
+
window_data.data = read_buf;
window_data.len = read_len;
-
+
delta_op.action_code = svn_txdelta_new;
delta_op.offset = 0;
delta_op.length = read_len;
-
+
delta_window.tview_len = read_len;
delta_window.num_ops = 1;
delta_window.ops = &delta_op;
delta_window.new_data = &window_data;
-
+
SVN_ERR(handler(&delta_window, handler_baton));
if (digest)
SVN_ERR(svn_checksum_update(md5_checksum_ctx, read_buf, read_len));
-
+
if (read_len < SVN__STREAM_CHUNK_SIZE)
break;
}
@@ -969,7 +969,7 @@ svn_error_t *svn_txdelta_send_stream(svn
SVN_ERR(svn_checksum_final(&md5_checksum, md5_checksum_ctx, pool));
memcpy(digest, md5_checksum->digest, APR_MD5_DIGESTSIZE);
}
-
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/master-passphrase/subversion/libsvn_delta/xdelta.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_delta/xdelta.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_delta/xdelta.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_delta/xdelta.c Fri May 10 14:58:47 2013
@@ -27,6 +27,7 @@
#include <apr_general.h> /* for APR_INLINE */
#include <apr_hash.h>
+#include "svn_hash.h"
#include "svn_delta.h"
#include "delta.h"
Modified: subversion/branches/master-passphrase/subversion/libsvn_diff/diff_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_diff/diff_file.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_diff/diff_file.c Fri May 10 14:58:47 2013
@@ -448,7 +448,7 @@ find_identical_prefix(svn_boolean_t *rea
file[i].curp += delta;
/* Skipped data without EOL markers, so last char was not a CR. */
- had_cr = FALSE;
+ had_cr = FALSE;
}
#endif
@@ -544,6 +544,13 @@ find_identical_suffix(apr_off_t *suffix_
file_for_suffix[i].chunk =
(int) offset_to_chunk(file_for_suffix[i].size); /* last chunk */
length[i] = offset_in_chunk(file_for_suffix[i].size);
+ if (length[i] == 0)
+ {
+ /* last chunk is an empty chunk -> start at next-to-last chunk */
+ file_for_suffix[i].chunk = file_for_suffix[i].chunk - 1;
+ length[i] = CHUNK_SIZE;
+ }
+
if (file_for_suffix[i].chunk == file[i].chunk)
{
/* Prefix ended in last chunk, so we can reuse the prefix buffer */
Modified: subversion/branches/master-passphrase/subversion/libsvn_diff/diff_memory.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_diff/diff_memory.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_diff/diff_memory.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_diff/diff_memory.c Fri May 10 14:58:47 2013
@@ -425,7 +425,7 @@ output_unified_token_range(output_baton_
break;
}
- if (btn->current_token[tokens] == source->tokens->nelts
+ if (btn->current_token[tokens] == source->tokens->nelts
&& source->ends_without_eol)
{
const char *out_str;
@@ -436,7 +436,7 @@ output_unified_token_range(output_baton_
svn_stringbuf_appendcstr(btn->hunk, out_str);
}
-
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/master-passphrase/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_diff/parse-diff.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_diff/parse-diff.c Fri May 10 14:58:47 2013
@@ -25,6 +25,7 @@
#include <stddef.h>
#include <string.h>
+#include "svn_hash.h"
#include "svn_types.h"
#include "svn_error.h"
#include "svn_io.h"
@@ -1110,8 +1111,7 @@ add_property_hunk(svn_patch_t *patch, co
{
svn_prop_patch_t *prop_patch;
- prop_patch = apr_hash_get(patch->prop_patches, prop_name,
- APR_HASH_KEY_STRING);
+ prop_patch = svn_hash_gets(patch->prop_patches, prop_name);
if (! prop_patch)
{
@@ -1121,8 +1121,7 @@ add_property_hunk(svn_patch_t *patch, co
prop_patch->hunks = apr_array_make(result_pool, 1,
sizeof(svn_diff_hunk_t *));
- apr_hash_set(patch->prop_patches, prop_name, APR_HASH_KEY_STRING,
- prop_patch);
+ svn_hash_sets(patch->prop_patches, prop_name, prop_patch);
}
APR_ARRAY_PUSH(prop_patch->hunks, svn_diff_hunk_t *) = hunk;
Modified: subversion/branches/master-passphrase/subversion/libsvn_diff/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_diff/util.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_diff/util.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_diff/util.c Fri May 10 14:58:47 2013
@@ -25,6 +25,7 @@
#include <apr.h>
#include <apr_general.h>
+#include "svn_hash.h"
#include "svn_pools.h"
#include "svn_dirent_uri.h"
#include "svn_props.h"
@@ -504,8 +505,7 @@ svn_diff__display_prop_diffs(svn_stream_
= &APR_ARRAY_IDX(propchanges, i, svn_prop_t);
if (original_props)
- original_value = apr_hash_get(original_props,
- propchange->name, APR_HASH_KEY_STRING);
+ original_value = svn_hash_gets(original_props, propchange->name);
else
original_value = NULL;
Modified: subversion/branches/master-passphrase/subversion/libsvn_fs/access.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_fs/access.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_fs/access.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_fs/access.c Fri May 10 14:58:47 2013
@@ -24,6 +24,7 @@
#include <apr_hash.h>
+#include "svn_hash.h"
#include "svn_types.h"
#include "svn_pools.h"
#include "svn_fs.h"
@@ -86,8 +87,7 @@ svn_fs_access_add_lock_token2(svn_fs_acc
const char *path,
const char *token)
{
- apr_hash_set(access_ctx->lock_tokens,
- token, APR_HASH_KEY_STRING, path);
+ svn_hash_sets(access_ctx->lock_tokens, token, path);
return SVN_NO_ERROR;
}
Modified: subversion/branches/master-passphrase/subversion/libsvn_fs/editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_fs/editor.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_fs/editor.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_fs/editor.c Fri May 10 14:58:47 2013
@@ -28,6 +28,7 @@
#include "svn_pools.h"
#include "svn_fs.h"
#include "svn_props.h"
+#include "svn_path.h"
#include "svn_private_config.h"
@@ -443,7 +444,7 @@ add_symlink_cb(void *baton,
static svn_error_t *
add_absent_cb(void *baton,
const char *relpath,
- svn_kind_t kind,
+ svn_node_kind_t kind,
svn_revnum_t replaces_rev,
apr_pool_t *scratch_pool)
{
Modified: subversion/branches/master-passphrase/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_fs/fs-loader.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_fs/fs-loader.c Fri May 10 14:58:47 2013
@@ -30,6 +30,7 @@
#include <apr_uuid.h>
#include <apr_strings.h>
+#include "svn_hash.h"
#include "svn_ctype.h"
#include "svn_types.h"
#include "svn_dso.h"
@@ -48,7 +49,6 @@
#include "private/svn_subr_private.h"
#include "fs-loader.h"
-#include "svn_hash.h"
/* This is defined by configure on platforms which use configure, but
we need to define a fallback for Windows. */
@@ -239,7 +239,7 @@ get_library_vtable(fs_library_vtable_t *
#if defined(SVN_USE_DSO) && APR_HAS_DSO
/* Third party FS modules that are unknown at compile time.
-
+
A third party FS is identified by the file fs-type containing a
third party name, say "foo". The loader will load the DSO with
the name "libsvn_fs_foo" and use the entry point with the name
@@ -451,6 +451,8 @@ svn_fs_create(svn_fs_t **fs_p, const cha
SVN_MUTEX__WITH_LOCK(common_pool_lock,
vtable->create(*fs_p, path, pool, common_pool));
+ SVN_ERR(vtable->set_svn_fs_open(*fs_p, svn_fs_open));
+
return SVN_NO_ERROR;
}
@@ -464,6 +466,8 @@ svn_fs_open(svn_fs_t **fs_p, const char
*fs_p = fs_new(fs_config, pool);
SVN_MUTEX__WITH_LOCK(common_pool_lock,
vtable->open_fs(*fs_p, path, pool, common_pool));
+ SVN_ERR(vtable->set_svn_fs_open(*fs_p, svn_fs_open));
+
return SVN_NO_ERROR;
}
@@ -483,6 +487,7 @@ svn_fs_upgrade(const char *path, apr_poo
svn_error_t *
svn_fs_verify(const char *path,
+ apr_hash_t *fs_config,
svn_revnum_t start,
svn_revnum_t end,
svn_fs_progress_notify_func_t notify_func,
@@ -495,7 +500,7 @@ svn_fs_verify(const char *path,
svn_fs_t *fs;
SVN_ERR(fs_library_vtable(&vtable, path, pool));
- fs = fs_new(NULL, pool);
+ fs = fs_new(fs_config, pool);
SVN_MUTEX__WITH_LOCK(common_pool_lock,
vtable->verify_fs(fs, path, start, end,
@@ -511,6 +516,15 @@ svn_fs_path(svn_fs_t *fs, apr_pool_t *po
return apr_pstrdup(pool, fs->path);
}
+apr_hash_t *
+svn_fs_config(svn_fs_t *fs, apr_pool_t *pool)
+{
+ if (fs->config)
+ return apr_hash_copy(pool, fs->config);
+
+ return NULL;
+}
+
svn_error_t *
svn_fs_delete_fs(const char *path, apr_pool_t *pool)
{
@@ -629,22 +643,22 @@ svn_fs_recover(const char *path,
}
svn_error_t *
-svn_fs_verify_rev(svn_fs_t *fs,
- svn_revnum_t revision,
- apr_pool_t *scratch_pool)
+svn_fs_verify_root(svn_fs_root_t *root,
+ apr_pool_t *scratch_pool)
{
- SVN_ERR(fs->vtable->verify_rev(fs, revision, scratch_pool));
+ svn_fs_t *fs = root->fs;
+ SVN_ERR(fs->vtable->verify_root(root, scratch_pool));
return SVN_NO_ERROR;
}
svn_error_t *
svn_fs_freeze(svn_fs_t *fs,
- svn_error_t *(*freeze_body)(void *baton, apr_pool_t *pool),
- void *baton,
+ svn_fs_freeze_func_t freeze_func,
+ void *freeze_baton,
apr_pool_t *pool)
{
- SVN_ERR(fs->vtable->freeze(fs, freeze_body, baton, pool));
+ SVN_ERR(fs->vtable->freeze(fs, freeze_func, freeze_baton, pool));
return SVN_NO_ERROR;
}
@@ -666,6 +680,8 @@ svn_fs_create_berkeley(svn_fs_t *fs, con
/* Perform the actual creation. */
SVN_MUTEX__WITH_LOCK(common_pool_lock,
vtable->create(fs, path, fs->pool, common_pool));
+ SVN_ERR(vtable->set_svn_fs_open(fs, svn_fs_open));
+
return SVN_NO_ERROR;
}
@@ -677,6 +693,8 @@ svn_fs_open_berkeley(svn_fs_t *fs, const
SVN_ERR(fs_library_vtable(&vtable, path, fs->pool));
SVN_MUTEX__WITH_LOCK(common_pool_lock,
vtable->open_fs(fs, path, fs->pool, common_pool));
+ SVN_ERR(vtable->set_svn_fs_open(fs, svn_fs_open));
+
return SVN_NO_ERROR;
}
@@ -750,16 +768,10 @@ svn_fs_commit_txn(const char **conflict_
svn_fs_txn_t *txn, apr_pool_t *pool)
{
svn_error_t *err;
-#ifdef PACK_AFTER_EVERY_COMMIT
- svn_fs_root_t *txn_root;
- svn_fs_t *fs;
- const char *fs_path;
*new_rev = SVN_INVALID_REVNUM;
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
- fs = svn_fs_root_fs(txn_root);
- fs_path = svn_fs_path(fs, pool);
-#endif
+ if (conflict_p)
+ *conflict_p = NULL;
err = txn->vtable->commit(conflict_p, new_rev, txn, pool);
@@ -779,6 +791,8 @@ svn_fs_commit_txn(const char **conflict_
#ifdef PACK_AFTER_EVERY_COMMIT
{
+ svn_fs_t *fs = txn->fs;
+ const char *fs_path = svn_fs_path(fs, pool);
err = svn_fs_pack(fs_path, NULL, NULL, NULL, NULL, pool);
if (err && err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE)
/* Pre-1.6 filesystem. */
@@ -1303,6 +1317,29 @@ svn_fs_youngest_rev(svn_revnum_t *younge
}
svn_error_t *
+svn_fs_info_format(int *fs_format,
+ svn_version_t **supports_version,
+ svn_fs_t *fs,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ return svn_error_trace(fs->vtable->info_format(fs_format, supports_version,
+ fs,
+ result_pool, scratch_pool));
+}
+
+svn_error_t *
+svn_fs_info_config_files(apr_array_header_t **files,
+ svn_fs_t *fs,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ return svn_error_trace(fs->vtable->info_config_files(files, fs,
+ result_pool,
+ scratch_pool));
+}
+
+svn_error_t *
svn_fs_deltify_revision(svn_fs_t *fs, svn_revnum_t revision, apr_pool_t *pool)
{
return svn_error_trace(fs->vtable->deltify(fs, revision, pool));
@@ -1586,3 +1623,43 @@ svn_fs_version(void)
{
SVN_VERSION_BODY;
}
+
+
+/** info **/
+svn_error_t *
+svn_fs_info(const svn_fs_info_placeholder_t **info_p,
+ svn_fs_t *fs,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ if (fs->vtable->info_fsap)
+ {
+ SVN_ERR(fs->vtable->info_fsap((const void **)info_p, fs,
+ result_pool, scratch_pool));
+ }
+ else
+ {
+ svn_fs_info_placeholder_t *info = apr_palloc(result_pool, sizeof(*info));
+ /* ### Ask the disk(!), since svn_fs_t doesn't cache the answer. */
+ SVN_ERR(svn_fs_type(&info->fs_type, fs->path, result_pool));
+ *info_p = info;
+ }
+ return SVN_NO_ERROR;
+}
+
+void *
+svn_fs_info_dup(const void *info_void,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ const svn_fs_info_placeholder_t *info = info_void;
+ fs_library_vtable_t *vtable;
+
+ SVN_ERR(get_library_vtable(&vtable, info->fs_type, scratch_pool));
+
+ if (vtable->info_fsap_dup)
+ return vtable->info_fsap_dup(info_void, result_pool);
+ else
+ return apr_pmemdup(result_pool, info, sizeof(*info));
+}
+