You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/08/16 12:18:03 UTC
svn commit: r1373783 [39/50] - in /subversion/branches/compressed-pristines:
./ build/ build/ac-macros/ build/generator/ build/generator/templates/
build/win32/ contrib/client-side/emacs/ contrib/client-side/svn-push/
contrib/client-side/svnmerge/ cont...
Modified: subversion/branches/compressed-pristines/subversion/svn/propget-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/propget-cmd.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/propget-cmd.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/propget-cmd.c Thu Aug 16 10:17:48 2012
@@ -34,6 +34,7 @@
#include "svn_error_codes.h"
#include "svn_error.h"
#include "svn_utf.h"
+#include "svn_sorts.h"
#include "svn_subst.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
@@ -71,13 +72,16 @@ print_properties_xml(const char *pname,
apr_hash_t *props,
apr_pool_t *pool)
{
- apr_hash_index_t *hi;
+ apr_array_header_t *sorted_props;
+ int i;
apr_pool_t *iterpool = svn_pool_create(pool);
- for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
+ sorted_props = svn_sort__hash(props, svn_sort_compare_items_as_paths, pool);
+ for (i = 0; i < sorted_props->nelts; i++)
{
- const char *filename = svn__apr_hash_index_key(hi);
- svn_string_t *propval = svn__apr_hash_index_val(hi);
+ svn_sort__item_t item = APR_ARRAY_IDX(sorted_props, i, svn_sort__item_t);
+ const char *filename = item.key;
+ svn_string_t *propval = item.value;
svn_stringbuf_t *sb = NULL;
svn_pool_clear(iterpool);
@@ -115,16 +119,19 @@ print_properties(svn_stream_t *out,
svn_boolean_t like_proplist,
apr_pool_t *pool)
{
- apr_hash_index_t *hi;
+ apr_array_header_t *sorted_props;
+ int i;
apr_pool_t *iterpool = svn_pool_create(pool);
const char *path_prefix;
SVN_ERR(svn_dirent_get_absolute(&path_prefix, "", pool));
- for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
+ sorted_props = svn_sort__hash(props, svn_sort_compare_items_as_paths, pool);
+ for (i = 0; i < sorted_props->nelts; i++)
{
- const char *filename = svn__apr_hash_index_key(hi);
- svn_string_t *propval = svn__apr_hash_index_val(hi);
+ svn_sort__item_t item = APR_ARRAY_IDX(sorted_props, i, svn_sort__item_t);
+ const char *filename = item.key;
+ svn_string_t *propval = item.value;
svn_pool_clear(iterpool);
Modified: subversion/branches/compressed-pristines/subversion/svn/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/props.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/props.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/props.c Thu Aug 16 10:17:48 2012
@@ -31,6 +31,7 @@
#include "svn_cmdline.h"
#include "svn_string.h"
#include "svn_error.h"
+#include "svn_sorts.h"
#include "svn_subst.h"
#include "svn_props.h"
#include "svn_string.h"
@@ -87,14 +88,17 @@ svn_cl__print_prop_hash(svn_stream_t *ou
svn_boolean_t names_only,
apr_pool_t *pool)
{
- apr_hash_index_t *hi;
+ apr_array_header_t *sorted_props;
+ int i;
- for (hi = apr_hash_first(pool, prop_hash); hi; hi = apr_hash_next(hi))
+ sorted_props = svn_sort__hash(prop_hash, svn_sort_compare_items_lexically,
+ pool);
+ for (i = 0; i < sorted_props->nelts; i++)
{
- const char *pname = svn__apr_hash_index_key(hi);
- svn_string_t *propval = svn__apr_hash_index_val(hi);
+ svn_sort__item_t item = APR_ARRAY_IDX(sorted_props, i, svn_sort__item_t);
+ const char *pname = item.key;
+ svn_string_t *propval = item.value;
const char *pname_stdout;
- apr_size_t len;
if (svn_prop_needs_translation(pname))
SVN_ERR(svn_subst_detranslate_string(&propval, propval,
@@ -112,8 +116,7 @@ svn_cl__print_prop_hash(svn_stream_t *ou
FALSE, /* no expansion */
pool));
- len = strlen(pname_stdout);
- SVN_ERR(svn_stream_write(out, pname_stdout, &len));
+ SVN_ERR(svn_stream_puts(out, pname_stdout));
}
else
{
@@ -134,8 +137,7 @@ svn_cl__print_prop_hash(svn_stream_t *ou
pool);
if (out)
{
- len = strlen(indented_newval);
- SVN_ERR(svn_stream_write(out, indented_newval, &len));
+ SVN_ERR(svn_stream_puts(out, indented_newval));
}
else
{
@@ -153,15 +155,19 @@ svn_cl__print_xml_prop_hash(svn_stringbu
svn_boolean_t names_only,
apr_pool_t *pool)
{
- apr_hash_index_t *hi;
+ apr_array_header_t *sorted_props;
+ int i;
if (*outstr == NULL)
*outstr = svn_stringbuf_create_empty(pool);
- for (hi = apr_hash_first(pool, prop_hash); hi; hi = apr_hash_next(hi))
+ sorted_props = svn_sort__hash(prop_hash, svn_sort_compare_items_lexically,
+ pool);
+ for (i = 0; i < sorted_props->nelts; i++)
{
- const char *pname = svn__apr_hash_index_key(hi);
- svn_string_t *propval = svn__apr_hash_index_val(hi);
+ svn_sort__item_t item = APR_ARRAY_IDX(sorted_props, i, svn_sort__item_t);
+ const char *pname = item.key;
+ svn_string_t *propval = item.value;
if (names_only)
{
Modified: subversion/branches/compressed-pristines/subversion/svn/resolve-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/resolve-cmd.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/resolve-cmd.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/resolve-cmd.c Thu Aug 16 10:17:48 2012
@@ -55,6 +55,8 @@ svn_cl__resolve(apr_getopt_t *os,
int i;
apr_pool_t *iterpool;
svn_boolean_t had_error = FALSE;
+ svn_wc_conflict_resolver_func2_t conflict_func2;
+ void *conflict_baton2;
switch (opt_state->accept_which)
{
@@ -77,8 +79,11 @@ svn_cl__resolve(apr_getopt_t *os,
conflict_choice = svn_wc_conflict_choose_mine_full;
break;
case svn_cl__accept_unspecified:
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("missing --accept option"));
+ if (opt_state->conflict_func == NULL)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("missing --accept option"));
+ conflict_choice = svn_wc_conflict_choose_unspecified;
+ break;
default:
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("invalid 'accept' ARG"));
@@ -89,15 +94,28 @@ svn_cl__resolve(apr_getopt_t *os,
ctx, FALSE,
scratch_pool));
if (! targets->nelts)
- return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);
+ svn_opt_push_implicit_dot_target(targets, scratch_pool);
if (opt_state->depth == svn_depth_unknown)
- opt_state->depth = svn_depth_empty;
+ {
+ if (opt_state->accept_which == svn_cl__accept_unspecified)
+ opt_state->depth = svn_depth_infinity;
+ else
+ opt_state->depth = svn_depth_empty;
+ }
SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, scratch_pool));
SVN_ERR(svn_cl__check_targets_are_local_paths(targets));
+ /* Store old state */
+ conflict_func2 = ctx->conflict_func2;
+ conflict_baton2 = ctx->conflict_baton2;
+
+ /* Store interactive resolver */
+ ctx->conflict_func2 = opt_state->conflict_func;
+ ctx->conflict_baton2 = opt_state->conflict_baton;
+
iterpool = svn_pool_create(scratch_pool);
for (i = 0; i < targets->nelts; i++)
{
@@ -117,6 +135,10 @@ svn_cl__resolve(apr_getopt_t *os,
}
svn_pool_destroy(iterpool);
+ /* Restore state */
+ ctx->conflict_func2 = conflict_func2;
+ ctx->conflict_baton2 = conflict_baton2;
+
if (had_error)
return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
_("Failure occurred resolving one or more "
Modified: subversion/branches/compressed-pristines/subversion/svn/status-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/status-cmd.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/status-cmd.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/status-cmd.c Thu Aug 16 10:17:48 2012
@@ -349,7 +349,7 @@ svn_cl__status(apr_getopt_t *os,
NULL, opt_state->quiet,
/* not versioned: */
SVN_ERR_WC_NOT_WORKING_COPY,
- SVN_NO_ERROR));
+ SVN_ERR_WC_PATH_NOT_FOUND));
if (opt_state->xml)
SVN_ERR(print_finish_target_xml(repos_rev, iterpool));
Modified: subversion/branches/compressed-pristines/subversion/svn/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/status.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/status.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/status.c Thu Aug 16 10:17:48 2012
@@ -87,6 +87,17 @@ combined_status(const svn_client_status_
return new_status;
}
+/* Return the combined repository STATUS as shown in 'svn status' based
+ on the repository node status and repository text status */
+static enum svn_wc_status_kind
+combined_repos_status(const svn_client_status_t *status)
+{
+ if (status->repos_node_status == svn_wc_status_modified)
+ return status->repos_text_status;
+
+ return status->repos_node_status;
+}
+
/* Return the single character representation of the switched column
status. */
static char
@@ -509,7 +520,7 @@ svn_cl__print_status_xml(const char *cwd
{
svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "repos-status",
"item",
- generate_status_desc(status->repos_text_status),
+ generate_status_desc(combined_repos_status(status)),
"props",
generate_status_desc(status->repos_prop_status),
NULL);
Modified: subversion/branches/compressed-pristines/subversion/svn/switch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/switch-cmd.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/switch-cmd.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/switch-cmd.c Thu Aug 16 10:17:48 2012
@@ -93,7 +93,8 @@ svn_cl__switch(apr_getopt_t *os,
void *baton,
apr_pool_t *scratch_pool)
{
- svn_error_t *err;
+ svn_error_t *err = SVN_NO_ERROR;
+ svn_error_t *externals_err = SVN_NO_ERROR;
svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
apr_array_header_t *targets;
@@ -156,6 +157,9 @@ svn_cl__switch(apr_getopt_t *os,
ctx->notify_func2 = svn_cl__check_externals_failed_notify_wrapper;
ctx->notify_baton2 = &nwb;
+ /* Postpone conflict resolution during the switch operation.
+ * If any conflicts occur we'll run the conflict resolver later. */
+
/* Do the 'switch' update. */
err = svn_client_switch3(NULL, target, switch_url, &peg_revision,
&(opt_state->start_revision), depth,
@@ -175,13 +179,29 @@ svn_cl__switch(apr_getopt_t *os,
return err;
}
+ if (nwb.had_externals_error)
+ externals_err = svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS,
+ NULL,
+ _("Failure occurred processing one or "
+ "more externals definitions"));
+
if (! opt_state->quiet)
- SVN_ERR(svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool));
+ {
+ err = svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
+ }
- if (nwb.had_externals_error)
- return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
- _("Failure occurred processing one or more "
- "externals definitions"));
+ if (opt_state->conflict_func
+ && svn_cl__notifier_check_conflicts(nwb.wrapped_baton))
+ {
+ err = svn_cl__resolve_conflicts(
+ svn_cl__notifier_get_conflicted_paths(nwb.wrapped_baton,
+ scratch_pool),
+ depth, opt_state, ctx, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
+ }
- return SVN_NO_ERROR;
+ return svn_error_compose_create(externals_err, err);
}
Modified: subversion/branches/compressed-pristines/subversion/svn/update-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/update-cmd.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/update-cmd.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/update-cmd.c Thu Aug 16 10:17:48 2012
@@ -110,6 +110,10 @@ svn_cl__update(apr_getopt_t *os,
svn_boolean_t depth_is_sticky;
struct svn_cl__check_externals_failed_notify_baton nwb;
apr_array_header_t *result_revs;
+ svn_wc_conflict_resolver_func2_t conflict_func2 = ctx->conflict_func2;
+ void *conflict_baton2 = ctx->conflict_baton2;
+ svn_error_t *err = SVN_NO_ERROR;
+ svn_error_t *externals_err = SVN_NO_ERROR;
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
opt_state->targets,
@@ -154,6 +158,9 @@ svn_cl__update(apr_getopt_t *os,
ctx->notify_func2 = svn_cl__check_externals_failed_notify_wrapper;
ctx->notify_baton2 = &nwb;
+ /* Postpone conflict resolution during the update operation.
+ * If any conflicts occur we'll run the conflict resolver later. */
+
SVN_ERR(svn_client_update4(&result_revs, targets,
&(opt_state->start_revision),
depth, depth_is_sticky,
@@ -162,20 +169,38 @@ svn_cl__update(apr_getopt_t *os,
opt_state->parents,
ctx, scratch_pool));
+ if (nwb.had_externals_error)
+ externals_err = svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS,
+ NULL,
+ _("Failure occurred processing one or "
+ "more externals definitions"));
+
if (! opt_state->quiet)
{
- SVN_ERR(print_update_summary(targets, result_revs, scratch_pool));
+ err = print_update_summary(targets, result_revs, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
/* ### Layering problem: This call assumes that the baton we're
* passing is the one that was originally provided by
* svn_cl__get_notifier(), but that isn't promised. */
- SVN_ERR(svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool));
+ err = svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
}
- if (nwb.had_externals_error)
- return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
- _("Failure occurred processing one or more "
- "externals definitions"));
+ if (opt_state->conflict_func
+ && svn_cl__notifier_check_conflicts(nwb.wrapped_baton))
+ {
+ ctx->conflict_func2 = conflict_func2;
+ ctx->conflict_baton2 = conflict_baton2;
+ err = svn_cl__resolve_conflicts(
+ svn_cl__notifier_get_conflicted_paths(nwb.wrapped_baton,
+ scratch_pool),
+ depth, opt_state, ctx, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
+ }
- return SVN_NO_ERROR;
+ return svn_error_compose_create(externals_err, err);
}
Modified: subversion/branches/compressed-pristines/subversion/svn_private_config.hw
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn_private_config.hw?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn_private_config.hw (original)
+++ subversion/branches/compressed-pristines/subversion/svn_private_config.hw Thu Aug 16 10:17:48 2012
@@ -29,6 +29,10 @@
#ifndef SVN_PRIVATE_CONFIG_HW
#define SVN_PRIVATE_CONFIG_HW
+
+/* Define to a Windows-specific equivalent of config.guess output */
+#define SVN_BUILD_HOST "x86-microsoft-windows"
+
/* The minimal version of Berkeley DB we want */
#define SVN_FS_WANT_DB_MAJOR 4
#define SVN_FS_WANT_DB_MINOR 0
Modified: subversion/branches/compressed-pristines/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svnadmin/main.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svnadmin/main.c (original)
+++ subversion/branches/compressed-pristines/subversion/svnadmin/main.c Thu Aug 16 10:17:48 2012
@@ -108,12 +108,14 @@ open_repos(svn_repos_t **repos,
const char *path,
apr_pool_t *pool)
{
- /* construct FS configuration parameters: enable all available caches */
+ /* construct FS configuration parameters: enable caches for r/o data */
apr_hash_t *fs_config = apr_hash_make(pool);
apr_hash_set(fs_config, SVN_FS_CONFIG_FSFS_CACHE_DELTAS,
APR_HASH_KEY_STRING, "1");
apr_hash_set(fs_config, SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS,
APR_HASH_KEY_STRING, "1");
+ apr_hash_set(fs_config, SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
+ APR_HASH_KEY_STRING, "1");
/* now, open the requested repository */
SVN_ERR(svn_repos_open2(repos, path, fs_config, pool));
@@ -134,8 +136,8 @@ check_lib_versions(void)
{ "svn_delta", svn_delta_version },
{ NULL, NULL }
};
-
SVN_VERSION_DEFINE(my_version);
+
return svn_ver_check_list(&my_version, checklist);
}
@@ -189,7 +191,8 @@ enum svnadmin__cmdline_options_t
svnadmin__wait,
svnadmin__pre_1_4_compatible,
svnadmin__pre_1_5_compatible,
- svnadmin__pre_1_6_compatible
+ svnadmin__pre_1_6_compatible,
+ svnadmin__pre_1_8_compatible
};
/* Option codes and descriptions.
@@ -278,6 +281,10 @@ static const apr_getopt_option_t options
N_("use format compatible with Subversion versions\n"
" earlier than 1.6")},
+ {"pre-1.8-compatible", svnadmin__pre_1_8_compatible, 0,
+ N_("use format compatible with Subversion versions\n"
+ " earlier than 1.8")},
+
{"memory-cache-size", 'M', 1,
N_("size of the extra in-memory cache in MB used to\n"
" minimize redundant operations. Default: 16.\n"
@@ -303,7 +310,8 @@ static const svn_opt_subcommand_desc2_t
"Create a new, empty repository at REPOS_PATH.\n"),
{svnadmin__bdb_txn_nosync, svnadmin__bdb_log_keep,
svnadmin__config_dir, svnadmin__fs_type, svnadmin__pre_1_4_compatible,
- svnadmin__pre_1_5_compatible, svnadmin__pre_1_6_compatible
+ svnadmin__pre_1_5_compatible, svnadmin__pre_1_6_compatible,
+ svnadmin__pre_1_8_compatible
} },
{"deltify", subcommand_deltify, {0}, N_
@@ -473,6 +481,7 @@ struct svnadmin_opt_state
svn_boolean_t pre_1_4_compatible; /* --pre-1.4-compatible */
svn_boolean_t pre_1_5_compatible; /* --pre-1.5-compatible */
svn_boolean_t pre_1_6_compatible; /* --pre-1.6-compatible */
+ svn_boolean_t pre_1_8_compatible; /* --pre-1.8-compatible */
svn_opt_revision_t start_revision, end_revision; /* -r X[:Y] */
svn_boolean_t help; /* --help or -? */
svn_boolean_t version; /* --version */
@@ -584,6 +593,21 @@ parse_args(apr_array_header_t **args,
return SVN_NO_ERROR;
}
+
+/* This implements `svn_opt_subcommand_t'. */
+static svn_error_t *
+subcommand_crashtest(apr_getopt_t *os, void *baton, apr_pool_t *pool)
+{
+ struct svnadmin_opt_state *opt_state = baton;
+ svn_repos_t *repos;
+
+ SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
+ SVN_ERR_MALFUNCTION();
+
+ /* merely silence a compiler warning (this will never be executed) */
+ return SVN_NO_ERROR;
+}
+
/* This implements `svn_opt_subcommand_t'. */
static svn_error_t *
subcommand_create(apr_getopt_t *os, void *baton, apr_pool_t *pool)
@@ -623,6 +647,11 @@ subcommand_create(apr_getopt_t *os, void
APR_HASH_KEY_STRING,
"1");
+ if (opt_state->pre_1_8_compatible)
+ apr_hash_set(fs_config, SVN_FS_CONFIG_PRE_1_8_COMPATIBLE,
+ APR_HASH_KEY_STRING,
+ "1");
+
SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
NULL, NULL, NULL, fs_config, pool));
svn_fs_set_warning_func(svn_repos_fs(repos), warning_func, NULL);
@@ -725,8 +754,7 @@ repos_notify_handler(void *baton,
return;
case svn_repos_notify_pack_shard_end:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("done.\n")));
+ svn_error_clear(svn_stream_puts(feedback_stream, _("done.\n")));
return;
case svn_repos_notify_pack_shard_start_revprop:
@@ -741,8 +769,7 @@ repos_notify_handler(void *baton,
return;
case svn_repos_notify_pack_shard_end_revprop:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("done.\n")));
+ svn_error_clear(svn_stream_puts(feedback_stream, _("done.\n")));
return;
case svn_repos_notify_load_txn_committed:
@@ -836,7 +863,7 @@ repos_notify_handler(void *baton,
return;
case svn_repos_notify_upgrade_start:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+ svn_error_clear(svn_stream_puts(feedback_stream,
_("Repository lock acquired.\n"
"Please wait; upgrading the"
" repository may take some time...\n")));
@@ -963,9 +990,10 @@ subcommand_help(apr_getopt_t *os, void *
version_footer = svn_stringbuf_create(fs_desc_start, pool);
SVN_ERR(svn_fs_print_modules(version_footer, pool));
- SVN_ERR(svn_opt_print_help3(os, "svnadmin",
+ SVN_ERR(svn_opt_print_help4(os, "svnadmin",
opt_state ? opt_state->version : FALSE,
opt_state ? opt_state->quiet : FALSE,
+ /*###opt_state ? opt_state->verbose :*/ FALSE,
version_footer->data,
header, cmd_table, options_table, NULL, NULL,
pool));
@@ -1763,12 +1791,26 @@ subcommand_upgrade(apr_getopt_t *os, voi
/** Main. **/
-int
-main(int argc, const char *argv[])
+/* Report and clear the error ERR, and return EXIT_FAILURE. */
+#define EXIT_ERROR(err) \
+ svn_cmdline_handle_exit_error(err, NULL, "svnadmin: ")
+
+/* A redefinition of the public SVN_INT_ERR macro, that suppresses the
+ * error message if it is SVN_ERR_IO_PIPE_WRITE_ERROR, amd with the
+ * program name 'svnadmin' instead of 'svn'. */
+#undef SVN_INT_ERR
+#define SVN_INT_ERR(expr) \
+ do { \
+ svn_error_t *svn_err__temp = (expr); \
+ if (svn_err__temp) \
+ return EXIT_ERROR(svn_err__temp); \
+ } while (0)
+
+static int
+sub_main(int argc, const char *argv[], apr_pool_t *pool)
{
svn_error_t *err;
apr_status_t apr_err;
- apr_pool_t *pool;
const svn_opt_subcommand_desc2_t *subcommand = NULL;
struct svnadmin_opt_state opt_state = { 0 };
@@ -1777,31 +1819,17 @@ main(int argc, const char *argv[])
apr_array_header_t *received_opts;
int i;
- /* Initialize the app. */
- if (svn_cmdline_init("svnadmin", stderr) != EXIT_SUCCESS)
- return EXIT_FAILURE;
-
- /* Create our top-level pool. Use a separate mutexless allocator,
- * given this application is single threaded.
- */
- pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
-
received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
/* Check library versions */
- err = check_lib_versions();
- if (err)
- return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+ SVN_INT_ERR(check_lib_versions());
/* Initialize the FS library. */
- err = svn_fs_initialize(pool);
- if (err)
- return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+ SVN_INT_ERR(svn_fs_initialize(pool));
if (argc <= 1)
{
SVN_INT_ERR(subcommand_help(NULL, NULL, pool));
- svn_pool_destroy(pool);
return EXIT_FAILURE;
}
@@ -1811,9 +1839,7 @@ main(int argc, const char *argv[])
opt_state.memory_cache_size = svn_cache_config_get()->cache_size;
/* Parse options. */
- err = svn_cmdline__getopt_init(&os, argc, argv, pool);
- if (err)
- return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+ SVN_INT_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool));
os->interleave = 1;
@@ -1829,7 +1855,6 @@ main(int argc, const char *argv[])
else if (apr_err)
{
SVN_INT_ERR(subcommand_help(NULL, NULL, pool));
- svn_pool_destroy(pool);
return EXIT_FAILURE;
}
@@ -1844,7 +1869,7 @@ main(int argc, const char *argv[])
err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("Multiple revision arguments encountered; "
"try '-r N:M' instead of '-r N -r M'"));
- return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+ return EXIT_ERROR(err);
}
if (svn_opt_parse_revision(&(opt_state.start_revision),
&(opt_state.end_revision),
@@ -1857,7 +1882,7 @@ main(int argc, const char *argv[])
err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("Syntax error in revision argument '%s'"),
utf8_opt_arg);
- return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+ return EXIT_ERROR(err);
}
}
break;
@@ -1896,16 +1921,15 @@ main(int argc, const char *argv[])
case svnadmin__pre_1_6_compatible:
opt_state.pre_1_6_compatible = TRUE;
break;
+ case svnadmin__pre_1_8_compatible:
+ opt_state.pre_1_8_compatible = TRUE;
+ break;
case svnadmin__fs_type:
- err = svn_utf_cstring_to_utf8(&opt_state.fs_type, opt_arg, pool);
- if (err)
- return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.fs_type, opt_arg, pool));
break;
case svnadmin__parent_dir:
- err = svn_utf_cstring_to_utf8(&opt_state.parent_dir, opt_arg,
- pool);
- if (err)
- return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.parent_dir, opt_arg,
+ pool));
opt_state.parent_dir
= svn_dirent_internal_style(opt_state.parent_dir, pool);
break;
@@ -1937,9 +1961,7 @@ main(int argc, const char *argv[])
opt_state.clean_logs = TRUE;
break;
case svnadmin__config_dir:
- err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
- if (err)
- return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
opt_state.config_dir =
apr_pstrdup(pool, svn_dirent_canonicalize(utf8_opt_arg, pool));
break;
@@ -1949,7 +1971,6 @@ main(int argc, const char *argv[])
default:
{
SVN_INT_ERR(subcommand_help(NULL, NULL, pool));
- svn_pool_destroy(pool);
return EXIT_FAILURE;
}
} /* close `switch' */
@@ -1984,7 +2005,6 @@ main(int argc, const char *argv[])
svn_error_clear(svn_cmdline_fprintf(stderr, pool,
_("subcommand argument required\n")));
SVN_INT_ERR(subcommand_help(NULL, NULL, pool));
- svn_pool_destroy(pool);
return EXIT_FAILURE;
}
}
@@ -1995,14 +2015,12 @@ main(int argc, const char *argv[])
if (subcommand == NULL)
{
const char *first_arg_utf8;
- err = svn_utf_cstring_to_utf8(&first_arg_utf8, first_arg, pool);
- if (err)
- return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&first_arg_utf8,
+ first_arg, pool));
svn_error_clear(svn_cmdline_fprintf(stderr, pool,
_("Unknown command: '%s'\n"),
first_arg_utf8));
SVN_INT_ERR(subcommand_help(NULL, NULL, pool));
- svn_pool_destroy(pool);
return EXIT_FAILURE;
}
}
@@ -2018,13 +2036,13 @@ main(int argc, const char *argv[])
{
err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("Repository argument required"));
- return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+ return EXIT_ERROR(err);
}
if ((err = svn_utf_cstring_to_utf8(&repos_path,
os->argv[os->ind++], pool)))
{
- return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+ return EXIT_ERROR(err);
}
if (svn_path_is_url(repos_path))
@@ -2032,7 +2050,7 @@ main(int argc, const char *argv[])
err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("'%s' is a URL when it should be a "
"local path"), repos_path);
- return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+ return EXIT_ERROR(err);
}
opt_state.repository_path = svn_dirent_internal_style(repos_path, pool);
@@ -2064,7 +2082,6 @@ main(int argc, const char *argv[])
, _("Subcommand '%s' doesn't accept option '%s'\n"
"Type 'svnadmin help %s' for usage.\n"),
subcommand->name, optstr, subcommand->name));
- svn_pool_destroy(pool);
return EXIT_FAILURE;
}
}
@@ -2107,43 +2124,38 @@ main(int argc, const char *argv[])
err = svn_error_quick_wrap(err,
_("Try 'svnadmin help' for more info"));
}
- return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+ return EXIT_ERROR(err);
}
else
{
- svn_pool_destroy(pool);
/* Ensure that everything is written to stdout, so the user will
see any print errors. */
err = svn_cmdline_fflush(stdout);
if (err)
{
- /* Issue #3014:
- * Don't print anything on broken pipes. The pipe was likely
- * closed by the process at the other end. We expect that
- * process to perform error reporting as necessary.
- *
- * ### This assumes that there is only one error in a chain for
- * ### SVN_ERR_IO_PIPE_WRITE_ERROR. See svn_cmdline_fputs(). */
- if (err->apr_err != SVN_ERR_IO_PIPE_WRITE_ERROR)
- svn_handle_error2(err, stderr, FALSE, "svnadmin: ");
- svn_error_clear(err);
- return EXIT_FAILURE;
+ return EXIT_ERROR(err);
}
return EXIT_SUCCESS;
}
}
-
-/* This implements `svn_opt_subcommand_t'. */
-static svn_error_t *
-subcommand_crashtest(apr_getopt_t *os, void *baton, apr_pool_t *pool)
+int
+main(int argc, const char *argv[])
{
- struct svnadmin_opt_state *opt_state = baton;
- svn_repos_t *repos;
+ apr_pool_t *pool;
+ int exit_code;
- SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
- SVN_ERR_MALFUNCTION();
+ /* Initialize the app. */
+ if (svn_cmdline_init("svnadmin", stderr) != EXIT_SUCCESS)
+ return EXIT_FAILURE;
- /* merely silence a compiler warning (this will never be executed) */
- return SVN_NO_ERROR;
+ /* Create our top-level pool. Use a separate mutexless allocator,
+ * given this application is single threaded.
+ */
+ pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
+
+ exit_code = sub_main(argc, argv, pool);
+
+ svn_pool_destroy(pool);
+ return exit_code;
}
Modified: subversion/branches/compressed-pristines/subversion/svndumpfilter/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svndumpfilter/main.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svndumpfilter/main.c (original)
+++ subversion/branches/compressed-pristines/subversion/svndumpfilter/main.c Thu Aug 16 10:17:48 2012
@@ -110,6 +110,28 @@ write_prop_to_stringbuf(svn_stringbuf_t
}
+/* Writes a property deletion in dumpfile format to given stringbuf. */
+static void
+write_propdel_to_stringbuf(svn_stringbuf_t **strbuf,
+ const char *name)
+{
+ int bytes_used;
+ size_t namelen;
+ char buf[SVN_KEYLINE_MAXLEN];
+
+ /* Output name length, then name. */
+ namelen = strlen(name);
+ svn_stringbuf_appendbytes(*strbuf, "D ", 2);
+
+ bytes_used = apr_snprintf(buf, sizeof(buf), "%" APR_SIZE_T_FMT, namelen);
+ svn_stringbuf_appendbytes(*strbuf, buf, bytes_used);
+ svn_stringbuf_appendbyte(*strbuf, '\n');
+
+ svn_stringbuf_appendbytes(*strbuf, name, namelen);
+ svn_stringbuf_appendbyte(*strbuf, '\n');
+}
+
+
/* Compare the node-path PATH with the (const char *) prefixes in PFXLIST.
* Return TRUE if any prefix is a prefix of PATH (matching whole path
* components); FALSE otherwise.
@@ -187,6 +209,7 @@ struct parse_baton_t
svn_boolean_t do_renumber_revs;
svn_boolean_t preserve_revprops;
svn_boolean_t skip_missing_merge_sources;
+ svn_boolean_t allow_deltas;
apr_array_header_t *prefixes;
/* Input and output streams. */
@@ -250,12 +273,36 @@ struct node_baton_t
/* Pointers to dumpfile data. */
svn_stringbuf_t *header;
svn_stringbuf_t *props;
+
+ /* Expect deltas? */
+ svn_boolean_t has_prop_delta;
+ svn_boolean_t has_text_delta;
+
+ /* We might need the node path in a parse error message. */
+ char *node_path;
};
/* Filtering vtable members */
+/* File-format stamp. */
+static svn_error_t *
+magic_header_record(int version, void *parse_baton, apr_pool_t *pool)
+{
+ struct parse_baton_t *pb = parse_baton;
+
+ if (version >= SVN_REPOS_DUMPFILE_FORMAT_VERSION_DELTAS)
+ pb->allow_deltas = TRUE;
+
+ SVN_ERR(svn_stream_printf(pb->out_stream, pool,
+ SVN_REPOS_DUMPFILE_MAGIC_HEADER ": %d\n\n",
+ version));
+
+ return SVN_NO_ERROR;
+}
+
+
/* New revision: set up revision_baton, decide if we skip it. */
static svn_error_t *
new_revision_record(void **revision_baton,
@@ -553,10 +600,13 @@ new_node_record(void **node_baton,
nb->has_props = FALSE;
nb->has_text = FALSE;
+ nb->has_prop_delta = FALSE;
+ nb->has_text_delta = FALSE;
nb->writing_begun = FALSE;
nb->tcl = tcl ? svn__atoui64(tcl) : 0;
nb->header = svn_stringbuf_create_empty(pool);
nb->props = svn_stringbuf_create_empty(pool);
+ nb->node_path = apr_pstrdup(pool, node_path);
/* Now we know for sure that we have a node that will not be
skipped, flush the revision if it has not already been done. */
@@ -569,6 +619,14 @@ new_node_record(void **node_baton,
const char *key = svn__apr_hash_index_key(hi);
const char *val = svn__apr_hash_index_val(hi);
+ if ((!strcmp(key, SVN_REPOS_DUMPFILE_PROP_DELTA))
+ && (!strcmp(val, "true")))
+ nb->has_prop_delta = TRUE;
+
+ if ((!strcmp(key, SVN_REPOS_DUMPFILE_TEXT_DELTA))
+ && (!strcmp(val, "true")))
+ nb->has_text_delta = TRUE;
+
if ((!strcmp(key, SVN_REPOS_DUMPFILE_CONTENT_LENGTH))
|| (!strcmp(key, SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH))
|| (!strcmp(key, SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH)))
@@ -708,7 +766,7 @@ adjust_mergeinfo(svn_string_t **final_va
for (hi = apr_hash_first(subpool, mergeinfo); hi; hi = apr_hash_next(hi))
{
const char *merge_source = svn__apr_hash_index_key(hi);
- apr_array_header_t *rangelist = svn__apr_hash_index_val(hi);
+ svn_rangelist_t *rangelist = svn__apr_hash_index_val(hi);
struct parse_baton_t *pb = rb->pb;
/* Determine whether the merge_source is a part of the prefix. */
@@ -791,10 +849,12 @@ set_node_property(void *node_baton,
if (nb->do_skip)
return SVN_NO_ERROR;
- if (!nb->has_props)
- return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
- _("Delta property block detected - "
- "not supported by svndumpfilter"));
+ if (! (nb->has_props || nb->has_prop_delta))
+ return svn_error_createf(SVN_ERR_STREAM_MALFORMED_DATA, NULL,
+ _("Delta property block detected, but deltas "
+ "are not enabled for node '%s' in original "
+ "revision %ld"),
+ nb->node_path, rb->rev_orig);
if (strcmp(name, SVN_PROP_MERGEINFO) == 0)
{
@@ -804,6 +864,7 @@ set_node_property(void *node_baton,
value = filtered_mergeinfo;
}
+ nb->has_props = TRUE;
write_prop_to_stringbuf(nb->props, name, value);
return SVN_NO_ERROR;
@@ -811,6 +872,29 @@ set_node_property(void *node_baton,
static svn_error_t *
+delete_node_property(void *node_baton, const char *name)
+{
+ struct node_baton_t *nb = node_baton;
+ struct revision_baton_t *rb = nb->rb;
+
+ if (nb->do_skip)
+ return SVN_NO_ERROR;
+
+ if (!nb->has_prop_delta)
+ return svn_error_createf(SVN_ERR_STREAM_MALFORMED_DATA, NULL,
+ _("Delta property block detected, but deltas "
+ "are not enabled for node '%s' in original"
+ "revision %ld"),
+ nb->node_path, rb->rev_orig);
+
+ nb->has_props = TRUE;
+ write_propdel_to_stringbuf(&(nb->props), name);
+
+ return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
remove_node_props(void *node_baton)
{
struct node_baton_t *nb = node_baton;
@@ -878,14 +962,15 @@ close_revision(void *revision_baton)
/* Filtering vtable */
-svn_repos_parse_fns2_t filtering_vtable =
+svn_repos_parse_fns3_t filtering_vtable =
{
- new_revision_record,
+ magic_header_record,
uuid_record,
+ new_revision_record,
new_node_record,
set_revision_property,
set_node_property,
- NULL,
+ delete_node_property,
remove_node_props,
set_fulltext,
NULL,
@@ -1031,17 +1116,7 @@ parse_baton_initialize(struct parse_bato
baton->renumber_history = apr_hash_make(pool);
baton->last_live_revision = SVN_INVALID_REVNUM;
baton->oldest_original_rev = SVN_INVALID_REVNUM;
-
- /* This is non-ideal: We should pass through the version of the
- * input dumpstream. However, our API currently doesn't allow that.
- * Hardcoding version 2 is acceptable because:
- * - We currently do not accept version 3 or greater.
- * - Dumpstream version 1 is so ancient as to be ignorable
- * (0.17.x and earlier)
- */
- SVN_ERR(svn_stream_printf(baton->out_stream, pool,
- SVN_REPOS_DUMPFILE_MAGIC_HEADER ": %d\n\n",
- 2));
+ baton->allow_deltas = FALSE;
*pb = baton;
return SVN_NO_ERROR;
@@ -1060,11 +1135,12 @@ subcommand_help(apr_getopt_t *os, void *
"\n"
"Available subcommands:\n");
- SVN_ERR(svn_opt_print_help3(os, "svndumpfilter",
+ SVN_ERR(svn_opt_print_help4(os, "svndumpfilter",
opt_state ? opt_state->version : FALSE,
- opt_state ? opt_state->quiet : FALSE, NULL,
- header, cmd_table, options_table, NULL,
- NULL, pool));
+ opt_state ? opt_state->quiet : FALSE,
+ /*###opt_state ? opt_state->verbose :*/ FALSE,
+ NULL, header, cmd_table, options_table,
+ NULL, NULL, pool));
return SVN_NO_ERROR;
}
@@ -1081,8 +1157,8 @@ check_lib_versions(void)
{ "svn_delta", svn_delta_version },
{ NULL, NULL }
};
-
SVN_VERSION_DEFINE(my_version);
+
return svn_ver_check_list(&my_version, checklist);
}
@@ -1144,8 +1220,8 @@ do_filter(apr_getopt_t *os,
}
SVN_ERR(parse_baton_initialize(&pb, opt_state, do_exclude, pool));
- SVN_ERR(svn_repos_parse_dumpstream2(pb->in_stream, &filtering_vtable, pb,
- NULL, NULL, pool));
+ SVN_ERR(svn_repos_parse_dumpstream3(pb->in_stream, &filtering_vtable, pb,
+ TRUE, NULL, NULL, pool));
/* The rest of this is just reporting. If we aren't reporting, get
outta here. */
Modified: subversion/branches/compressed-pristines/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svnlook/main.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svnlook/main.c (original)
+++ subversion/branches/compressed-pristines/subversion/svnlook/main.c Thu Aug 16 10:17:48 2012
@@ -380,8 +380,8 @@ check_lib_versions(void)
{ "svn_diff", svn_diff_version },
{ NULL, NULL }
};
-
SVN_VERSION_DEFINE(my_version);
+
return svn_ver_check_list(&my_version, checklist);
}
@@ -900,8 +900,7 @@ display_prop_diffs(const apr_array_heade
if (!val_has_eol)
{
const char *s = "\\ No newline at end of property" APR_EOL_STR;
- apr_size_t len = strlen(s);
- SVN_ERR(svn_stream_write(out, s, &len));
+ SVN_ERR(svn_stream_puts(out, s));
}
}
}
@@ -1283,6 +1282,30 @@ print_tree(svn_fs_root_t *root,
}
+/* Set *BASE_REV to the revision on which the target root specified in
+ C is based, or to SVN_INVALID_REVNUM when C represents "revision
+ 0" (because that revision isn't based on another revision). */
+static svn_error_t *
+get_base_rev(svn_revnum_t *base_rev, svnlook_ctxt_t *c, apr_pool_t *pool)
+{
+ if (c->is_revision)
+ {
+ *base_rev = c->rev_id - 1;
+ }
+ else
+ {
+ *base_rev = svn_fs_txn_base_revision(c->txn);
+
+ if (! SVN_IS_VALID_REVNUM(*base_rev))
+ return svn_error_createf
+ (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
+ _("Transaction '%s' is not based on a revision; how odd"),
+ c->txn_name);
+ }
+ return SVN_NO_ERROR;
+}
+
+
/*** Subcommand handlers. ***/
@@ -1389,16 +1412,9 @@ do_dirs_changed(svnlook_ctxt_t *c, apr_p
svn_repos_node_t *tree;
SVN_ERR(get_root(&root, c, pool));
- if (c->is_revision)
- base_rev_id = c->rev_id - 1;
- else
- base_rev_id = svn_fs_txn_base_revision(c->txn);
-
- if (! SVN_IS_VALID_REVNUM(base_rev_id))
- return svn_error_createf
- (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
- _("Transaction '%s' is not based on a revision; how odd"),
- c->txn_name);
+ SVN_ERR(get_base_rev(&base_rev_id, c, pool));
+ if (base_rev_id == SVN_INVALID_REVNUM)
+ return SVN_NO_ERROR;
SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id, pool));
if (tree)
@@ -1494,16 +1510,9 @@ do_changed(svnlook_ctxt_t *c, apr_pool_t
svn_repos_node_t *tree;
SVN_ERR(get_root(&root, c, pool));
- if (c->is_revision)
- base_rev_id = c->rev_id - 1;
- else
- base_rev_id = svn_fs_txn_base_revision(c->txn);
-
- if (! SVN_IS_VALID_REVNUM(base_rev_id))
- return svn_error_createf
- (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
- _("Transaction '%s' is not based on a revision; how odd"),
- c->txn_name);
+ SVN_ERR(get_base_rev(&base_rev_id, c, pool));
+ if (base_rev_id == SVN_INVALID_REVNUM)
+ return SVN_NO_ERROR;
SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id, pool));
if (tree)
@@ -1522,16 +1531,9 @@ do_diff(svnlook_ctxt_t *c, apr_pool_t *p
svn_repos_node_t *tree;
SVN_ERR(get_root(&root, c, pool));
- if (c->is_revision)
- base_rev_id = c->rev_id - 1;
- else
- base_rev_id = svn_fs_txn_base_revision(c->txn);
-
- if (! SVN_IS_VALID_REVNUM(base_rev_id))
- return svn_error_createf
- (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
- _("Transaction '%s' is not based on a revision; how odd"),
- c->txn_name);
+ SVN_ERR(get_base_rev(&base_rev_id, c, pool));
+ if (base_rev_id == SVN_INVALID_REVNUM)
+ return SVN_NO_ERROR;
SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id, pool));
if (tree)
@@ -2047,9 +2049,10 @@ subcommand_help(apr_getopt_t *os, void *
version_footer = svn_stringbuf_create(fs_desc_start, pool);
SVN_ERR(svn_fs_print_modules(version_footer, pool));
- SVN_ERR(svn_opt_print_help3(os, "svnlook",
+ SVN_ERR(svn_opt_print_help4(os, "svnlook",
opt_state ? opt_state->version : FALSE,
opt_state ? opt_state->quiet : FALSE,
+ opt_state ? opt_state->verbose : FALSE,
version_footer->data,
header, cmd_table, options_table, NULL,
NULL, pool));
@@ -2445,7 +2448,7 @@ main(int argc, const char *argv[])
static const svn_opt_subcommand_desc2_t pseudo_cmd =
{ "--version", subcommand_help, {0}, "",
{svnlook__version, /* must accept its own option */
- 'q',
+ 'q', 'v',
} };
subcommand = &pseudo_cmd;
Propchange: subversion/branches/compressed-pristines/subversion/svnmucc/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Aug 16 10:17:48 2012
@@ -0,0 +1,7 @@
+svnmucc
+svnmucc.exe
+.libs
+*.o
+*~
+.*~
+svnmucc-test-repos
Modified: subversion/branches/compressed-pristines/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svnrdump/dump_editor.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/compressed-pristines/subversion/svnrdump/dump_editor.c Thu Aug 16 10:17:48 2012
@@ -31,6 +31,7 @@
#include "svn_dirent_uri.h"
#include "private/svn_fspath.h"
+#include "private/svn_subr_private.h"
#include "svnrdump.h"
@@ -248,7 +249,7 @@ do_dump_props(svn_stringbuf_t **propstri
/* No text is going to be dumped. Write a couple of newlines and
wait for the next node/ revision. */
- SVN_ERR(svn_stream_printf(stream, scratch_pool, "\n\n"));
+ SVN_ERR(svn_stream_puts(stream, "\n\n"));
/* Cleanup so that data is never dumped twice. */
SVN_ERR(svn_hash__clear(props, scratch_pool));
@@ -267,7 +268,7 @@ do_dump_newlines(struct dump_edit_baton
{
if (trigger_var && *trigger_var)
{
- SVN_ERR(svn_stream_printf(eb->stream, pool, "\n\n"));
+ SVN_ERR(svn_stream_puts(eb->stream, "\n\n"));
*trigger_var = FALSE;
}
return SVN_NO_ERROR;
@@ -321,18 +322,17 @@ dump_node(struct dump_edit_baton *eb,
/* We are here after a change_file_prop or change_dir_prop. They
set up whatever dump_props they needed to- nothing to
do here but print node action information */
- SVN_ERR(svn_stream_printf(eb->stream, pool,
- SVN_REPOS_DUMPFILE_NODE_ACTION
- ": change\n"));
+ SVN_ERR(svn_stream_puts(eb->stream,
+ SVN_REPOS_DUMPFILE_NODE_ACTION ": change\n"));
break;
case svn_node_action_replace:
if (!is_copy)
{
/* Node-action: replace */
- SVN_ERR(svn_stream_printf(eb->stream, pool,
- SVN_REPOS_DUMPFILE_NODE_ACTION
- ": replace\n"));
+ SVN_ERR(svn_stream_puts(eb->stream,
+ SVN_REPOS_DUMPFILE_NODE_ACTION
+ ": replace\n"));
/* Wait for a change_*_prop to be called before dumping
anything */
@@ -343,9 +343,8 @@ dump_node(struct dump_edit_baton *eb,
copyfrom_rev are present: delete the original, and then re-add
it */
- SVN_ERR(svn_stream_printf(eb->stream, pool,
- SVN_REPOS_DUMPFILE_NODE_ACTION
- ": delete\n\n"));
+ SVN_ERR(svn_stream_puts(eb->stream,
+ SVN_REPOS_DUMPFILE_NODE_ACTION ": delete\n\n"));
/* Recurse: Print an additional add-with-history record. */
SVN_ERR(dump_node(eb, path, kind, svn_node_action_add,
@@ -356,19 +355,18 @@ dump_node(struct dump_edit_baton *eb,
break;
case svn_node_action_delete:
- SVN_ERR(svn_stream_printf(eb->stream, pool,
- SVN_REPOS_DUMPFILE_NODE_ACTION
- ": delete\n"));
+ SVN_ERR(svn_stream_puts(eb->stream,
+ SVN_REPOS_DUMPFILE_NODE_ACTION ": delete\n"));
/* We can leave this routine quietly now. Nothing more to do-
print a couple of newlines because we're not dumping props or
text. */
- SVN_ERR(svn_stream_printf(eb->stream, pool, "\n\n"));
+ SVN_ERR(svn_stream_puts(eb->stream, "\n\n"));
break;
case svn_node_action_add:
- SVN_ERR(svn_stream_printf(eb->stream, pool,
- SVN_REPOS_DUMPFILE_NODE_ACTION ": add\n"));
+ SVN_ERR(svn_stream_puts(eb->stream,
+ SVN_REPOS_DUMPFILE_NODE_ACTION ": add\n"));
if (!is_copy)
{
@@ -811,9 +809,9 @@ close_file(void *file_baton,
apr_status_t err;
/* Text-delta: true */
- SVN_ERR(svn_stream_printf(eb->stream, pool,
- SVN_REPOS_DUMPFILE_TEXT_DELTA
- ": true\n"));
+ SVN_ERR(svn_stream_puts(eb->stream,
+ SVN_REPOS_DUMPFILE_TEXT_DELTA
+ ": true\n"));
err = apr_file_info_get(info, APR_FINFO_SIZE, eb->delta_file);
if (err)
@@ -887,7 +885,7 @@ close_file(void *file_baton,
/* Write a couple of blank lines for matching output with `svnadmin
dump` */
- SVN_ERR(svn_stream_printf(eb->stream, pool, "\n\n"));
+ SVN_ERR(svn_stream_puts(eb->stream, "\n\n"));
return SVN_NO_ERROR;
}
Modified: subversion/branches/compressed-pristines/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svnrdump/load_editor.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/compressed-pristines/subversion/svnrdump/load_editor.c Thu Aug 16 10:17:48 2012
@@ -250,7 +250,7 @@ renumber_mergeinfo_revs(svn_string_t **f
for (hi = apr_hash_first(subpool, mergeinfo); hi; hi = apr_hash_next(hi))
{
- apr_array_header_t *rangelist;
+ svn_rangelist_t *rangelist;
struct parse_baton *pb = rb->pb;
int i;
const void *path;
@@ -397,11 +397,6 @@ fetch_base_func(const char **filename,
svn_stream_t *fstream;
svn_error_t *err;
- if (svn_path_is_url(path))
- path = svn_uri_skip_ancestor(rb->pb->root_url, path, scratch_pool);
- else if (path[0] == '/')
- path += 1;
-
if (! SVN_IS_VALID_REVNUM(base_revision))
base_revision = rb->rev - 1;
@@ -438,11 +433,6 @@ fetch_props_func(apr_hash_t **props,
struct revision_baton *rb = baton;
svn_node_kind_t node_kind;
- if (svn_path_is_url(path))
- path = svn_uri_skip_ancestor(rb->pb->root_url, path, scratch_pool);
- else if (path[0] == '/')
- path += 1;
-
if (! SVN_IS_VALID_REVNUM(base_revision))
base_revision = rb->rev - 1;
@@ -484,11 +474,6 @@ fetch_kind_func(svn_kind_t *kind,
struct revision_baton *rb = baton;
svn_node_kind_t node_kind;
- if (svn_path_is_url(path))
- path = svn_uri_skip_ancestor(rb->pb->root_url, path, scratch_pool);
- else if (path[0] == '/')
- path += 1;
-
if (! SVN_IS_VALID_REVNUM(base_revision))
base_revision = rb->rev - 1;
@@ -582,7 +567,7 @@ new_revision_record(void **revision_bato
several separate operations. It is highly susceptible to race conditions.
Calculate the revision 'offset' for finding copyfrom sources.
It might be positive or negative. */
- rb->rev_offset = (apr_int32_t) (rb->rev) - (head_rev + 1);
+ rb->rev_offset = (apr_int32_t) ((rb->rev) - (head_rev + 1));
/* Stash the oldest (non-zero) dumpstream revision seen. */
if ((rb->rev > 0) && (!SVN_IS_VALID_REVNUM(pb->oldest_dumpstream_rev)))
@@ -599,6 +584,14 @@ new_revision_record(void **revision_bato
}
static svn_error_t *
+magic_header_record(int version,
+ void *parse_baton,
+ apr_pool_t *pool)
+{
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
uuid_record(const char *uuid,
void *parse_baton,
apr_pool_t *pool)
@@ -1161,7 +1154,7 @@ svn_rdump__load_dumpstream(svn_stream_t
void *cancel_baton,
apr_pool_t *pool)
{
- svn_repos_parse_fns2_t *parser;
+ svn_repos_parse_fns3_t *parser;
struct parse_baton *parse_baton;
const svn_string_t *lock_string;
svn_boolean_t be_atomic;
@@ -1178,8 +1171,9 @@ svn_rdump__load_dumpstream(svn_stream_t
session_url, pool));
parser = apr_pcalloc(pool, sizeof(*parser));
- parser->new_revision_record = new_revision_record;
+ parser->magic_header_record = magic_header_record;
parser->uuid_record = uuid_record;
+ parser->new_revision_record = new_revision_record;
parser->new_node_record = new_node_record;
parser->set_revision_property = set_revision_property;
parser->set_node_property = set_node_property;
@@ -1200,7 +1194,7 @@ svn_rdump__load_dumpstream(svn_stream_t
parse_baton->last_rev_mapped = SVN_INVALID_REVNUM;
parse_baton->oldest_dumpstream_rev = SVN_INVALID_REVNUM;
- err = svn_repos_parse_dumpstream2(stream, parser, parse_baton,
+ err = svn_repos_parse_dumpstream3(stream, parser, parse_baton, FALSE,
cancel_func, cancel_baton, pool);
/* If all goes well, or if we're cancelled cleanly, don't leave a
Modified: subversion/branches/compressed-pristines/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svnrdump/svnrdump.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/compressed-pristines/subversion/svnrdump/svnrdump.c Thu Aug 16 10:17:48 2012
@@ -217,7 +217,7 @@ replay_revstart(svn_revnum_t revision,
SVN_ERR(svn_stream_write(stdout_stream, propstring->data,
&(propstring->len)));
- SVN_ERR(svn_stream_printf(stdout_stream, pool, "\n"));
+ SVN_ERR(svn_stream_puts(stdout_stream, "\n"));
SVN_ERR(svn_stream_close(stdout_stream));
SVN_ERR(svn_rdump__get_dump_editor(editor, edit_baton, revision,
@@ -332,7 +332,7 @@ dump_revision_header(svn_ra_session_t *s
/* The properties */
SVN_ERR(svn_stream_write(stdout_stream, propstring->data,
&(propstring->len)));
- SVN_ERR(svn_stream_printf(stdout_stream, pool, "\n"));
+ SVN_ERR(svn_stream_puts(stdout_stream, "\n"));
return SVN_NO_ERROR;
}
@@ -505,8 +505,8 @@ version(const char *progname,
pool);
SVN_ERR(svn_ra_print_modules(version_footer, pool));
- return svn_opt_print_help3(NULL, ensure_appname(progname, pool),
- TRUE, quiet, version_footer->data,
+ return svn_opt_print_help4(NULL, ensure_appname(progname, pool),
+ TRUE, quiet, FALSE, version_footer->data,
NULL, NULL, NULL, NULL, NULL, pool);
}
@@ -579,9 +579,9 @@ help_cmd(apr_getopt_t *os,
"\n"
"Available subcommands:\n");
- return svn_opt_print_help3(os, "svnrdump", FALSE, FALSE, NULL, header,
- svnrdump__cmd_table, svnrdump__options, NULL,
- NULL, pool);
+ return svn_opt_print_help4(os, "svnrdump", FALSE, FALSE, FALSE, NULL,
+ header, svnrdump__cmd_table, svnrdump__options,
+ NULL, NULL, pool);
}
/* Examine the OPT_BATON's 'start_revision' and 'end_revision'
Modified: subversion/branches/compressed-pristines/subversion/svnserve/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svnserve/cyrus_auth.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svnserve/cyrus_auth.c (original)
+++ subversion/branches/compressed-pristines/subversion/svnserve/cyrus_auth.c Thu Aug 16 10:17:48 2012
@@ -61,7 +61,7 @@ static int canonicalize_username(sasl_co
char *out, /* the output buffer */
unsigned out_max, unsigned *out_len)
{
- int realm_len = strlen(user_realm);
+ size_t realm_len = strlen(user_realm);
char *pos;
*out_len = inlen;
Modified: subversion/branches/compressed-pristines/subversion/svnserve/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svnserve/main.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svnserve/main.c (original)
+++ subversion/branches/compressed-pristines/subversion/svnserve/main.c Thu Aug 16 10:17:48 2012
@@ -147,7 +147,8 @@ void winservice_notify_stop(void)
#define SVNSERVE_OPT_LOG_FILE 264
#define SVNSERVE_OPT_CACHE_TXDELTAS 265
#define SVNSERVE_OPT_CACHE_FULLTEXTS 266
-#define SVNSERVE_OPT_SINGLE_CONN 267
+#define SVNSERVE_OPT_CACHE_REVPROPS 267
+#define SVNSERVE_OPT_SINGLE_CONN 268
static const apr_getopt_option_t svnserve__options[] =
{
@@ -166,11 +167,11 @@ static const apr_getopt_option_t svnserv
N_("read configuration from file ARG")},
{"listen-port", SVNSERVE_OPT_LISTEN_PORT, 1,
#ifdef WIN32
- N_("listen port\n"
+ N_("listen port. The default port is " APR_STRINGIFY(SVN_RA_SVN_PORT) ".\n"
" "
"[mode: daemon, service, listen-once]")},
#else
- N_("listen port\n"
+ N_("listen port. The default port is " APR_STRINGIFY(SVN_RA_SVN_PORT) ".\n"
" "
"[mode: daemon, listen-once]")},
#endif
@@ -178,10 +179,14 @@ static const apr_getopt_option_t svnserv
#ifdef WIN32
N_("listen hostname or IP address\n"
" "
+ "By default svnserve listens on all addresses.\n"
+ " "
"[mode: daemon, service, listen-once]")},
#else
N_("listen hostname or IP address\n"
" "
+ "By default svnserve listens on all addresses.\n"
+ " "
"[mode: daemon, listen-once]")},
#endif
{"prefer-ipv6", '6', 0,
@@ -222,6 +227,14 @@ static const apr_getopt_option_t svnserv
"Default is yes.\n"
" "
"[used for FSFS repositories only]")},
+ {"cache-revprops", SVNSERVE_OPT_CACHE_REVPROPS, 1,
+ N_("enable or disable caching of revision properties.\n"
+ " "
+ "Consult the documentation before activating this.\n"
+ " "
+ "Default is no.\n"
+ " "
+ "[used for FSFS repositories only]")},
#ifdef CONNECTION_HAVE_THREAD_OPTION
/* ### Making the assumption here that WIN32 never has fork and so
* ### this option never exists when --service exists. */
@@ -314,7 +327,8 @@ static svn_error_t * version(svn_boolean
_("\nCyrus SASL authentication is available.\n"));
#endif
- return svn_opt_print_help3(NULL, "svnserve", TRUE, quiet, version_footer->data,
+ return svn_opt_print_help4(NULL, "svnserve", TRUE, quiet, FALSE,
+ version_footer->data,
NULL, NULL, NULL, NULL, NULL, pool);
}
@@ -398,8 +412,8 @@ check_lib_versions(void)
{ "svn_ra_svn", svn_ra_svn_version },
{ NULL, NULL }
};
-
SVN_VERSION_DEFINE(my_version);
+
return svn_ver_check_list(&my_version, checklist);
}
@@ -482,6 +496,7 @@ int main(int argc, const char *argv[])
params.memory_cache_size = (apr_uint64_t)-1;
params.cache_fulltexts = TRUE;
params.cache_txdeltas = FALSE;
+ params.cache_revprops = FALSE;
while (1)
{
@@ -625,6 +640,11 @@ int main(int argc, const char *argv[])
= svn_tristate__from_word(arg) == svn_tristate_true;
break;
+ case SVNSERVE_OPT_CACHE_REVPROPS:
+ params.cache_revprops
+ = svn_tristate__from_word(arg) == svn_tristate_true;
+ break;
+
#ifdef WIN32
case SVNSERVE_OPT_SERVICE:
if (run_mode != run_mode_service)
Modified: subversion/branches/compressed-pristines/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svnserve/serve.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svnserve/serve.c (original)
+++ subversion/branches/compressed-pristines/subversion/svnserve/serve.c Thu Aug 16 10:17:48 2012
@@ -1566,7 +1566,12 @@ static svn_error_t *get_dir(svn_ra_svn_c
svn_node_kind_t entry_kind = svn_node_none;
svn_filesize_t entry_size = 0;
svn_boolean_t has_props = FALSE;
- svn_revnum_t created_rev = 0; /* ### SVN_INVALID_REVNUM */
+ /* If 'created rev' was not requested, send 0. We can't use
+ * SVN_INVALID_REVNUM as the tuple field is not optional.
+ * See the email thread on dev@, 2012-03-28, subject
+ * "buildbot failure in ASF Buildbot on svn-slik-w2k3-x64-ra",
+ * <http://svn.haxx.se/dev/archive-2012-03/0655.shtml>. */
+ svn_revnum_t created_rev = 0;
const char *cdate = NULL;
const char *last_author = NULL;
@@ -1602,7 +1607,7 @@ static svn_error_t *get_dir(svn_ra_svn_c
/* created_rev, last_author, time */
SVN_CMD_ERR(svn_repos_get_committed_info(&created_rev,
&cdate,
- &last_author,
+ &last_author,
root,
file_path,
subpool));
@@ -2037,9 +2042,9 @@ static svn_error_t *log_cmd(svn_ra_svn_c
SVN_ERR(log_command(b, conn, pool, "%s",
svn_log__log(full_paths, start_rev, end_rev,
- limit, send_changed_paths, strict_node,
- include_merged_revisions, revprops,
- pool)));
+ (int) limit, send_changed_paths,
+ strict_node, include_merged_revisions,
+ revprops, pool)));
/* Get logs. (Can't report errors back to the client at this point.) */
lb.fs_path = b->fs_path->data;
@@ -2923,7 +2928,7 @@ repos_path_valid(const char *path)
consisting of just dots and spaces. Win32 functions treat
paths such as ".. " and "......." inconsistently. Make sure
no one can escape out of the root. */
- if (path - s >= 2 && strspn(s, ". ") == path - s)
+ if (path - s >= 2 && strspn(s, ". ") == (size_t)(path - s))
return FALSE;
#else /* ! WIN32 */
if (path - s == 2 && s[0] == '.' && s[1] == '.')
@@ -3249,6 +3254,8 @@ svn_error_t *serve(svn_ra_svn_conn_t *co
APR_HASH_KEY_STRING, params->cache_txdeltas ? "1" : "0");
apr_hash_set(b.fs_config, SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS,
APR_HASH_KEY_STRING, params->cache_fulltexts ? "1" : "0");
+ apr_hash_set(b.fs_config, SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
+ APR_HASH_KEY_STRING, params->cache_revprops ? "1" : "0");
/* Send greeting. We don't support version 1 any more, so we can
* send an empty mechlist. */
Modified: subversion/branches/compressed-pristines/subversion/svnserve/server.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svnserve/server.h?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svnserve/server.h (original)
+++ subversion/branches/compressed-pristines/subversion/svnserve/server.h Thu Aug 16 10:17:48 2012
@@ -116,6 +116,9 @@ typedef struct serve_params_t {
/* Enable full-text caching for all FSFS repositories. */
svn_boolean_t cache_fulltexts;
+ /* Enable revprop caching for all FSFS repositories. */
+ svn_boolean_t cache_revprops;
+
/* Size of the in-memory cache (used by FSFS only). */
apr_uint64_t memory_cache_size;
Modified: subversion/branches/compressed-pristines/subversion/svnsync/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svnsync/main.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svnsync/main.c (original)
+++ subversion/branches/compressed-pristines/subversion/svnsync/main.c Thu Aug 16 10:17:48 2012
@@ -301,7 +301,6 @@ check_lib_versions(void)
{ "svn_ra", svn_ra_version },
{ NULL, NULL }
};
-
SVN_VERSION_DEFINE(my_version);
return svn_ver_check_list(&my_version, checklist);
@@ -1858,9 +1857,10 @@ help_cmd(apr_getopt_t *os, void *baton,
SVN_ERR(svn_ra_print_modules(version_footer, pool));
- SVN_ERR(svn_opt_print_help3(os, "svnsync",
+ SVN_ERR(svn_opt_print_help4(os, "svnsync",
opt_baton ? opt_baton->version : FALSE,
opt_baton ? opt_baton->quiet : FALSE,
+ /*###opt_state ? opt_state->verbose :*/ FALSE,
version_footer->data, header,
svnsync_cmd_table, svnsync_options, NULL,
NULL, pool));
Modified: subversion/branches/compressed-pristines/subversion/svnsync/sync.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svnsync/sync.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svnsync/sync.c (original)
+++ subversion/branches/compressed-pristines/subversion/svnsync/sync.c Thu Aug 16 10:17:48 2012
@@ -225,9 +225,7 @@ add_directory(const char *path,
edit_baton_t *eb = pb->edit_baton;
node_baton_t *b = apr_palloc(pool, sizeof(*b));
- /* if copyfrom_path starts with '/' join rest of copyfrom_path leaving
- * leading '/' with canonicalized url eb->to_url.
- */
+ /* if copyfrom_path is an fspath create a proper uri */
if (copyfrom_path && copyfrom_path[0] == '/')
copyfrom_path = svn_path_url_add_component2(eb->to_url,
copyfrom_path + 1, pool);
@@ -276,9 +274,10 @@ add_file(const char *path,
edit_baton_t *eb = pb->edit_baton;
node_baton_t *fb = apr_palloc(pool, sizeof(*fb));
- if (copyfrom_path)
- copyfrom_path = apr_psprintf(pool, "%s%s", eb->to_url,
- svn_path_uri_encode(copyfrom_path, pool));
+ /* if copyfrom_path is an fspath create a proper uri */
+ if (copyfrom_path && copyfrom_path[0] == '/')
+ copyfrom_path = svn_path_url_add_component2(eb->to_url,
+ copyfrom_path + 1, pool);
SVN_ERR(eb->wrapped_editor->add_file(path, pb->wrapped_node_baton,
copyfrom_path, copyfrom_rev,
Modified: subversion/branches/compressed-pristines/subversion/svnversion/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svnversion/main.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svnversion/main.c (original)
+++ subversion/branches/compressed-pristines/subversion/svnversion/main.c Thu Aug 16 10:17:48 2012
@@ -37,8 +37,8 @@
static svn_error_t *
version(svn_boolean_t quiet, apr_pool_t *pool)
{
- return svn_opt_print_help3(NULL, "svnversion", TRUE, quiet, NULL, NULL,
- NULL, NULL, NULL, NULL, pool);
+ return svn_opt_print_help4(NULL, "svnversion", TRUE, quiet, FALSE,
+ NULL, NULL, NULL, NULL, NULL, NULL, pool);
}
static void
@@ -107,8 +107,8 @@ check_lib_versions(void)
{ "svn_wc", svn_wc_version },
{ NULL, NULL }
};
-
SVN_VERSION_DEFINE(my_version);
+
return svn_ver_check_list(&my_version, checklist);
}
@@ -179,10 +179,8 @@ main(int argc, const char *argv[])
if (APR_STATUS_IS_EOF(status))
break;
if (status != APR_SUCCESS)
- {
- usage(pool);
- return EXIT_FAILURE;
- }
+ usage(pool); /* this will exit() */
+
switch (opt)
{
case 'n':
@@ -201,8 +199,7 @@ main(int argc, const char *argv[])
is_version = TRUE;
break;
default:
- usage(pool);
- return EXIT_FAILURE;
+ usage(pool); /* this will exit() */
}
}
@@ -212,10 +209,7 @@ main(int argc, const char *argv[])
exit(0);
}
if (os->ind > argc || os->ind < argc - 2)
- {
- usage(pool);
- return EXIT_FAILURE;
- }
+ usage(pool); /* this will exit() */
SVN_INT_ERR(svn_utf_cstring_to_utf8(&wc_path,
(os->ind < argc) ? os->argv[os->ind]
Modified: subversion/branches/compressed-pristines/subversion/tests/cmdline/atomic-ra-revprop-change.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/cmdline/atomic-ra-revprop-change.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/cmdline/atomic-ra-revprop-change.c (original)
+++ subversion/branches/compressed-pristines/subversion/tests/cmdline/atomic-ra-revprop-change.c Thu Aug 16 10:17:48 2012
@@ -31,6 +31,7 @@
#include "svn_pools.h"
#include "svn_dirent_uri.h"
#include "svn_ra.h"
+#include "svn_cmdline.h"
#include "private/svn_skel.h"
@@ -41,7 +42,7 @@
#define KEY_NEW_PROPVAL "value"
#define USAGE_MSG \
- "Usage: %s URL REVISION PROPNAME VALUES_SKEL HTTP_LIBRARY WANT_ERROR\n" \
+ "Usage: %s URL REVISION PROPNAME VALUES_SKEL WANT_ERROR CONFIG_DIR\n" \
"\n" \
"VALUES_SKEL is a proplist skel containing pseudo-properties '%s' \n" \
"and '%s'. A pseudo-property missing from the skel is interpreted \n" \
@@ -52,83 +53,28 @@
"the exit code shall be zero.\n"
-
-/* implements svn_auth_simple_prompt_func_t */
-static svn_error_t *
-aborting_simple_prompt_func(svn_auth_cred_simple_t **cred,
- void *baton,
- const char *realm,
- const char *username,
- svn_boolean_t may_save,
- apr_pool_t *pool)
-{
- /* Oops, the jrandom:rayjandom we passed for SVN_AUTH_PARAM_DEFAULT_* failed,
- and the prompt provider has retried.
- */
- SVN_ERR_MALFUNCTION();
-}
-
-/* implements svn_auth_username_prompt_func_t */
-static svn_error_t *
-aborting_username_prompt_func(svn_auth_cred_username_t **cred,
- void *baton,
- const char *realm,
- svn_boolean_t may_save,
- apr_pool_t *pool)
-{
- /* Oops, the jrandom:rayjandom we passed for SVN_AUTH_PARAM_DEFAULT_* failed,
- and the prompt provider has retried.
- */
- SVN_ERR_MALFUNCTION();
-}
-
static svn_error_t *
construct_auth_baton(svn_auth_baton_t **auth_baton_p,
+ const char *config_dir,
apr_pool_t *pool)
{
- apr_array_header_t *providers;
- svn_auth_provider_object_t *simple_provider;
- svn_auth_baton_t *auth_baton;
-
- /* A bit of dancing just to pass jrandom:rayjandom. */
- providers = apr_array_make(pool, 2, sizeof(svn_auth_provider_object_t *)),
- svn_auth_get_simple_prompt_provider(&simple_provider,
- aborting_simple_prompt_func, NULL,
- 0, pool);
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = simple_provider;
- svn_auth_get_username_prompt_provider(&simple_provider,
- aborting_username_prompt_func, NULL,
- 0, pool);
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = simple_provider;
- svn_auth_open(&auth_baton, providers, pool);
- svn_auth_set_parameter(auth_baton,
- SVN_AUTH_PARAM_DEFAULT_USERNAME, "jrandom");
- svn_auth_set_parameter(auth_baton,
- SVN_AUTH_PARAM_DEFAULT_PASSWORD, "rayjandom");
-
- *auth_baton_p = auth_baton;
+ SVN_ERR(svn_cmdline_create_auth_baton(auth_baton_p,
+ TRUE /* non_interactive */,
+ "jrandom", "rayjandom",
+ config_dir,
+ TRUE /* no_auth_cache */,
+ FALSE /* trust_server_cert */,
+ NULL, NULL, NULL, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
construct_config(apr_hash_t **config_p,
- const char *http_library,
+ const char *config_dir,
apr_pool_t *pool)
{
- apr_hash_t *config;
- svn_config_t *servers;
-
- /* Populate SERVERS. */
- SVN_ERR(svn_config_create(&servers, FALSE, pool));
- svn_config_set(servers, SVN_CONFIG_SECTION_GLOBAL,
- SVN_CONFIG_OPTION_HTTP_LIBRARY, http_library);
-
- /* Populate CONFIG. */
- config = apr_hash_make(pool);
- apr_hash_set(config, SVN_CONFIG_CATEGORY_SERVERS,
- APR_HASH_KEY_STRING, servers);
+ SVN_ERR(svn_config_get_config(config_p, config_dir, pool));
- *config_p = config;
return SVN_NO_ERROR;
}
@@ -138,8 +84,8 @@ change_rev_prop(const char *url,
const char *propname,
const svn_string_t *propval,
const svn_string_t *old_value,
- const char *http_library,
svn_boolean_t want_error,
+ const char *config_dir,
apr_pool_t *pool)
{
svn_ra_callbacks2_t *callbacks;
@@ -149,8 +95,8 @@ change_rev_prop(const char *url,
svn_error_t *err;
SVN_ERR(svn_ra_create_callbacks(&callbacks, pool));
- SVN_ERR(construct_auth_baton(&callbacks->auth_baton, pool));
- SVN_ERR(construct_config(&config, http_library, pool));
+ SVN_ERR(construct_auth_baton(&callbacks->auth_baton, config_dir, pool));
+ SVN_ERR(construct_config(&config, config_dir, pool));
SVN_ERR(svn_ra_open4(&sess, NULL, url, NULL, callbacks, NULL /* baton */,
config, pool));
@@ -216,9 +162,9 @@ main(int argc, const char *argv[])
const char *propname;
svn_string_t *propval;
svn_string_t *old_propval;
- const char *http_library;
char *digits_end = NULL;
svn_boolean_t want_error;
+ const char *config_dir;
if (argc != 7)
{
@@ -240,8 +186,9 @@ main(int argc, const char *argv[])
revision = strtol(argv[2], &digits_end, 10);
propname = argv[3];
SVN_INT_ERR(extract_values_from_skel(&old_propval, &propval, argv[4], pool));
- http_library = argv[5];
- want_error = !strcmp(argv[6], "1");
+ want_error = !strcmp(argv[5], "1");
+ config_dir = svn_dirent_canonicalize(argv[6], pool);
+
if ((! SVN_IS_VALID_REVNUM(revision)) || (! digits_end) || *digits_end)
SVN_INT_ERR(svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
@@ -249,7 +196,7 @@ main(int argc, const char *argv[])
/* Do something. */
err = change_rev_prop(url, revision, propname, propval, old_propval,
- http_library, want_error, pool);
+ want_error, config_dir, pool);
if (err)
{
svn_handle_error2(err, stderr, FALSE, "atomic-ra-revprop-change: ");
Modified: subversion/branches/compressed-pristines/subversion/tests/cmdline/authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/cmdline/authz_tests.py?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/cmdline/authz_tests.py (original)
+++ subversion/branches/compressed-pristines/subversion/tests/cmdline/authz_tests.py Thu Aug 16 10:17:48 2012
@@ -1398,6 +1398,59 @@ def upgrade_absent(sbox):
svntest.actions.run_and_verify_update(sbox.wc_dir, expected_output,
None, None)
+@Issue(4183)
+@XFail()
+@Skip(svntest.main.is_ra_type_file)
+def remove_subdir_with_authz_and_tc(sbox):
+ "remove a subdir with authz file"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ sbox.simple_rm('A/B')
+ sbox.simple_commit()
+
+ svntest.main.write_restrictive_svnserve_conf(sbox.repo_dir)
+ svntest.main.write_authz_file(sbox, { "/" : "*=rw",
+ "/A/B/E" : "*="})
+
+ # Now update back to r1. This will reintroduce A/B except A/B/E.
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.remove('A/B/E', 'A/B/E/alpha', 'A/B/E/beta')
+
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/B' : Item(status='A '),
+ 'A/B/F' : Item(status='A '),
+ 'A/B/lambda' : Item(status='A '),
+ })
+
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ None,
+ expected_status,
+ None,
+ None, None,
+ None, None, False,
+ wc_dir, '-r', '1')
+
+ # Perform some edit operation to introduce a tree conflict
+ svntest.main.file_write(sbox.ospath('A/B/lambda'), 'qq')
+
+ # And now update to r2. This tries to delete A/B and causes a tree conflict
+ # ### But is also causes an error in creating the copied state
+ # ### svn: E220001: Cannot copy '<snip>\A\B\E' excluded by server
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/B' : Item(status=' ', treeconflict='C'),
+ })
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ None,
+ None,
+ None,
+ None, None,
+ None, None, False,
+ wc_dir)
+
########################################################################
# Run the tests
@@ -1427,6 +1480,7 @@ test_list = [ None,
wc_delete,
wc_commit_error_handling,
upgrade_absent,
+ remove_subdir_with_authz_and_tc
]
serial_only = True
Modified: subversion/branches/compressed-pristines/subversion/tests/cmdline/autoprop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/tests/cmdline/autoprop_tests.py?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/tests/cmdline/autoprop_tests.py (original)
+++ subversion/branches/compressed-pristines/subversion/tests/cmdline/autoprop_tests.py Thu Aug 16 10:17:48 2012
@@ -25,7 +25,9 @@
######################################################################
# General modules
-import os
+import os, logging
+
+logger = logging.getLogger()
# Our testing module
import svntest
@@ -47,8 +49,8 @@ def check_proplist(path, exp_out):
props = svntest.tree.get_props([path]).get(path, {})
if props != exp_out:
- print("Expected properties: %s" % exp_out)
- print("Actual properties: %s" % props)
+ logger.warn("Expected properties: %s", exp_out)
+ logger.warn("Actual properties: %s", props)
raise svntest.Failure