You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/12/10 22:23:13 UTC
svn commit: r1044516 [18/22] - in /subversion/branches/ignore-mergeinfo: ./
build/ac-macros/ build/generator/ contrib/server-side/ notes/ notes/wc-ng/
subversion/bindings/javahl/native/
subversion/bindings/javahl/src/org/apache/subversion/javahl/ subve...
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/cl.h?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/cl.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/cl.h Fri Dec 10 21:23:03 2010
@@ -229,6 +229,7 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t show_diff; /* produce diff output */
svn_boolean_t internal_diff; /* override diff_cmd in config file */
svn_boolean_t use_git_diff_format; /* Use git's extended diff format */
+ svn_boolean_t old_patch_target_names; /* Use target names from old side */
svn_boolean_t ignore_mergeinfo; /* ignore mergeinfo in reporting commands. */
} svn_cl__opt_state_t;
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/commit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/commit-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/commit-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/commit-cmd.c Fri Dec 10 21:23:03 2010
@@ -119,6 +119,9 @@ svn_cl__commit(apr_getopt_t *os,
opt_state->keep_changelists,
opt_state->changelists,
opt_state->revprop_table,
+ ! opt_state->quiet
+ ? svn_cl__print_commit_info : NULL,
+ NULL,
ctx,
pool);
if (err)
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/conflict-callbacks.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/conflict-callbacks.c Fri Dec 10 21:23:03 2010
@@ -59,23 +59,33 @@ svn_cl__conflict_baton_make(svn_cl__acce
svn_cl__accept_t
svn_cl__accept_from_word(const char *word)
{
- if (strcmp(word, SVN_CL__ACCEPT_POSTPONE) == 0)
+ /* Shorthand options are consistent with svn_cl__conflict_handler(). */
+ if (strcmp(word, SVN_CL__ACCEPT_POSTPONE) == 0
+ || strcmp(word, "p") == 0)
return svn_cl__accept_postpone;
if (strcmp(word, SVN_CL__ACCEPT_BASE) == 0)
+ /* ### shorthand? */
return svn_cl__accept_base;
if (strcmp(word, SVN_CL__ACCEPT_WORKING) == 0)
+ /* ### shorthand? */
return svn_cl__accept_working;
- if (strcmp(word, SVN_CL__ACCEPT_MINE_CONFLICT) == 0)
+ if (strcmp(word, SVN_CL__ACCEPT_MINE_CONFLICT) == 0
+ || strcmp(word, "mc") == 0)
return svn_cl__accept_mine_conflict;
- if (strcmp(word, SVN_CL__ACCEPT_THEIRS_CONFLICT) == 0)
+ if (strcmp(word, SVN_CL__ACCEPT_THEIRS_CONFLICT) == 0
+ || strcmp(word, "tc") == 0)
return svn_cl__accept_theirs_conflict;
- if (strcmp(word, SVN_CL__ACCEPT_MINE_FULL) == 0)
+ if (strcmp(word, SVN_CL__ACCEPT_MINE_FULL) == 0
+ || strcmp(word, "mf") == 0)
return svn_cl__accept_mine_full;
- if (strcmp(word, SVN_CL__ACCEPT_THEIRS_FULL) == 0)
+ if (strcmp(word, SVN_CL__ACCEPT_THEIRS_FULL) == 0
+ || strcmp(word, "tf") == 0)
return svn_cl__accept_theirs_full;
- if (strcmp(word, SVN_CL__ACCEPT_EDIT) == 0)
+ if (strcmp(word, SVN_CL__ACCEPT_EDIT) == 0
+ || strcmp(word, "e") == 0)
return svn_cl__accept_edit;
- if (strcmp(word, SVN_CL__ACCEPT_LAUNCH) == 0)
+ if (strcmp(word, SVN_CL__ACCEPT_LAUNCH) == 0
+ || strcmp(word, "l") == 0)
return svn_cl__accept_launch;
/* word is an invalid action. */
return svn_cl__accept_invalid;
@@ -493,6 +503,7 @@ svn_cl__conflict_handler(svn_wc_conflict
if (strcmp(answer, "s") == 0)
{
+ /* These are used in svn_cl__accept_from_word(). */
SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
_("\n"
" (e) edit - change merged file in an editor\n"
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/copy-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/copy-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/copy-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/copy-cmd.c Fri Dec 10 21:23:03 2010
@@ -139,7 +139,9 @@ svn_cl__copy(apr_getopt_t *os,
err = svn_client_copy6(sources, dst_path, TRUE,
opt_state->parents, opt_state->ignore_externals,
- opt_state->revprop_table, ctx, pool);
+ opt_state->revprop_table,
+ svn_cl__print_commit_info, NULL,
+ ctx, pool);
if (ctx->log_msg_func3)
SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err, pool));
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/delete-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/delete-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/delete-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/delete-cmd.c Fri Dec 10 21:23:03 2010
@@ -89,7 +89,8 @@ svn_cl__delete(apr_getopt_t *os,
SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
err = svn_client_delete4(targets, opt_state->force, opt_state->keep_local,
- opt_state->revprop_table, ctx, pool);
+ opt_state->revprop_table, svn_cl__print_commit_info,
+ NULL, ctx, pool);
if (err)
err = svn_cl__may_need_force(err);
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/import-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/import-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/import-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/import-cmd.c Fri Dec 10 21:23:03 2010
@@ -124,6 +124,8 @@ svn_cl__import(apr_getopt_t *os,
opt_state->no_ignore,
opt_state->force,
opt_state->revprop_table,
+ svn_cl__print_commit_info,
+ NULL,
ctx,
pool), pool));
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/log-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/log-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/log-cmd.c Fri Dec 10 21:23:03 2010
@@ -354,6 +354,7 @@ log_entry_receiver(void *baton,
if (err->apr_err == SVN_ERR_FS_NOT_FOUND)
{
svn_error_clear(err);
+ parent = svn_uri_dirname(parent, pool);
continue;
}
if (err->apr_err == SVN_ERR_RA_ILLEGAL_URL ||
@@ -365,8 +366,6 @@ log_entry_receiver(void *baton,
}
return svn_error_return(err);
}
-
- parent = svn_uri_dirname(parent, pool);
}
svn_pool_destroy(iterpool);
}
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/main.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/main.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/main.c Fri Dec 10 21:23:03 2010
@@ -122,6 +122,7 @@ typedef enum {
opt_show_diff,
opt_internal_diff,
opt_use_git_diff_format,
+ opt_old_patch_target_names,
opt_ignore_mergeinfo
} svn_cl__longopt_t;
@@ -284,7 +285,9 @@ const apr_getopt_option_t svn_cl__option
" "
"ARG may be one of 'LF', 'CR', 'CRLF'")},
{"limit", 'l', 1, N_("maximum number of log entries")},
- {"no-unlock", opt_no_unlock, 0, N_("don't unlock the targets")},
+ {"no-unlock", opt_no_unlock, 0, N_("don't unlock the targets\n"
+ " "
+ "[aliases: --nul, --keep-lock]")},
{"summarize", opt_summarize, 0, N_("show a summary of the results")},
{"remove", opt_remove, 0, N_("remove changelist association")},
{"changelist", opt_changelist, 1,
@@ -356,6 +359,10 @@ const apr_getopt_option_t svn_cl__option
{"reverse-diff", opt_reverse_diff, 0,
N_("apply the unidiff in reverse\n"
" "
+ "This option also reverses patch target names; the\n"
+ " "
+ "--old-patch-target-names option will prevent this.\n"
+ " "
"[alias: --rd]")},
{"ignore-whitespace", opt_ignore_whitespace, 0,
N_("ignore whitespace during pattern matching\n"
@@ -369,11 +376,24 @@ const apr_getopt_option_t svn_cl__option
N_("override diff-cmd specified in config file\n"
" "
"[alias: --idiff]")},
- {"git-diff", opt_use_git_diff_format, 0,
+ {"git", opt_use_git_diff_format, 0,
N_("use git's extended diff format\n")},
{"ignore-mergeinfo", opt_ignore_mergeinfo, 0,
N_("ignore changes to mergeinfo")},
+ {"old-patch-target-names", opt_old_patch_target_names, 0,
+ N_("use target names from the old side of a patch.\n"
+ " "
+ "If a diff header contains\n"
+ " "
+ " --- foo.c\n"
+ " "
+ " +++ foo.c.new\n"
+ " "
+ "this option will cause the name \"foo.c\" to be used\n"
+ " "
+ "[alias: --optn]")},
+
/* Long-opt Aliases
*
* These have NULL desriptions, but an option code that matches some
@@ -402,6 +422,9 @@ const apr_getopt_option_t svn_cl__option
{"iw", opt_ignore_whitespace, 0, NULL},
{"diff", opt_show_diff, 0, NULL},
{"idiff", opt_internal_diff, 0, NULL},
+ {"nul", opt_no_unlock, 0, NULL},
+ {"keep-lock", opt_no_unlock, 0, NULL},
+ {"optn", opt_old_patch_target_names, 0, NULL},
{0, 0, 0, 0},
};
@@ -546,7 +569,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
" committed, are immediately removed from the working copy\n"
" unless the --keep-local option is given.\n"
" PATHs that are, or contain, unversioned or modified items will\n"
- " not be removed unless the --force option is given.\n"
+ " not be removed unless the --force or --keep-local option is given.\n"
"\n"
" 2. Each item specified by a URL is deleted from the repository\n"
" via an immediate commit.\n"),
@@ -851,7 +874,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
" do not agree with.\n"
),
{'q', opt_dry_run, opt_strip_count, opt_reverse_diff,
- opt_ignore_whitespace} },
+ opt_ignore_whitespace, opt_old_patch_target_names} },
{ "propdel", svn_cl__propdel, {"pdel", "pd"}, N_
("Remove a property from files, dirs, or revisions.\n"
@@ -1787,6 +1810,9 @@ main(int argc, const char *argv[])
case opt_use_git_diff_format:
opt_state.use_git_diff_format = TRUE;
break;
+ case opt_old_patch_target_names:
+ opt_state.old_patch_target_names = TRUE;
+ break;
case opt_ignore_mergeinfo:
opt_state.ignore_mergeinfo = TRUE;
break;
@@ -2067,12 +2093,24 @@ main(int argc, const char *argv[])
}
}
- if (opt_state.relocate && (opt_state.depth != svn_depth_unknown))
+ /* Relocation is infinite-depth only. */
+ if (opt_state.relocate)
{
- err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
- _("--relocate and --depth are mutually "
- "exclusive"));
- return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+ if (opt_state.depth != svn_depth_unknown)
+ {
+ err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+ _("--relocate and --depth are mutually "
+ "exclusive"));
+ return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+ }
+ if (! descend)
+ {
+ err = svn_error_create(
+ SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+ _("--relocate and --non-recursive (-N) are mutually "
+ "exclusive"));
+ return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+ }
}
/* Only a few commands can accept a revision range; the rest can take at
@@ -2236,10 +2274,6 @@ main(int argc, const char *argv[])
return svn_cmdline_handle_exit_error(err, pool, "svn: ");
}
- /* Set up our commit callback. We leave the callback NULL. */
- if (!opt_state.quiet)
- ctx->commit_callback2 = svn_cl__print_commit_info;
-
/* Set up our cancellation support. */
ctx->cancel_func = svn_cl__check_cancel;
apr_signal(SIGINT, signal_handler);
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/merge-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/merge-cmd.c Fri Dec 10 21:23:03 2010
@@ -337,6 +337,11 @@ svn_cl__merge(apr_getopt_t *os,
}
else
{
+ if (svn_path_is_url(sourcepath1) != svn_path_is_url(sourcepath2))
+ return svn_error_return(svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR,
+ NULL,
+ _("Merge sources must both be "
+ "either paths or URLs")));
err = svn_client_merge3(sourcepath1,
&first_range_start,
sourcepath2,
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/mkdir-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/mkdir-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/mkdir-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/mkdir-cmd.c Fri Dec 10 21:23:03 2010
@@ -76,7 +76,8 @@ svn_cl__mkdir(apr_getopt_t *os,
SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
err = svn_client_mkdir4(targets, opt_state->parents,
- opt_state->revprop_table, ctx, pool);
+ opt_state->revprop_table, svn_cl__print_commit_info,
+ NULL, ctx, pool);
if (ctx->log_msg_func3)
err = svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err, pool);
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/move-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/move-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/move-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/move-cmd.c Fri Dec 10 21:23:03 2010
@@ -86,7 +86,7 @@ svn_cl__move(apr_getopt_t *os,
err = svn_client_move6(targets, dst_path, opt_state->force,
TRUE, opt_state->parents, opt_state->revprop_table,
- ctx, pool);
+ svn_cl__print_commit_info, NULL, ctx, pool);
if (err)
err = svn_cl__may_need_force(err);
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/patch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/patch-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/patch-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/patch-cmd.c Fri Dec 10 21:23:03 2010
@@ -74,6 +74,7 @@ svn_cl__patch(apr_getopt_t *os,
SVN_ERR(svn_client_patch(abs_patch_path, abs_target_path,
opt_state->dry_run, opt_state->strip_count,
+ opt_state->old_patch_target_names,
opt_state->reverse_diff,
opt_state->ignore_whitespace,
TRUE, NULL, NULL, ctx, pool, pool));
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/propdel-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/propdel-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/propdel-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/propdel-cmd.c Fri Dec 10 21:23:03 2010
@@ -141,6 +141,7 @@ svn_cl__propdel(apr_getopt_t *os,
opt_state->depth,
FALSE, SVN_INVALID_REVNUM,
opt_state->changelists, NULL,
+ svn_cl__print_commit_info, NULL,
ctx, subpool),
NULL, opt_state->quiet,
SVN_ERR_UNVERSIONED_RESOURCE,
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/propedit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/propedit-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/propedit-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/propedit-cmd.c Fri Dec 10 21:23:03 2010
@@ -283,9 +283,6 @@ svn_cl__propedit(apr_getopt_t *os,
: svn_dirent_local_style(target, subpool);
cib.target_local = target_local;
- ctx->commit_callback2 = commit_info_handler;
- ctx->commit_baton = &cib;
-
/* ...and re-set the property's value accordingly. */
if (edited_propval && !svn_string_compare(propval, edited_propval))
{
@@ -302,6 +299,7 @@ svn_cl__propedit(apr_getopt_t *os,
err = svn_client_propset4(pname_utf8, edited_propval, target,
svn_depth_empty, opt_state->force,
base_rev, NULL, opt_state->revprop_table,
+ commit_info_handler, &cib,
ctx, subpool);
if (ctx->log_msg_func3)
SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3,
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/propset-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/propset-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/propset-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/propset-cmd.c Fri Dec 10 21:23:03 2010
@@ -182,7 +182,8 @@ svn_cl__propset(apr_getopt_t *os,
pname_utf8, propval, target,
opt_state->depth, opt_state->force,
SVN_INVALID_REVNUM, opt_state->changelists,
- NULL, ctx, iterpool),
+ NULL, svn_cl__print_commit_info, NULL, ctx,
+ iterpool),
NULL, opt_state->quiet,
SVN_ERR_UNVERSIONED_RESOURCE,
SVN_ERR_ENTRY_NOT_FOUND,
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/revert-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/revert-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/revert-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/revert-cmd.c Fri Dec 10 21:23:03 2010
@@ -67,7 +67,7 @@ svn_cl__revert(apr_getopt_t *os,
opt_state->changelists, ctx, scratch_pool);
if (err
- && (err->apr_err == SVN_ERR_WC_NOT_LOCKED)
+ && (err->apr_err == SVN_ERR_WC_INVALID_OPERATION_DEPTH)
&& (! SVN_DEPTH_IS_RECURSIVE(opt_state->depth)))
{
err = svn_error_quick_wrap
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/status-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/status-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/status-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/status-cmd.c Fri Dec 10 21:23:03 2010
@@ -316,6 +316,7 @@ svn_cl__status(apr_getopt_t *os,
opt_state->update,
opt_state->no_ignore,
opt_state->ignore_externals,
+ FALSE /* depth_as_sticky */,
opt_state->ignore_mergeinfo,
opt_state->changelists,
print_status, &sb,
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/status.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/status.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/status.c Fri Dec 10 21:23:03 2010
@@ -50,7 +50,6 @@ generate_status_code(enum svn_wc_status_
case svn_wc_status_deleted: return 'D';
case svn_wc_status_replaced: return 'R';
case svn_wc_status_modified: return 'M';
- case svn_wc_status_merged: return 'G';
case svn_wc_status_conflicted: return 'C';
case svn_wc_status_obstructed: return '~';
case svn_wc_status_ignored: return 'I';
@@ -108,7 +107,6 @@ generate_status_desc(enum svn_wc_status_
case svn_wc_status_deleted: return "deleted";
case svn_wc_status_replaced: return "replaced";
case svn_wc_status_modified: return "modified";
- case svn_wc_status_merged: return "merged";
case svn_wc_status_conflicted: return "conflicted";
case svn_wc_status_obstructed: return "obstructed";
case svn_wc_status_ignored: return "ignored";
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/switch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/switch-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/switch-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/switch-cmd.c Fri Dec 10 21:23:03 2010
@@ -41,7 +41,6 @@
static svn_error_t *
rewrite_urls(const apr_array_header_t *targets,
- svn_boolean_t recurse,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
{
@@ -67,7 +66,7 @@ rewrite_urls(const apr_array_header_t *t
if (targets->nelts == 2)
{
- SVN_ERR(svn_client_relocate("", from, to, recurse, ctx, pool));
+ SVN_ERR(svn_client_relocate2("", from, to, ctx, pool));
}
else
{
@@ -75,8 +74,7 @@ rewrite_urls(const apr_array_header_t *t
{
const char *target = APR_ARRAY_IDX(targets, i, const char *);
svn_pool_clear(subpool);
- SVN_ERR(svn_client_relocate(target, from, to, recurse,
- ctx, subpool));
+ SVN_ERR(svn_client_relocate2(target, from, to, ctx, subpool));
}
}
@@ -109,9 +107,7 @@ svn_cl__switch(apr_getopt_t *os,
/* handle only-rewrite case specially */
if (opt_state->relocate)
- return rewrite_urls(targets,
- SVN_DEPTH_IS_RECURSIVE(opt_state->depth),
- ctx, scratch_pool);
+ return rewrite_urls(targets, ctx, scratch_pool);
if (targets->nelts < 1)
return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/upgrade-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/upgrade-cmd.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/upgrade-cmd.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/upgrade-cmd.c Fri Dec 10 21:23:03 2010
@@ -31,6 +31,7 @@
#include "svn_client.h"
#include "svn_error_codes.h"
#include "svn_error.h"
+#include "svn_path.h"
#include "cl.h"
#include "svn_private_config.h"
@@ -59,6 +60,19 @@ svn_cl__upgrade(apr_getopt_t *os,
SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, scratch_pool));
+ /* Don't even attempt to modify the working copy if any of the
+ * targets look like URLs. URLs are invalid input. */
+ for (i = 0; i < targets->nelts; i++)
+ {
+ const char *target = APR_ARRAY_IDX(targets, i, const char *);
+
+ if (svn_path_is_url(target))
+ return svn_error_return(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
+ NULL,
+ _("'%s' is not a local path"),
+ target));
+ }
+
iterpool = svn_pool_create(scratch_pool);
for (i = 0; i < targets->nelts; i++)
{
Modified: subversion/branches/ignore-mergeinfo/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svn/util.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svn/util.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svn/util.c Fri Dec 10 21:23:03 2010
@@ -764,9 +764,9 @@ svn_cl__get_log_message(const char **log
&& item->state_flags & SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN)
unlock = 'U';
- svn_stringbuf_appendbytes(tmp_message, &text_mod, 1);
- svn_stringbuf_appendbytes(tmp_message, &prop_mod, 1);
- svn_stringbuf_appendbytes(tmp_message, &unlock, 1);
+ svn_stringbuf_appendbyte(tmp_message, text_mod);
+ svn_stringbuf_appendbyte(tmp_message, prop_mod);
+ svn_stringbuf_appendbyte(tmp_message, unlock);
if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_IS_COPY)
/* History included via copy/move. */
svn_stringbuf_appendcstr(tmp_message, "+ ");
@@ -829,8 +829,8 @@ svn_cl__get_log_message(const char **log
for (len = message->len - 1; len >= 0; len--)
{
/* FIXME: should really use an UTF-8 whitespace test
- rather than apr_isspace, which is locale dependant */
- if (! apr_isspace(message->data[len]))
+ rather than svn_ctype_isspace, which is ASCII only */
+ if (! svn_ctype_isspace(message->data[len]))
break;
}
if (len < 0)
Modified: subversion/branches/ignore-mergeinfo/subversion/svndumpfilter/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svndumpfilter/main.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svndumpfilter/main.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svndumpfilter/main.c Fri Dec 10 21:23:03 2010
@@ -91,20 +91,20 @@ write_prop_to_stringbuf(svn_stringbuf_t
bytes_used = apr_snprintf(buf, sizeof(buf), "%d", namelen);
svn_stringbuf_appendbytes(*strbuf, buf, bytes_used);
- svn_stringbuf_appendbytes(*strbuf, "\n", 1);
+ svn_stringbuf_appendbyte(*strbuf, '\n');
svn_stringbuf_appendbytes(*strbuf, name, namelen);
- svn_stringbuf_appendbytes(*strbuf, "\n", 1);
+ svn_stringbuf_appendbyte(*strbuf, '\n');
/* Output value length, then value. */
svn_stringbuf_appendbytes(*strbuf, "V ", 2);
bytes_used = apr_snprintf(buf, sizeof(buf), "%" APR_SIZE_T_FMT, value->len);
svn_stringbuf_appendbytes(*strbuf, buf, bytes_used);
- svn_stringbuf_appendbytes(*strbuf, "\n", 1);
+ svn_stringbuf_appendbyte(*strbuf, '\n');
svn_stringbuf_appendbytes(*strbuf, value->data, value->len);
- svn_stringbuf_appendbytes(*strbuf, "\n", 1);
+ svn_stringbuf_appendbyte(*strbuf, '\n');
}
@@ -365,19 +365,19 @@ output_revision(struct revision_baton_t
bytes_used = apr_snprintf(buf, sizeof(buf), ": %" APR_SIZE_T_FMT,
props->len);
svn_stringbuf_appendbytes(rb->header, buf, bytes_used);
- svn_stringbuf_appendbytes(rb->header, "\n", 1);
+ svn_stringbuf_appendbyte(rb->header, '\n');
}
svn_stringbuf_appendcstr(rb->header, SVN_REPOS_DUMPFILE_CONTENT_LENGTH);
bytes_used = apr_snprintf(buf, sizeof(buf), ": %" APR_SIZE_T_FMT, props->len);
svn_stringbuf_appendbytes(rb->header, buf, bytes_used);
- svn_stringbuf_appendbytes(rb->header, "\n", 1);
+ svn_stringbuf_appendbyte(rb->header, '\n');
/* put an end to headers */
- svn_stringbuf_appendbytes(rb->header, "\n", 1);
+ svn_stringbuf_appendbyte(rb->header, '\n');
/* put an end to revision */
- svn_stringbuf_appendbytes(props, "\n", 1);
+ svn_stringbuf_appendbyte(props, '\n');
/* write out the revision */
/* Revision is written out in the following cases:
@@ -633,7 +633,7 @@ output_node(struct node_baton_t *nb)
bytes_used = apr_snprintf(buf, sizeof(buf), ": %" APR_SIZE_T_FMT,
nb->props->len);
svn_stringbuf_appendbytes(nb->header, buf, bytes_used);
- svn_stringbuf_appendbytes(nb->header, "\n", 1);
+ svn_stringbuf_appendbyte(nb->header, '\n');
}
if (nb->has_text)
{
@@ -642,16 +642,16 @@ output_node(struct node_baton_t *nb)
bytes_used = apr_snprintf(buf, sizeof(buf), ": %" SVN_FILESIZE_T_FMT,
nb->tcl);
svn_stringbuf_appendbytes(nb->header, buf, bytes_used);
- svn_stringbuf_appendbytes(nb->header, "\n", 1);
+ svn_stringbuf_appendbyte(nb->header, '\n');
}
svn_stringbuf_appendcstr(nb->header, SVN_REPOS_DUMPFILE_CONTENT_LENGTH);
bytes_used = apr_snprintf(buf, sizeof(buf), ": %" SVN_FILESIZE_T_FMT,
(svn_filesize_t) (nb->props->len + nb->tcl));
svn_stringbuf_appendbytes(nb->header, buf, bytes_used);
- svn_stringbuf_appendbytes(nb->header, "\n", 1);
+ svn_stringbuf_appendbyte(nb->header, '\n');
/* put an end to headers */
- svn_stringbuf_appendbytes(nb->header, "\n", 1);
+ svn_stringbuf_appendbyte(nb->header, '\n');
/* 3. output all the stuff */
Modified: subversion/branches/ignore-mergeinfo/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svnrdump/dump_editor.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svnrdump/dump_editor.c Fri Dec 10 21:23:03 2010
@@ -27,12 +27,19 @@
#include "svn_repos.h"
#include "svn_path.h"
#include "svn_props.h"
+#include "svn_subst.h"
#include "svn_dirent_uri.h"
#include "dump_editor.h"
#define ARE_VALID_COPY_ARGS(p,r) ((p) && SVN_IS_VALID_REVNUM(r))
+#ifdef SVN_DEBUG
+#define LDR_DBG(x) SVN_DBG(x)
+#else
+#define LDR_DBG(x) while(0)
+#endif
+
/* The baton used by the dump editor. */
struct dump_edit_baton {
/* The output stream we write the dumpfile to */
@@ -60,11 +67,41 @@ struct dump_edit_baton {
const char *base_checksum;
/* Flags to trigger dumping props and text */
- svn_boolean_t dump_props;
svn_boolean_t dump_text;
- svn_boolean_t dump_props_pending;
+ svn_boolean_t dump_props;
+ svn_boolean_t dump_newlines;
};
+/* Normalize the line ending style of the values of properties in PROPS
+ * that "need translation" (according to svn_prop_needs_translation(),
+ * currently all svn:* props) so that they contain only LF (\n) line endings.
+ */
+svn_error_t *
+normalize_props(apr_hash_t *props,
+ apr_pool_t *pool)
+{
+ apr_hash_index_t *hi;
+ const char *key, *cstring;
+ const svn_string_t *value;
+
+ for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
+ {
+ key = svn__apr_hash_index_key(hi);
+ value = svn__apr_hash_index_val(hi);
+
+ if (svn_prop_needs_translation(key))
+ {
+ SVN_ERR(svn_subst_translate_cstring2(value->data, &cstring,
+ "\n", TRUE,
+ NULL, FALSE,
+ pool));
+ value = svn_string_create(cstring, pool);
+ apr_hash_set(props, key, APR_HASH_KEY_STRING, value);
+ }
+ }
+ return SVN_NO_ERROR;
+}
+
/* Make a directory baton to represent the directory at path (relative
* to the edit_baton).
*
@@ -91,17 +128,15 @@ make_dir_baton(const char *path,
struct dir_baton *new_db = apr_pcalloc(pool, sizeof(*new_db));
const char *abspath;
- /* Disallow a path relative to nothing. */
- SVN_ERR_ASSERT_NO_RETURN(!path || pb);
-
/* Construct the full path of this node. */
if (pb)
abspath = svn_uri_join("/", path, pool);
else
- abspath = "/";
+ abspath = apr_pstrdup(pool, "/");
- /* Remove leading slashes from copyfrom paths. */
- if (copyfrom_path && strcmp(copyfrom_path, "/"))
+ /* Strip leading slash from copyfrom_path so that the path is
+ canonical and svn_relpath_join can be used */
+ if (copyfrom_path)
copyfrom_path = ((*copyfrom_path == '/') ?
copyfrom_path + 1 : copyfrom_path);
@@ -113,7 +148,7 @@ make_dir_baton(const char *path,
new_db->copyfrom_rev = copyfrom_rev;
new_db->added = added;
new_db->written_out = FALSE;
- new_db->deleted_entries = apr_hash_make(pool);
+ new_db->deleted_entries = apr_hash_make(eb->pool);
return new_db;
}
@@ -133,6 +168,7 @@ dump_props(struct dump_edit_baton *eb,
if (trigger_var && !*trigger_var)
return SVN_NO_ERROR;
+ SVN_ERR(normalize_props(eb->props, pool));
svn_stringbuf_setempty(eb->propstring);
propstream = svn_stream_from_stringbuf(eb->propstring, eb->pool);
SVN_ERR(svn_hash_write_incremental(eb->props, eb->deleted_props,
@@ -175,6 +211,19 @@ dump_props(struct dump_edit_baton *eb,
return SVN_NO_ERROR;
}
+static svn_error_t *
+dump_newlines(struct dump_edit_baton *eb,
+ svn_boolean_t *trigger_var,
+ apr_pool_t *pool)
+{
+ if (trigger_var && *trigger_var)
+ {
+ SVN_ERR(svn_stream_printf(eb->stream, pool, "\n\n"));
+ *trigger_var = FALSE;
+ }
+ return SVN_NO_ERROR;
+}
+
/*
* Write out a node record for PATH of type KIND under EB->FS_ROOT.
* ACTION describes what is happening to the node (see enum
@@ -197,10 +246,10 @@ dump_node(struct dump_edit_baton *eb,
apr_pool_t *pool)
{
/* Remove leading slashes from path and copyfrom_path */
- if (path && strcmp(path, "/"))
+ if (path)
path = ((*path == '/') ? path + 1 : path);
- if (copyfrom_path && strcmp(copyfrom_path, "/"))
+ if (copyfrom_path)
copyfrom_path = ((*copyfrom_path == '/') ?
copyfrom_path + 1 : copyfrom_path);
@@ -221,6 +270,9 @@ dump_node(struct dump_edit_baton *eb,
switch (action)
{
case svn_node_action_change:
+ /* We are here after a change_file_prop or change_dir_prop. They
+ set up whatever dump_props they needed to- nothing to
+ do here but print node action information */
SVN_ERR(svn_stream_printf(eb->stream, pool,
SVN_REPOS_DUMPFILE_NODE_ACTION
": change\n"));
@@ -234,7 +286,9 @@ dump_node(struct dump_edit_baton *eb,
SVN_REPOS_DUMPFILE_NODE_ACTION
": replace\n"));
- eb->dump_props_pending = TRUE;
+ /* Wait for a change_*_prop to be called before dumping
+ anything */
+ eb->dump_props = TRUE;
break;
}
/* More complex case: is_copy is true, and copyfrom_path/
@@ -251,7 +305,6 @@ dump_node(struct dump_edit_baton *eb,
/* We can leave this routine quietly now, don't need to dump any
content; that was already done in the second record. */
- eb->dump_props = FALSE;
break;
case svn_node_action_delete:
@@ -259,10 +312,10 @@ dump_node(struct dump_edit_baton *eb,
SVN_REPOS_DUMPFILE_NODE_ACTION
": delete\n"));
- /* We can leave this routine quietly now, don't need to dump
- any content. */
+ /* We can leave this routine quietly now. Nothing more to do-
+ print a couple of newlines because we're not dumping props or
+ text. */
SVN_ERR(svn_stream_printf(eb->stream, pool, "\n\n"));
- eb->dump_props = FALSE;
break;
case svn_node_action_add:
@@ -271,15 +324,17 @@ dump_node(struct dump_edit_baton *eb,
if (!is_copy)
{
- /* eb->dump_props_pending for files is handled in close_file
+ /* eb->dump_props for files is handled in close_file
which is called immediately. However, directories are not
closed until all the work inside them has been done;
- eb->dump_props_pending for directories is handled in all the
+ eb->dump_props for directories is handled in all the
functions that can possibly be called after add_directory:
add_directory, open_directory, delete_entry, close_directory,
add_file, open_file. change_dir_prop is a special case. */
- eb->dump_props_pending = TRUE;
+ /* Wait for a change_*_prop to be called before dumping
+ anything */
+ eb->dump_props = TRUE;
break;
}
@@ -290,19 +345,18 @@ dump_node(struct dump_edit_baton *eb,
": %s\n",
copyfrom_rev, copyfrom_path));
- /* Ugly hack: If a directory was copied from a previous revision,
- nothing else can be done, and close_file won't be called to
- write two blank lines. Write them here otherwise the `svnadmin
- load` parser will fail. */
+ /* Ugly hack: If a directory was copied from a previous
+ revision, nothing like close_file will be called to write two
+ blank lines. If change_dir_prop is called, props are dumped
+ (along with the necessary PROPS-END\n\n and we're good. So
+ set a dump_newlines here to print the newlines unless
+ change_dir_prop is called next otherwise the `svnadmin load`
+ parser will fail. */
if (kind == svn_node_dir)
- SVN_ERR(svn_stream_printf(eb->stream, pool, "\n\n"));
+ eb->dump_newlines = TRUE;
break;
}
-
- /* Dump property headers */
- SVN_ERR(dump_props(eb, &(eb->dump_props), FALSE, pool));
-
return SVN_NO_ERROR;
}
@@ -315,6 +369,7 @@ open_root(void *edit_baton,
struct dump_edit_baton *eb = edit_baton;
/* Allocate a special pool for the edit_baton to avoid pool
lifetime issues */
+
eb->pool = svn_pool_create(pool);
eb->props = apr_hash_make(eb->pool);
eb->deleted_props = apr_hash_make(eb->pool);
@@ -322,6 +377,8 @@ open_root(void *edit_baton,
*root_baton = make_dir_baton(NULL, NULL, SVN_INVALID_REVNUM,
edit_baton, NULL, FALSE, pool);
+ LDR_DBG(("open_root %p\n", *root_baton));
+
return SVN_NO_ERROR;
}
@@ -332,14 +389,19 @@ delete_entry(const char *path,
apr_pool_t *pool)
{
struct dir_baton *pb = parent_baton;
- const char *mypath = apr_pstrdup(pool, path);
+
+ LDR_DBG(("delete_entry %s\n", path));
/* Some pending properties to dump? */
- SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
+ SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props), TRUE, pool));
+
+ /* Some pending newlines to dump? */
+ SVN_ERR(dump_newlines(pb->eb, &(pb->eb->dump_newlines), pool));
/* Add this path to the deleted_entries of the parent directory
baton. */
- apr_hash_set(pb->deleted_entries, mypath, APR_HASH_KEY_STRING, pb);
+ apr_hash_set(pb->deleted_entries, apr_pstrdup(pb->eb->pool, path),
+ APR_HASH_KEY_STRING, pb);
return SVN_NO_ERROR;
}
@@ -358,8 +420,13 @@ add_directory(const char *path,
= make_dir_baton(path, copyfrom_path, copyfrom_rev, pb->eb, pb, TRUE, pool);
svn_boolean_t is_copy;
+ LDR_DBG(("add_directory %s\n", path));
+
/* Some pending properties to dump? */
- SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
+ SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props), TRUE, pool));
+
+ /* Some pending newlines to dump? */
+ SVN_ERR(dump_newlines(pb->eb, &(pb->eb->dump_newlines), pool));
/* This might be a replacement -- is the path already deleted? */
val = apr_hash_get(pb->deleted_entries, path, APR_HASH_KEY_STRING);
@@ -398,8 +465,13 @@ open_directory(const char *path,
const char *copyfrom_path = NULL;
svn_revnum_t copyfrom_rev = SVN_INVALID_REVNUM;
+ LDR_DBG(("open_directory %s\n", path));
+
/* Some pending properties to dump? */
- SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
+ SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props), TRUE, pool));
+
+ /* Some pending newlines to dump? */
+ SVN_ERR(dump_newlines(pb->eb, &(pb->eb->dump_newlines), pool));
/* If the parent directory has explicit comparison path and rev,
record the same for this one. */
@@ -423,14 +495,22 @@ close_directory(void *dir_baton,
{
struct dir_baton *db = dir_baton;
struct dump_edit_baton *eb = db->eb;
+ apr_pool_t *iterpool;
apr_hash_index_t *hi;
- apr_pool_t *iterpool = svn_pool_create(pool);
+
+ LDR_DBG(("close_directory %p\n", dir_baton));
/* Some pending properties to dump? */
- SVN_ERR(dump_props(eb, &(eb->dump_props_pending), TRUE, pool));
+ SVN_ERR(dump_props(eb, &(eb->dump_props), TRUE, pool));
+
+ /* Some pending newlines to dump? */
+ SVN_ERR(dump_newlines(eb, &(eb->dump_newlines), pool));
+
+ /* Create a pool just for iterations to allocate a loop variable */
+ iterpool = svn_pool_create(pool);
- /* Dump the directory entries */
- for (hi = apr_hash_first(pool, db->deleted_entries); hi;
+ /* Dump the deleted directory entries */
+ for (hi = apr_hash_first(iterpool, db->deleted_entries); hi;
hi = apr_hash_next(hi))
{
const void *key;
@@ -438,12 +518,11 @@ close_directory(void *dir_baton,
apr_hash_this(hi, &key, NULL, NULL);
path = key;
- svn_pool_clear(iterpool);
-
SVN_ERR(dump_node(db->eb, path, svn_node_unknown, svn_node_action_delete,
- FALSE, NULL, SVN_INVALID_REVNUM, iterpool));
+ FALSE, NULL, SVN_INVALID_REVNUM, pool));
}
+ svn_hash__clear(db->deleted_entries, pool);
svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
@@ -460,8 +539,13 @@ add_file(const char *path,
void *val;
svn_boolean_t is_copy;
+ LDR_DBG(("add_file %s\n", path));
+
/* Some pending properties to dump? */
- SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
+ SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props), TRUE, pool));
+
+ /* Some pending newlines to dump? */
+ SVN_ERR(dump_newlines(pb->eb, &(pb->eb->dump_newlines), pool));
/* This might be a replacement -- is the path already deleted? */
val = apr_hash_get(pb->deleted_entries, path, APR_HASH_KEY_STRING);
@@ -499,21 +583,21 @@ open_file(const char *path,
struct dir_baton *pb = parent_baton;
const char *copyfrom_path = NULL;
svn_revnum_t copyfrom_rev = SVN_INVALID_REVNUM;
- apr_array_header_t *compose_path;
+
+ LDR_DBG(("open_file %s\n", path));
/* Some pending properties to dump? */
- SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
+ SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props), TRUE, pool));
- compose_path = apr_array_make(pool, 2, sizeof(const char *));
+ /* Some pending newlines to dump? */
+ SVN_ERR(dump_newlines(pb->eb, &(pb->eb->dump_newlines), pool));
/* If the parent directory has explicit copyfrom path and rev,
record the same for this one. */
if (pb && ARE_VALID_COPY_ARGS(pb->copyfrom_path, pb->copyfrom_rev))
{
- APR_ARRAY_PUSH(compose_path, const char *) = pb->copyfrom_path;
- APR_ARRAY_PUSH(compose_path, const char *) =
- svn_relpath_basename(path, pool);
- copyfrom_path = svn_path_compose(compose_path, pool);
+ copyfrom_path = svn_relpath_join(pb->copyfrom_path,
+ svn_relpath_basename(path, pool), pool);
copyfrom_rev = pb->copyfrom_rev;
}
@@ -535,6 +619,8 @@ change_dir_prop(void *parent_baton,
{
struct dir_baton *db = parent_baton;
+ LDR_DBG(("change_dir_prop %p\n", parent_baton));
+
if (svn_property_kind(NULL, name) != svn_prop_regular_kind)
return SVN_NO_ERROR;
@@ -549,17 +635,21 @@ change_dir_prop(void *parent_baton,
{
/* If db->written_out is set, it means that the node information
corresponding to this directory has already been written: don't
- do anything; dump_props_pending will take care of dumping the
+ do anything; dump_props will take care of dumping the
props. If it not, dump the node itself before dumping the
props. */
SVN_ERR(dump_node(db->eb, db->abspath, svn_node_dir,
svn_node_action_change, FALSE, db->copyfrom_path,
db->copyfrom_rev, pool));
-
- SVN_ERR(dump_props(db->eb, NULL, TRUE, pool));
db->written_out = TRUE;
}
+
+ /* Dump props whether or not the directory has been written
+ out. Then disable printing a couple of extra newlines */
+ SVN_ERR(dump_props(db->eb, NULL, TRUE, pool));
+ db->eb->dump_newlines = FALSE;
+
return SVN_NO_ERROR;
}
@@ -571,6 +661,8 @@ change_file_prop(void *file_baton,
{
struct dump_edit_baton *eb = file_baton;
+ LDR_DBG(("change_file_prop %p\n", file_baton));
+
if (svn_property_kind(NULL, name) != svn_prop_regular_kind)
return SVN_NO_ERROR;
@@ -584,7 +676,7 @@ change_file_prop(void *file_baton,
/* Dump the property headers and wait; close_file might need
to write text headers too depending on whether
apply_textdelta is called */
- eb->dump_props_pending = TRUE;
+ eb->dump_props = TRUE;
return SVN_NO_ERROR;
}
@@ -625,6 +717,8 @@ apply_textdelta(void *file_baton, const
hb->pool = handler_pool;
hb->eb = eb;
+ LDR_DBG(("apply_textdelta %p\n", file_baton));
+
/* Use a temporary file to measure the text-content-length */
SVN_ERR(svn_stream_open_unique(&(hb->delta_filestream), &hb->delta_abspath,
NULL, svn_io_file_del_none, hb->pool,
@@ -655,11 +749,13 @@ close_file(void *file_baton,
svn_stream_t *delta_filestream;
apr_finfo_t *info = apr_pcalloc(pool, sizeof(apr_finfo_t));
- /* Some pending properties to dump? */
- SVN_ERR(dump_props(eb, &(eb->dump_props_pending), FALSE, pool));
+ LDR_DBG(("close_file %p\n", file_baton));
- /* The prop headers have already been dumped in dump_node; now dump
- the text headers. */
+ /* Some pending properties to dump? Dump just the headers- dump the
+ props only after dumping the text headers too (if present) */
+ SVN_ERR(dump_props(eb, &(eb->dump_props), FALSE, pool));
+
+ /* Dump the text headers */
if (eb->dump_text)
{
/* Text-delta: true */
@@ -691,7 +787,7 @@ close_file(void *file_baton,
/* Content-length: 1549 */
/* If both text and props are absent, skip this header */
- if (eb->dump_props || eb->dump_props_pending)
+ if (eb->dump_props)
SVN_ERR(svn_stream_printf(eb->stream, pool,
SVN_REPOS_DUMPFILE_CONTENT_LENGTH
": %ld\n\n",
@@ -702,15 +798,14 @@ close_file(void *file_baton,
": %ld\n\n",
(unsigned long)info->size));
- /* Dump the props; the propstring should have already been
- written in dump_node or above */
- if (eb->dump_props || eb->dump_props_pending)
+ /* Dump the props now */
+ if (eb->dump_props)
{
SVN_ERR(svn_stream_write(eb->stream, eb->propstring->data,
&(eb->propstring->len)));
/* Cleanup */
- eb->dump_props = eb->dump_props_pending = FALSE;
+ eb->dump_props = FALSE;
svn_hash__clear(eb->props, pool);
svn_hash__clear(eb->deleted_props, pool);
}
@@ -733,6 +828,8 @@ close_file(void *file_baton,
eb->dump_text = FALSE;
}
+ /* Write a couple of blank lines for matching output with `svnadmin
+ dump` */
SVN_ERR(svn_stream_printf(eb->stream, pool, "\n\n"));
return SVN_NO_ERROR;
@@ -742,6 +839,7 @@ static svn_error_t *
close_edit(void *edit_baton, apr_pool_t *pool)
{
struct dump_edit_baton *eb = edit_baton;
+ LDR_DBG(("close_edit\n"));
svn_pool_destroy(eb->pool);
return SVN_NO_ERROR;
Modified: subversion/branches/ignore-mergeinfo/subversion/svnrdump/dump_editor.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svnrdump/dump_editor.h?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svnrdump/dump_editor.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svnrdump/dump_editor.h Fri Dec 10 21:23:03 2010
@@ -87,4 +87,12 @@ get_dump_editor(const svn_delta_editor_t
svn_stream_t *stream,
apr_pool_t *pool);
+/**
+ * Normalize the line ending style of the values of properties in @a
+ * rev_props using @a pool for memory allocation.
+ */
+svn_error_t *
+normalize_props(apr_hash_t *props,
+ apr_pool_t *pool);
+
#endif
Modified: subversion/branches/ignore-mergeinfo/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svnrdump/load_editor.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svnrdump/load_editor.c Fri Dec 10 21:23:03 2010
@@ -30,9 +30,15 @@
#include "svn_path.h"
#include "svn_ra.h"
#include "svn_io.h"
+#include "svn_private_config.h"
+
+#include <apr_network_io.h>
#include "load_editor.h"
+#define SVNRDUMP_PROP_LOCK SVN_PROP_PREFIX "rdump-lock"
+#define LOCK_RETRIES 10
+
#ifdef SVN_DEBUG
#define LDR_DBG(x) SVN_DBG(x)
#else
@@ -44,11 +50,72 @@ commit_callback(const svn_commit_info_t
void *baton,
apr_pool_t *pool)
{
- SVN_ERR(svn_cmdline_printf(pool, "* Loaded revision %ld\n",
+ /* ### Don't print directly; generate a notification. */
+ SVN_ERR(svn_cmdline_printf(pool, "* Loaded revision %ld.\n",
commit_info->revision));
return SVN_NO_ERROR;
}
+/* Acquire a lock (of sorts) on the repository associated with the
+ * given RA SESSION. This lock is just a revprop change attempt in a
+ * time-delay loop. This function is duplicated by svnsync in main.c.
+ *
+ * ### TODO: Make this function more generic and
+ * expose it through a header for use by other Subversion
+ * applications to avoid duplication.
+ */
+static svn_error_t *
+get_lock(svn_ra_session_t *session, apr_pool_t *pool)
+{
+ char hostname_str[APRMAXHOSTLEN + 1] = { 0 };
+ svn_string_t *mylocktoken, *reposlocktoken;
+ apr_status_t apr_err;
+ apr_pool_t *subpool;
+ int i;
+
+ apr_err = apr_gethostname(hostname_str, sizeof(hostname_str), pool);
+ if (apr_err)
+ return svn_error_wrap_apr(apr_err, _("Can't get local hostname"));
+
+ mylocktoken = svn_string_createf(pool, "%s:%s", hostname_str,
+ svn_uuid_generate(pool));
+
+ subpool = svn_pool_create(pool);
+
+ for (i = 0; i < LOCK_RETRIES; ++i)
+ {
+ svn_pool_clear(subpool);
+
+ SVN_ERR(svn_ra_rev_prop(session, 0, SVNRDUMP_PROP_LOCK, &reposlocktoken,
+ subpool));
+
+ if (reposlocktoken)
+ {
+ /* Did we get it? If so, we're done, otherwise we sleep. */
+ if (strcmp(reposlocktoken->data, mylocktoken->data) == 0)
+ return SVN_NO_ERROR;
+ else
+ {
+ SVN_ERR(svn_cmdline_printf
+ (pool, _("Failed to get lock on destination "
+ "repos, currently held by '%s'\n"),
+ reposlocktoken->data));
+
+ apr_sleep(apr_time_from_sec(1));
+ }
+ }
+ else if (i < LOCK_RETRIES - 1)
+ {
+ /* Except in the very last iteration, try to set the lock. */
+ SVN_ERR(svn_ra_change_rev_prop(session, 0, SVNRDUMP_PROP_LOCK,
+ mylocktoken, subpool));
+ }
+ }
+
+ return svn_error_createf(APR_EINVAL, NULL,
+ _("Couldn't get lock on destination repos "
+ "after %d attempts"), i);
+}
static svn_error_t *
new_revision_record(void **revision_baton,
@@ -115,6 +182,7 @@ new_node_record(void **node_baton,
void *commit_edit_baton;
char *ancestor_path;
apr_array_header_t *residual_open_path;
+ char *relpath_compose;
const char *nb_dirname;
apr_size_t residual_close_count;
int i;
@@ -131,16 +199,20 @@ new_node_record(void **node_baton,
/* If the creation of commit_editor is pending, create it now and
open_root on it; also create a top-level directory baton. */
- if (!commit_editor) {
- if (rb->revprop_table)
- {
- /* Clear revprops that we aren't allowed to set with the commit */
- apr_hash_set(rb->revprop_table, SVN_PROP_REVISION_AUTHOR,
- APR_HASH_KEY_STRING, NULL);
- apr_hash_set(rb->revprop_table, SVN_PROP_REVISION_DATE,
- APR_HASH_KEY_STRING, NULL);
- }
+ if (!commit_editor)
+ {
+ /* The revprop_table should have been filled in with important
+ information like svn:log in set_revision_property. We can now
+ use it all this information to create our commit_editor. But
+ first, clear revprops that we aren't allowed to set with the
+ commit_editor. We'll set them separately using the RA API
+ after closing the editor (see close_revision). */
+
+ apr_hash_set(rb->revprop_table, SVN_PROP_REVISION_AUTHOR,
+ APR_HASH_KEY_STRING, NULL);
+ apr_hash_set(rb->revprop_table, SVN_PROP_REVISION_DATE,
+ APR_HASH_KEY_STRING, NULL);
SVN_ERR(svn_ra_get_commit_editor3(rb->pb->session, &commit_editor,
&commit_edit_baton, rb->revprop_table,
@@ -162,7 +234,7 @@ new_node_record(void **node_baton,
child_db->relpath = svn_relpath_canonicalize("/", rb->pool);
child_db->parent = NULL;
rb->db = child_db;
- }
+ }
for (hi = apr_hash_first(rb->pool, headers); hi; hi = apr_hash_next(hi))
{
@@ -233,8 +305,11 @@ new_node_record(void **node_baton,
for (i = 0; i < residual_open_path->nelts; i ++)
{
- SVN_ERR(commit_editor->open_directory(APR_ARRAY_IDX(residual_open_path,
- i, const char *),
+ relpath_compose =
+ svn_relpath_join(rb->db->relpath,
+ APR_ARRAY_IDX(residual_open_path, i, const char *),
+ rb->pool);
+ SVN_ERR(commit_editor->open_directory(relpath_compose,
rb->db->baton,
rb->rev - 1,
rb->pool, &child_baton));
@@ -242,10 +317,7 @@ new_node_record(void **node_baton,
child_db = apr_pcalloc(rb->pool, sizeof(*child_db));
child_db->baton = child_baton;
child_db->depth = rb->db->depth + 1;
- child_db->relpath = svn_relpath_join(rb->db->relpath,
- APR_ARRAY_IDX(residual_open_path,
- i, const char *),
- rb->pool);
+ child_db->relpath = relpath_compose;
child_db->parent = rb->db;
rb->db = child_db;
}
@@ -348,14 +420,21 @@ set_node_property(void *baton,
commit_editor = nb->rb->pb->commit_editor;
pool = nb->rb->pool;
- LDR_DBG(("Applying properties on %p\n", nb->file_baton));
- if (nb->kind == svn_node_file)
- SVN_ERR(commit_editor->change_file_prop(nb->file_baton, name,
- value, pool));
- else
- SVN_ERR(commit_editor->change_dir_prop(nb->rb->db->baton, name,
- value, pool));
-
+ switch (nb->kind)
+ {
+ case svn_node_file:
+ LDR_DBG(("Applying properties on %p\n", nb->file_baton));
+ SVN_ERR(commit_editor->change_file_prop(nb->file_baton, name,
+ value, pool));
+ break;
+ case svn_node_dir:
+ LDR_DBG(("Applying properties on %p\n", nb->rb->db->baton));
+ SVN_ERR(commit_editor->change_dir_prop(nb->rb->db->baton, name,
+ value, pool));
+ break;
+ default:
+ break;
+ }
return SVN_NO_ERROR;
}
@@ -448,7 +527,8 @@ close_revision(void *baton)
/* Fake revision 0 */
if (rb->rev == 0)
- SVN_ERR(svn_cmdline_printf(rb->pool, "* Loaded revision 0\n"));
+ /* ### Don't print directly; generate a notification. */
+ SVN_ERR(svn_cmdline_printf(rb->pool, "* Loaded revision 0.\n"));
else if (commit_editor)
{
/* Close all pending open directories, and then close the edit
@@ -533,9 +613,11 @@ drive_dumpstream_loader(svn_stream_t *st
struct parse_baton *pb;
pb = parse_baton;
+ SVN_ERR(get_lock(session, pool));
SVN_ERR(svn_ra_get_repos_root2(session, &(pb->root_url), pool));
SVN_ERR(svn_repos_parse_dumpstream2(stream, parser, parse_baton,
NULL, NULL, pool));
+ SVN_ERR(svn_ra_change_rev_prop(session, 0, SVNRDUMP_PROP_LOCK, NULL, pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/ignore-mergeinfo/subversion/svnrdump/svnrdump.1
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svnrdump/svnrdump.1?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svnrdump/svnrdump.1 (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svnrdump/svnrdump.1 Fri Dec 10 21:23:03 2010
@@ -23,10 +23,10 @@
.\"
.TH svnrdump 1
.SH NAME
-svnrdump \- Subversion repository synchronization tool
+svnrdump \- Subversion remote repository dumper and loader
.SH SYNOPSIS
.TP
-\fBsvnrdump\fP \fIcommand\fP \fIdest-url\fP [\fIoptions\fP] [\fIargs\fP]
+\fBsvnrdump\fP \fIcommand\fP \fIurl\fP [\fIoptions\fP] [\fIargs\fP]
.SH OVERVIEW
Subversion is a version control system, which allows you to keep old
versions of files and directories (usually source code), keep a log of
Modified: subversion/branches/ignore-mergeinfo/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svnrdump/svnrdump.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svnrdump/svnrdump.c Fri Dec 10 21:23:03 2010
@@ -54,18 +54,16 @@ enum svn_svnrdump__longopt_t
static const svn_opt_subcommand_desc2_t svnrdump__cmd_table[] =
{
- { "dump", dump_cmd, { "d" },
+ { "dump", dump_cmd, { 0 },
N_("usage: svnrdump dump URL [-r LOWER[:UPPER]]\n\n"
"Dump revisions LOWER to UPPER of repository at remote URL "
"to stdout in a 'dumpfile' portable format.\n"
- "If omitted, LOWER defaults to zero and UPPER to the latest "
- "latest revision.\n"),
+ "If only LOWER is given, dump that one revision.\n"),
{ 0 } },
- { "load", load_cmd, { "l" },
+ { "load", load_cmd, { 0 },
N_("usage: svnrdump load URL\n\n"
"Load a 'dumpfile' given on stdin to a repository "
- "at remote URL.\n"
- "## This feature is not yet available.\n"),
+ "at remote URL.\n"),
{ 0 } },
{ "help", 0, { "?", "h" },
N_("usage: svnrdump help [SUBCOMMAND...]\n\n"
@@ -76,7 +74,7 @@ static const svn_opt_subcommand_desc2_t
static const apr_getopt_option_t svnrdump__options[] =
{
- {"revision", 'r', 1, N_("REV1[:REV2] range of revisions to dump")},
+ {"revision", 'r', 1, N_("specify revision number ARG (or X:Y range)")},
{"quiet", 'q', 0, N_("no progress (only errors) to stderr")},
{"config-dir", opt_config_dir, 1, N_("read user configuration files from"
" directory ARG") },
@@ -139,6 +137,7 @@ replay_revstart(svn_revnum_t revision,
SVN_ERR(svn_stream_printf(stdout_stream, pool,
SVN_REPOS_DUMPFILE_REVISION_NUMBER
": %ld\n", revision));
+ SVN_ERR(normalize_props(rev_props, pool));
propstring = svn_stringbuf_create_ensure(0, pool);
revprop_stream = svn_stream_from_stringbuf(propstring, pool);
SVN_ERR(svn_hash_write2(rev_props, revprop_stream, "PROPS-END", pool));
@@ -180,7 +179,7 @@ replay_revend(svn_revnum_t revision,
/* No resources left to free. */
struct replay_baton *rb = replay_baton;
if (! rb->quiet)
- svn_cmdline_fprintf(stderr, pool, "* Dumped revision %lu\n", revision);
+ svn_cmdline_fprintf(stderr, pool, "* Dumped revision %lu.\n", revision);
return SVN_NO_ERROR;
}
@@ -289,7 +288,7 @@ replay_revisions(svn_ra_session_t *sessi
&(propstring->len)));
SVN_ERR(svn_stream_printf(stdout_stream, pool, "\n"));
if (! quiet)
- svn_cmdline_fprintf(stderr, pool, "* Dumped revision %lu\n", start_revision);
+ svn_cmdline_fprintf(stderr, pool, "* Dumped revision %lu.\n", start_revision);
start_revision++;
}
@@ -472,7 +471,10 @@ main(int argc, const char **argv)
NULL, 10);
}
else
- opt_baton->start_revision = (svn_revnum_t)strtoul(opt_arg, NULL, 10);
+ {
+ opt_baton->start_revision = (svn_revnum_t)strtoul(opt_arg, NULL, 10);
+ opt_baton->end_revision = opt_baton->start_revision;
+ }
}
break;
case 'q':
Modified: subversion/branches/ignore-mergeinfo/subversion/svnserve/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svnserve/cyrus_auth.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svnserve/cyrus_auth.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svnserve/cyrus_auth.c Fri Dec 10 21:23:03 2010
@@ -297,13 +297,13 @@ svn_error_t *cyrus_auth_request(svn_ra_s
SVN_CONFIG_SECTION_SASL,
SVN_CONFIG_OPTION_MIN_SSF,
"0");
- secprops.min_ssf = atoi(val);
+ SVN_ERR(svn_cstring_atoui(&secprops.min_ssf, val));
svn_config_get(b->cfg, &val,
SVN_CONFIG_SECTION_SASL,
SVN_CONFIG_OPTION_MAX_SSF,
"256");
- secprops.max_ssf = atoi(val);
+ SVN_ERR(svn_cstring_atoui(&secprops.max_ssf, val));
/* Set security properties. */
result = sasl_setprop(sasl_ctx, SASL_SEC_PROPS, &secprops);
@@ -361,7 +361,7 @@ svn_error_t *cyrus_auth_request(svn_ra_s
if ((p = strchr(user, '@')) != NULL)
/* Drop the realm part. */
- b->user = apr_pstrndup(b->pool, user, p - (char *)user);
+ b->user = apr_pstrndup(b->pool, user, p - (const char *)user);
else
{
svn_error_t *err;
Modified: subversion/branches/ignore-mergeinfo/subversion/svnserve/log-escape.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svnserve/log-escape.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svnserve/log-escape.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svnserve/log-escape.c Fri Dec 10 21:23:03 2010
@@ -40,10 +40,10 @@
#include <apr.h>
-#include <apr_lib.h>
#define APR_WANT_STRFUNC
#include <apr_want.h>
#include "server.h"
+#include "svn_ctype.h"
/* copied from httpd-2.2.4/server/util.c */
/* c2x takes an unsigned, and expects the caller has guaranteed that
@@ -93,7 +93,9 @@ apr_size_t escape_errorlog_item(char *de
which does this same check with a fast lookup table. Well,
mostly the same; we don't escape quotes, as that does.
*/
- if (*s && (!apr_isprint(*s) || *s == '\\' || apr_iscntrl(*s))) {
+ if (*s && ( !svn_ctype_isprint(*s)
+ || *s == '\\'
+ || svn_ctype_iscntrl(*s))) {
*d++ = '\\';
if (d >= ep) {
--d;
Modified: subversion/branches/ignore-mergeinfo/subversion/svnserve/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svnserve/main.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svnserve/main.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svnserve/main.c Fri Dec 10 21:23:03 2010
@@ -44,11 +44,13 @@
#include "svn_path.h"
#include "svn_opt.h"
#include "svn_repos.h"
+#include "svn_string.h"
#include "svn_fs.h"
#include "svn_version.h"
#include "svn_io.h"
#include "svn_private_config.h"
+#include "private/svn_dep_compat.h"
#include "winservice.h"
#ifdef HAVE_UNISTD_H
@@ -473,7 +475,17 @@ int main(int argc, const char *argv[])
break;
case SVNSERVE_OPT_LISTEN_PORT:
- port = atoi(arg);
+ {
+ apr_uint64_t val;
+
+ err = svn_cstring_strtoui64(&val, arg, 0, APR_UINT16_MAX, 10);
+ if (err)
+ return svn_cmdline_handle_exit_error(
+ svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err,
+ _("Invalid port '%s'"), arg),
+ pool, "svnserve: ");
+ port = (apr_uint16_t)val;
+ }
break;
case SVNSERVE_OPT_LISTEN_HOST:
Modified: subversion/branches/ignore-mergeinfo/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svnserve/serve.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svnserve/serve.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svnserve/serve.c Fri Dec 10 21:23:03 2010
@@ -1452,6 +1452,14 @@ static svn_error_t *get_dir(svn_ra_svn_c
svn_pool_clear(subpool);
file_path = svn_uri_join(full_path, name, subpool);
+
+ if (! lookup_access(subpool, b, conn, svn_authz_read,
+ file_path, FALSE))
+ {
+ apr_hash_set(entries, name, APR_HASH_KEY_STRING, NULL);
+ continue;
+ }
+
entry = apr_pcalloc(pool, sizeof(*entry));
if (dirent_fields & SVN_DIRENT_KIND)
Modified: subversion/branches/ignore-mergeinfo/subversion/svnsync/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/svnsync/main.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/svnsync/main.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/svnsync/main.c Fri Dec 10 21:23:03 2010
@@ -284,8 +284,31 @@ check_lib_versions(void)
}
+/* Remove the lock on SESSION iff the lock is owned by MYLOCKTOKEN. */
+static svn_error_t *
+maybe_unlock(svn_ra_session_t *session,
+ const svn_string_t *mylocktoken,
+ apr_pool_t *scratch_pool)
+{
+ svn_string_t *reposlocktoken;
+
+ SVN_ERR(svn_ra_rev_prop(session, 0, SVNSYNC_PROP_LOCK, &reposlocktoken,
+ scratch_pool));
+ if (reposlocktoken && strcmp(reposlocktoken->data, mylocktoken->data) == 0)
+ SVN_ERR(svn_ra_change_rev_prop(session, 0, SVNSYNC_PROP_LOCK, NULL,
+ scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
/* Acquire a lock (of sorts) on the repository associated with the
- * given RA SESSION.
+ * given RA SESSION. This lock is just a revprop change attempt in a
+ * time-delay loop. This function is duplicated by svnrdump in
+ * load_editor.c.
+ *
+ * ### TODO: Make this function more generic and
+ * expose it through a header for use by other Subversion
+ * applications to avoid duplication.
*/
static svn_error_t *
get_lock(svn_ra_session_t *session, apr_pool_t *pool)
@@ -308,12 +331,21 @@ get_lock(svn_ra_session_t *session, apr_
#define SVNSYNC_LOCK_RETRIES 10
for (i = 0; i < SVNSYNC_LOCK_RETRIES; ++i)
{
+ svn_error_t *err;
+
svn_pool_clear(subpool);
- SVN_ERR(check_cancel(NULL));
+
+ /* If we're cancelled, don't leave a stray lock behind. */
+ err = check_cancel(NULL);
+ if (err && err->apr_err == SVN_ERR_CANCELLED)
+ return svn_error_compose_create(
+ maybe_unlock(session, mylocktoken, subpool),
+ err);
+ else
+ SVN_ERR(err);
SVN_ERR(svn_ra_rev_prop(session, 0, SVNSYNC_PROP_LOCK, &reposlocktoken,
subpool));
-
if (reposlocktoken)
{
/* Did we get it? If so, we're done, otherwise we sleep. */
@@ -709,7 +741,7 @@ do_initialize(svn_ra_session_t *to_sessi
/* Now fill in our bookkeeping info in the dest repository. */
- SVN_ERR(svn_ra_open3(&from_session, baton->from_url, NULL,
+ SVN_ERR(svn_ra_open4(&from_session, NULL, baton->from_url, NULL,
&(baton->source_callbacks), baton,
baton->config, pool));
SVN_ERR(svn_ra_get_repos_root2(from_session, &root_url, pool));
@@ -723,14 +755,11 @@ do_initialize(svn_ra_session_t *to_sessi
&server_supports_partial_replay,
SVN_RA_CAPABILITY_PARTIAL_REPLAY,
pool);
- if (err && err->apr_err == SVN_ERR_UNKNOWN_CAPABILITY)
- {
- svn_error_clear(err);
- server_supports_partial_replay = FALSE;
- }
+ if (err && err->apr_err != SVN_ERR_UNKNOWN_CAPABILITY)
+ return svn_error_return(err);
- if (!server_supports_partial_replay)
- return svn_error_create(SVN_ERR_RA_PARTIAL_REPLAY_NOT_SUPPORTED, NULL,
+ if (err || !server_supports_partial_replay)
+ return svn_error_create(SVN_ERR_RA_PARTIAL_REPLAY_NOT_SUPPORTED, err,
NULL);
}
@@ -812,7 +841,7 @@ initialize_cmd(apr_getopt_t *os, void *b
_("Path '%s' is not a URL"), from_url);
baton = make_subcommand_baton(opt_baton, to_url, from_url, 0, 0, pool);
- SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
+ SVN_ERR(svn_ra_open4(&to_session, NULL, baton->to_url, NULL,
&(baton->sync_callbacks), baton, baton->config, pool));
SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url, pool));
if (opt_baton->disable_locking)
@@ -888,7 +917,7 @@ open_source_session(svn_ra_session_t **f
from_url = from_url_str->data;
/* Open the session to copy the revision data. */
- SVN_ERR(svn_ra_open3(from_session, from_url, from_uuid_str->data,
+ SVN_ERR(svn_ra_open4(from_session, NULL, from_url, from_uuid_str->data,
callbacks, baton, config, pool));
return SVN_NO_ERROR;
@@ -1312,7 +1341,7 @@ synchronize_cmd(apr_getopt_t *os, void *
}
baton = make_subcommand_baton(opt_baton, to_url, from_url, 0, 0, pool);
- SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
+ SVN_ERR(svn_ra_open4(&to_session, NULL, baton->to_url, NULL,
&(baton->sync_callbacks), baton, baton->config, pool));
SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url, pool));
if (opt_baton->disable_locking)
@@ -1548,7 +1577,7 @@ copy_revprops_cmd(apr_getopt_t *os, void
baton = make_subcommand_baton(opt_baton, to_url, from_url,
start_rev, end_rev, pool);
- SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
+ SVN_ERR(svn_ra_open4(&to_session, NULL, baton->to_url, NULL,
&(baton->sync_callbacks), baton, baton->config, pool));
SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url, pool));
if (opt_baton->disable_locking)
@@ -1592,7 +1621,7 @@ info_cmd(apr_getopt_t *os, void *b, apr_
/* Open an RA session to the mirror repository URL. */
baton = make_subcommand_baton(opt_baton, to_url, NULL, 0, 0, pool);
- SVN_ERR(svn_ra_open3(&to_session, baton->to_url, NULL,
+ SVN_ERR(svn_ra_open4(&to_session, NULL, baton->to_url, NULL,
&(baton->sync_callbacks), baton, baton->config, pool));
SVN_ERR(check_if_session_is_at_repos_root(to_session, baton->to_url, pool));
Modified: subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/authz_tests.py?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/authz_tests.py (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/authz_tests.py Fri Dec 10 21:23:03 2010
@@ -37,6 +37,7 @@ from svntest.main import server_authz_ha
# (abbreviation)
Item = svntest.wc.StateItem
XFail = svntest.testcase.XFail
+Wimp = svntest.testcase.Wimp
Skip = svntest.testcase.Skip
SkipUnless = svntest.testcase.SkipUnless
@@ -1021,6 +1022,43 @@ def wc_wc_copy_revert(sbox):
svntest.actions.run_and_verify_svn(None, None, [],
'revert', '--recursive', sbox.ospath('A2'))
+ expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+ expected_status.remove('A/B/E', 'A/B/E/alpha', 'A/B/E/beta')
+ svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
+def authz_recursive_ls(sbox):
+ "recursive ls with private subtrees"
+
+ sbox.build(create_wc = False)
+ local_dir = sbox.wc_dir
+ write_restrictive_svnserve_conf(sbox.repo_dir)
+
+ write_authz_file(sbox, {'/' : '* = r',
+ '/A/B/E' : '* =',
+ '/A/mu' : '* =',
+ })
+ expected_entries = [
+ 'A/',
+ 'A/B/',
+ 'A/B/F/',
+ 'A/B/lambda',
+ 'A/C/',
+ 'A/D/',
+ 'A/D/G/',
+ 'A/D/G/pi',
+ 'A/D/G/rho',
+ 'A/D/G/tau',
+ 'A/D/H/',
+ 'A/D/H/chi',
+ 'A/D/H/omega',
+ 'A/D/H/psi',
+ 'A/D/gamma',
+ 'iota',
+ ]
+ svntest.actions.run_and_verify_svn('recursive ls from /',
+ map(lambda x: x + '\n', expected_entries),
+ [], 'ls', '-R',
+ sbox.repo_url)
########################################################################
# Run the tests
@@ -1051,7 +1089,10 @@ test_list = [ None,
svntest.main.is_ra_type_file),
Skip(multiple_matches, svntest.main.is_ra_type_file),
Skip(wc_wc_copy, svntest.main.is_ra_type_file),
- XFail(Skip(wc_wc_copy_revert, svntest.main.is_ra_type_file)),
+ Skip(wc_wc_copy_revert,
+ svntest.main.is_ra_type_file),
+ Skip(authz_recursive_ls,
+ svntest.main.is_ra_type_file),
]
if __name__ == '__main__':
Modified: subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/basic_tests.py?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/cmdline/basic_tests.py Fri Dec 10 21:23:03 2010
@@ -2573,7 +2573,7 @@ test_list = [ None,
basic_switch,
basic_delete,
basic_checkout_deleted,
- Wimp('Needs single-db', basic_node_kind_change),
+ basic_node_kind_change,
basic_import,
basic_cat,
basic_ls,