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 2012/05/16 22:32:54 UTC
svn commit: r1339349 [27/37] - in /subversion/branches/fix-rdump-editor: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
build/win32/ contrib/client-side/emacs/ contrib/client-side/vim/
contrib/server-side/ notes/ notes/api-errat...
Modified: subversion/branches/fix-rdump-editor/subversion/po/ja.po
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/po/ja.po?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/po/ja.po [UTF-8] (original)
+++ subversion/branches/fix-rdump-editor/subversion/po/ja.po [UTF-8] Wed May 16 20:32:43 2012
@@ -6235,7 +6235,7 @@ msgstr ""
#. Human explanatory part, generated by apr_strftime as "Sat, 01 Jan 2000"
#: ../libsvn_subr/time.c:85
msgid " (%a, %d %b %Y)"
-msgstr " (%a, %d %b %Y)"
+msgstr " (%x (%a))"
#: ../libsvn_subr/token.c:66
#, fuzzy, c-format
Modified: subversion/branches/fix-rdump-editor/subversion/svn/blame-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svn/blame-cmd.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svn/blame-cmd.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svn/blame-cmd.c Wed May 16 20:32:43 2012
@@ -203,11 +203,11 @@ blame_receiver(void *baton,
we may need to adjust this. */
if (merged_revision < revision)
{
- SVN_ERR(svn_stream_printf(out, pool, "G "));
+ SVN_ERR(svn_stream_puts(out, "G "));
use_merged = TRUE;
}
else
- SVN_ERR(svn_stream_printf(out, pool, " "));
+ SVN_ERR(svn_stream_puts(out, " "));
}
if (use_merged)
Modified: subversion/branches/fix-rdump-editor/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svn/cl.h?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svn/cl.h (original)
+++ subversion/branches/fix-rdump-editor/subversion/svn/cl.h Wed May 16 20:32:43 2012
@@ -184,7 +184,7 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t no_ignore; /* disregard default ignores & svn:ignore's */
svn_boolean_t no_auth_cache; /* do not cache authentication information */
svn_boolean_t no_diff_deleted; /* do not show diffs for deleted files */
- svn_boolean_t ignore_props; /* ignore properties */
+ svn_boolean_t ignore_properties; /* ignore properties */
svn_boolean_t show_copies_as_adds; /* do not diff copies with their source */
svn_boolean_t notice_ancestry; /* notice ancestry for diff-y operations */
svn_boolean_t ignore_ancestry; /* ignore ancestry for merge-y operations */
@@ -196,6 +196,7 @@ typedef struct svn_cl__opt_state_t
const char *merge_cmd; /* the external merge command to use */
const char *editor_cmd; /* the external editor command to use */
svn_boolean_t record_only; /* whether to record mergeinfo */
+ svn_boolean_t symmetric_merge; /* symmetric merge */
const char *old_target; /* diff target */
const char *new_target; /* diff target */
svn_boolean_t relocate; /* rewrite urls (svn switch) */
@@ -230,9 +231,10 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t show_diff; /* produce diff output (maps to --diff) */
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 use_patch_diff_format; /* Output compatible with GNU patch */
+ svn_boolean_t patch_compatible; /* Output compatible with GNU patch */
svn_boolean_t allow_mixed_rev; /* Allow operation on mixed-revision WC */
svn_boolean_t include_externals; /* Recurses (in)to file & dir externals */
+ svn_boolean_t properties_only; /* Show properties only */
} svn_cl__opt_state_t;
@@ -331,13 +333,15 @@ typedef struct svn_cl__conflict_baton_t
const char *editor_cmd;
svn_boolean_t external_failed;
svn_cmdline_prompt_baton_t *pb;
+ const char *path_prefix;
} svn_cl__conflict_baton_t;
-/* Create and return a conflict baton, allocated from POOL, with the values
- ACCEPT_WHICH, CONFIG, EDITOR_CMD and PB placed in the same-named fields
- of the baton, and its 'external_failed' field initialised to FALSE. */
-svn_cl__conflict_baton_t *
-svn_cl__conflict_baton_make(svn_cl__accept_t accept_which,
+/* Create and return a conflict baton in *B, allocated from POOL, with the
+ * values ACCEPT_WHICH, CONFIG, EDITOR_CMD and PB placed in the same-named
+ * fields of the baton, and its 'external_failed' field initialised to FALSE. */
+svn_error_t *
+svn_cl__conflict_baton_make(svn_cl__conflict_baton_t **b,
+ svn_cl__accept_t accept_which,
apr_hash_t *config,
const char *editor_cmd,
svn_cmdline_prompt_baton_t *pb,
@@ -349,9 +353,10 @@ svn_cl__conflict_baton_make(svn_cl__acce
Implements @c svn_wc_conflict_resolver_func_t. */
svn_error_t *
svn_cl__conflict_handler(svn_wc_conflict_result_t **result,
- const svn_wc_conflict_description_t *desc,
+ const svn_wc_conflict_description2_t *desc,
void *baton,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
Modified: subversion/branches/fix-rdump-editor/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svn/conflict-callbacks.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svn/conflict-callbacks.c Wed May 16 20:32:43 2012
@@ -30,30 +30,34 @@
#include "svn_cmdline.h"
#include "svn_client.h"
+#include "svn_dirent_uri.h"
#include "svn_types.h"
#include "svn_pools.h"
#include "cl.h"
+#include "tree-conflicts.h"
#include "svn_private_config.h"
-svn_cl__conflict_baton_t *
-svn_cl__conflict_baton_make(svn_cl__accept_t accept_which,
+svn_error_t *
+svn_cl__conflict_baton_make(svn_cl__conflict_baton_t **b,
+ svn_cl__accept_t accept_which,
apr_hash_t *config,
const char *editor_cmd,
svn_cmdline_prompt_baton_t *pb,
apr_pool_t *pool)
{
- svn_cl__conflict_baton_t *b = apr_palloc(pool, sizeof(*b));
- b->accept_which = accept_which;
- b->config = config;
- b->editor_cmd = editor_cmd;
- b->external_failed = FALSE;
- b->pb = pb;
- return b;
+ *b = apr_palloc(pool, sizeof(**b));
+ (*b)->accept_which = accept_which;
+ (*b)->config = config;
+ (*b)->editor_cmd = editor_cmd;
+ (*b)->external_failed = FALSE;
+ (*b)->pb = pb;
+ SVN_ERR(svn_dirent_get_absolute(&(*b)->path_prefix, "", pool));
+ return SVN_NO_ERROR;
}
svn_cl__accept_t
@@ -95,7 +99,7 @@ svn_cl__accept_from_word(const char *wor
/* Print on stdout a diff between the 'base' and 'merged' files, if both of
* those are available, else between 'their' and 'my' files, of DESC. */
static svn_error_t *
-show_diff(const svn_wc_conflict_description_t *desc,
+show_diff(const svn_wc_conflict_description2_t *desc,
apr_pool_t *pool)
{
const char *path1, *path2;
@@ -103,18 +107,18 @@ show_diff(const svn_wc_conflict_descript
svn_stream_t *output;
svn_diff_file_options_t *options;
- if (desc->merged_file && desc->base_file)
+ if (desc->merged_file && desc->base_abspath)
{
/* Show the conflict markers to the user */
- path1 = desc->base_file;
+ path1 = desc->base_abspath;
path2 = desc->merged_file;
}
else
{
/* There's no base file, but we can show the
difference between mine and theirs. */
- path1 = desc->their_file;
- path2 = desc->my_file;
+ path1 = desc->their_abspath;
+ path2 = desc->my_abspath;
}
options = svn_diff_file_options_create(pool);
@@ -134,7 +138,7 @@ show_diff(const svn_wc_conflict_descript
/* Print on stdout just the conflict hunks of a diff among the 'base', 'their'
* and 'my' files of DESC. */
static svn_error_t *
-show_conflicts(const svn_wc_conflict_description_t *desc,
+show_conflicts(const svn_wc_conflict_description2_t *desc,
apr_pool_t *pool)
{
svn_diff_t *diff;
@@ -145,16 +149,16 @@ show_conflicts(const svn_wc_conflict_des
options->ignore_eol_style = TRUE;
SVN_ERR(svn_stream_for_stdout(&output, pool));
SVN_ERR(svn_diff_file_diff3_2(&diff,
- desc->base_file,
- desc->my_file,
- desc->their_file,
+ desc->base_abspath,
+ desc->my_abspath,
+ desc->their_abspath,
options, pool));
/* ### Consider putting the markers/labels from
### svn_wc__merge_internal in the conflict description. */
return svn_diff_file_output_merge2(output, diff,
- desc->base_file,
- desc->my_file,
- desc->their_file,
+ desc->base_abspath,
+ desc->my_abspath,
+ desc->their_abspath,
_("||||||| ORIGINAL"),
_("<<<<<<< MINE (select with 'mc')"),
_(">>>>>>> THEIRS (select with 'tc')"),
@@ -175,7 +179,7 @@ show_conflicts(const svn_wc_conflict_des
* return that error. */
static svn_error_t *
open_editor(svn_boolean_t *performed_edit,
- const svn_wc_conflict_description_t *desc,
+ const svn_wc_conflict_description2_t *desc,
svn_cl__conflict_baton_t *b,
apr_pool_t *pool)
{
@@ -223,15 +227,16 @@ open_editor(svn_boolean_t *performed_edi
* return that error. */
static svn_error_t *
launch_resolver(svn_boolean_t *performed_edit,
- const svn_wc_conflict_description_t *desc,
+ const svn_wc_conflict_description2_t *desc,
svn_cl__conflict_baton_t *b,
apr_pool_t *pool)
{
svn_error_t *err;
- err = svn_cl__merge_file_externally(desc->base_file, desc->their_file,
- desc->my_file, desc->merged_file,
- desc->path, b->config, NULL, pool);
+ err = svn_cl__merge_file_externally(desc->base_abspath, desc->their_abspath,
+ desc->my_abspath, desc->merged_file,
+ desc->local_abspath, b->config, NULL,
+ pool);
if (err && err->apr_err == SVN_ERR_CL_NO_EXTERNAL_MERGE_TOOL)
{
SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
@@ -255,13 +260,14 @@ launch_resolver(svn_boolean_t *performed
}
-/* Implement svn_wc_conflict_resolver_func_t; resolves based on
+/* Implement svn_wc_conflict_resolver_func2_t; resolves based on
--accept option if given, else by prompting. */
svn_error_t *
svn_cl__conflict_handler(svn_wc_conflict_result_t **result,
- const svn_wc_conflict_description_t *desc,
+ const svn_wc_conflict_description2_t *desc,
void *baton,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_cl__conflict_baton_t *b = baton;
svn_error_t *err;
@@ -269,7 +275,7 @@ svn_cl__conflict_handler(svn_wc_conflict
/* Start out assuming we're going to postpone the conflict. */
*result = svn_wc_create_conflict_result(svn_wc_conflict_choose_postpone,
- NULL, pool);
+ NULL, result_pool);
switch (b->accept_which)
{
@@ -308,10 +314,11 @@ svn_cl__conflict_handler(svn_wc_conflict
}
err = svn_cl__edit_file_externally(desc->merged_file,
- b->editor_cmd, b->config, pool);
+ b->editor_cmd, b->config,
+ scratch_pool);
if (err && (err->apr_err == SVN_ERR_CL_NO_EXTERNAL_EDITOR))
{
- SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "%s\n",
err->message ? err->message :
_("No editor found;"
" leaving all conflicts.")));
@@ -320,7 +327,7 @@ svn_cl__conflict_handler(svn_wc_conflict
}
else if (err && (err->apr_err == SVN_ERR_EXTERNAL_PROGRAM))
{
- SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "%s\n",
err->message ? err->message :
_("Error running editor;"
" leaving all conflicts.")));
@@ -335,8 +342,8 @@ svn_cl__conflict_handler(svn_wc_conflict
/* else, fall through to prompting. */
break;
case svn_cl__accept_launch:
- if (desc->base_file && desc->their_file
- && desc->my_file && desc->merged_file)
+ if (desc->base_abspath && desc->their_abspath
+ && desc->my_abspath && desc->merged_file)
{
svn_boolean_t remains_in_conflict;
@@ -346,17 +353,17 @@ svn_cl__conflict_handler(svn_wc_conflict
return SVN_NO_ERROR;
}
- err = svn_cl__merge_file_externally(desc->base_file,
- desc->their_file,
- desc->my_file,
+ err = svn_cl__merge_file_externally(desc->base_abspath,
+ desc->their_abspath,
+ desc->my_abspath,
desc->merged_file,
- desc->path,
+ desc->local_abspath,
b->config,
&remains_in_conflict,
- pool);
+ scratch_pool);
if (err && err->apr_err == SVN_ERR_CL_NO_EXTERNAL_MERGE_TOOL)
{
- SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "%s\n",
err->message ? err->message :
_("No merge tool found;"
" leaving all conflicts.")));
@@ -365,7 +372,7 @@ svn_cl__conflict_handler(svn_wc_conflict
}
else if (err && err->apr_err == SVN_ERR_EXTERNAL_PROGRAM)
{
- SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "%s\n",
err->message ? err->message :
_("Error running merge tool;"
" leaving all conflicts.")));
@@ -387,7 +394,7 @@ svn_cl__conflict_handler(svn_wc_conflict
/* We're in interactive mode and either the user gave no --accept
option or the option did not apply; let's prompt. */
- subpool = svn_pool_create(pool);
+ subpool = svn_pool_create(scratch_pool);
/* Handle the most common cases, which is either:
@@ -411,26 +418,31 @@ svn_cl__conflict_handler(svn_wc_conflict
if (desc->kind == svn_wc_conflict_kind_text)
SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Conflict discovered in '%s'.\n"),
- desc->path));
+ _("Conflict discovered in file '%s'.\n"),
+ svn_cl__local_style_skip_ancestor(
+ b->path_prefix, desc->local_abspath,
+ subpool)));
else if (desc->kind == svn_wc_conflict_kind_property)
{
SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
_("Conflict for property '%s' discovered"
" on '%s'.\n"),
- desc->property_name, desc->path));
+ desc->property_name,
+ svn_cl__local_style_skip_ancestor(
+ b->path_prefix, desc->local_abspath,
+ subpool)));
- if ((!desc->my_file && desc->their_file)
- || (desc->my_file && !desc->their_file))
+ if ((!desc->my_abspath && desc->their_abspath)
+ || (desc->my_abspath && !desc->their_abspath))
{
/* One agent wants to change the property, one wants to
delete it. This is not something we can diff, so we
just tell the user. */
svn_stringbuf_t *myval = NULL, *theirval = NULL;
- if (desc->my_file)
+ if (desc->my_abspath)
{
- SVN_ERR(svn_stringbuf_from_file2(&myval, desc->my_file,
+ SVN_ERR(svn_stringbuf_from_file2(&myval, desc->my_abspath,
subpool));
SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
_("They want to delete the property, "
@@ -439,7 +451,8 @@ svn_cl__conflict_handler(svn_wc_conflict
}
else
{
- SVN_ERR(svn_stringbuf_from_file2(&theirval, desc->their_file,
+ SVN_ERR(svn_stringbuf_from_file2(&theirval,
+ desc->their_abspath,
subpool));
SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
_("They want to change the property value to '%s', "
@@ -456,8 +469,8 @@ svn_cl__conflict_handler(svn_wc_conflict
markers to the user (this is the typical 3-way merge
scenario), or if no base is available, we can show a diff
between mine and theirs. */
- if ((desc->merged_file && desc->base_file)
- || (!desc->base_file && desc->my_file && desc->their_file))
+ if ((desc->merged_file && desc->base_abspath)
+ || (!desc->base_abspath && desc->my_abspath && desc->their_abspath))
diff_allowed = TRUE;
while (TRUE)
@@ -614,7 +627,8 @@ svn_cl__conflict_handler(svn_wc_conflict
"properties.\n\n")));
continue;
}
- else if (! (desc->my_file && desc->base_file && desc->their_file))
+ else if (! (desc->my_abspath && desc->base_abspath &&
+ desc->their_abspath))
{
SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
_("Invalid option; original "
@@ -654,8 +668,8 @@ svn_cl__conflict_handler(svn_wc_conflict
"\n\n")));
continue;
}
- if (desc->base_file && desc->their_file && desc->my_file
- && desc->merged_file)
+ if (desc->base_abspath && desc->their_abspath &&
+ desc->my_abspath && desc->merged_file)
{
SVN_ERR(launch_resolver(&performed_edit, desc, b, subpool));
if (performed_edit)
@@ -709,7 +723,9 @@ svn_cl__conflict_handler(svn_wc_conflict
stderr, subpool,
_("Conflict discovered when trying to add '%s'.\n"
"An object of the same name already exists.\n"),
- desc->path));
+ svn_cl__local_style_skip_ancestor(b->path_prefix,
+ desc->local_abspath,
+ subpool)));
prompt = _("Select: (p) postpone, (mf) mine-full, "
"(tf) theirs-full, (h) help:");
@@ -747,6 +763,49 @@ svn_cl__conflict_handler(svn_wc_conflict
}
}
+ else if (desc->kind == svn_wc_conflict_kind_tree)
+ {
+ const char *answer;
+ const char *prompt;
+ const char *readable_desc;
+
+ SVN_ERR(svn_cl__get_human_readable_tree_conflict_description(
+ &readable_desc, desc, scratch_pool));
+ SVN_ERR(svn_cmdline_fprintf(
+ stderr, subpool,
+ _("Tree conflict on '%s'\n > %s\n"),
+ svn_cl__local_style_skip_ancestor(b->path_prefix,
+ desc->local_abspath,
+ scratch_pool),
+ readable_desc));
+
+ prompt = _("Select: (p) postpone, (r) mark-resolved, (h) help: ");
+
+ while (1)
+ {
+ svn_pool_clear(subpool);
+
+ SVN_ERR(svn_cmdline_prompt_user2(&answer, prompt, b->pb, subpool));
+
+ if (strcmp(answer, "h") == 0 || strcmp(answer, "?") == 0)
+ {
+ SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
+ _(" (p) postpone - resolve the conflict later\n"
+ " (r) resolved - accept current working tree\n")));
+ }
+ if (strcmp(answer, "p") == 0 || strcmp(answer, ":-p") == 0)
+ {
+ (*result)->choice = svn_wc_conflict_choose_postpone;
+ break;
+ }
+ else if (strcmp(answer, "r") == 0)
+ {
+ (*result)->choice = svn_wc_conflict_choose_merged;
+ break;
+ }
+ }
+ }
+
else /* other types of conflicts -- do nothing about them. */
{
(*result)->choice = svn_wc_conflict_choose_postpone;
Modified: subversion/branches/fix-rdump-editor/subversion/svn/diff-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svn/diff-cmd.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svn/diff-cmd.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svn/diff-cmd.c Wed May 16 20:32:43 2012
@@ -172,9 +172,9 @@ svn_cl__diff(apr_getopt_t *os,
apr_pool_t *iterpool;
svn_boolean_t pegged_diff = FALSE;
svn_boolean_t show_copies_as_adds =
- opt_state->use_patch_diff_format ? TRUE : opt_state->show_copies_as_adds;
- svn_boolean_t ignore_prop_diff =
- opt_state->use_patch_diff_format ? TRUE : opt_state->ignore_props;
+ opt_state->patch_compatible ? TRUE : opt_state->show_copies_as_adds;
+ svn_boolean_t ignore_properties =
+ opt_state->patch_compatible ? TRUE : opt_state->ignore_properties;
int i;
const svn_client_diff_summarize_func_t summarize_func =
(opt_state->xml ? summarize_xml : summarize_regular);
@@ -249,6 +249,12 @@ svn_cl__diff(apr_getopt_t *os,
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&tmp2, os, tmp,
ctx, FALSE, pool));
+
+ /* Check if either or both targets were skipped (e.g. because they
+ * were .svn directories). */
+ if (tmp2->nelts < 2)
+ return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, NULL, NULL);
+
SVN_ERR(svn_opt_parse_path(&old_rev, &old_target,
APR_ARRAY_IDX(tmp2, 0, const char *),
pool));
@@ -367,7 +373,8 @@ svn_cl__diff(apr_getopt_t *os,
opt_state->no_diff_deleted,
show_copies_as_adds,
opt_state->force,
- ignore_prop_diff,
+ ignore_properties,
+ opt_state->properties_only,
opt_state->use_git_diff_format,
svn_cmdline_output_encoding(pool),
outstream,
@@ -413,7 +420,8 @@ svn_cl__diff(apr_getopt_t *os,
opt_state->no_diff_deleted,
show_copies_as_adds,
opt_state->force,
- ignore_prop_diff,
+ ignore_properties,
+ opt_state->properties_only,
opt_state->use_git_diff_format,
svn_cmdline_output_encoding(pool),
outstream,
Modified: subversion/branches/fix-rdump-editor/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svn/log-cmd.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svn/log-cmd.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svn/log-cmd.c Wed May 16 20:32:43 2012
@@ -301,7 +301,7 @@ log_entry_receiver(void *baton,
end_revision.kind = svn_opt_revision_number;
end_revision.value.number = log_entry->revision;
- SVN_ERR(svn_stream_printf(outstream, pool, _("\n")));
+ SVN_ERR(svn_stream_puts(outstream, _("\n")));
SVN_ERR(svn_client_diff_peg6(diff_options,
lb->target_path_or_url,
&lb->target_peg_revision,
@@ -313,13 +313,14 @@ log_entry_receiver(void *baton,
FALSE, /* show copies as adds */
FALSE, /* ignore content type */
FALSE, /* ignore prop diff */
+ FALSE, /* properties only */
FALSE, /* use git diff format */
svn_cmdline_output_encoding(pool),
outstream,
errstream,
NULL,
lb->ctx, pool));
- SVN_ERR(svn_stream_printf(outstream, pool, _("\n")));
+ SVN_ERR(svn_stream_puts(outstream, _("\n")));
SVN_ERR(svn_stream_close(outstream));
SVN_ERR(svn_stream_close(errstream));
}
Modified: subversion/branches/fix-rdump-editor/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svn/main.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svn/main.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svn/main.c Wed May 16 20:32:43 2012
@@ -89,7 +89,7 @@ typedef enum svn_cl__longopt_t {
opt_no_auth_cache,
opt_no_autoprops,
opt_no_diff_deleted,
- opt_ignore_props,
+ opt_ignore_properties,
opt_no_ignore,
opt_no_unlock,
opt_non_interactive,
@@ -124,9 +124,11 @@ typedef enum svn_cl__longopt_t {
opt_diff,
opt_internal_diff,
opt_use_git_diff_format,
- opt_use_patch_diff_format,
+ opt_patch_compatible,
opt_allow_mixed_revisions,
opt_include_externals,
+ opt_symmetric,
+ opt_properties_only,
} svn_cl__longopt_t;
@@ -241,7 +243,7 @@ const apr_getopt_option_t svn_cl__option
N_("try operation but make no changes")},
{"no-diff-deleted", opt_no_diff_deleted, 0,
N_("do not print differences for deleted files")},
- {"ignore-properties", opt_ignore_props, 0,
+ {"ignore-properties", opt_ignore_properties, 0,
N_("ignore properties during the operation")},
{"notice-ancestry", opt_notice_ancestry, 0,
N_("notice ancestry when calculating differences")},
@@ -347,12 +349,12 @@ const apr_getopt_option_t svn_cl__option
N_("override diff-cmd specified in config file")},
{"git", opt_use_git_diff_format, 0,
N_("use git's extended diff format")},
- {"patch-compatible", opt_use_patch_diff_format, 0,
+ {"patch-compatible", opt_patch_compatible, 0,
N_("generate diff suitable for generic third-party\n"
" "
"patch tools; currently the same as\n"
" "
- "--show-copies-as-adds --ignore-properties\n"
+ "--show-copies-as-adds --ignore-properties"
)},
{"allow-mixed-revisions", opt_allow_mixed_revisions, 0,
N_("Allow merge into mixed-revision working copy.\n"
@@ -366,6 +368,10 @@ const apr_getopt_option_t svn_cl__option
"recursion. This does not include externals with a\n"
" "
"fixed revision. (See the svn:externals property)")},
+ {"symmetric", opt_symmetric, 0,
+ N_("Symmetric merge")},
+ {"properties-only", opt_properties_only, 0,
+ N_("show only properties during the operation")},
/* Long-opt Aliases
*
@@ -549,9 +555,10 @@ const svn_opt_subcommand_desc2_t svn_cl_
"\n"
" Use just 'svn diff' to display local modifications in a working copy.\n"),
{'r', 'c', opt_old_cmd, opt_new_cmd, 'N', opt_depth, opt_diff_cmd,
- opt_internal_diff, 'x', opt_no_diff_deleted, opt_ignore_props,
+ opt_internal_diff, 'x', opt_no_diff_deleted, opt_ignore_properties,
+ opt_properties_only,
opt_show_copies_as_adds, opt_notice_ancestry, opt_summarize, opt_changelist,
- opt_force, opt_xml, opt_use_git_diff_format, opt_use_patch_diff_format} },
+ opt_force, opt_xml, opt_use_git_diff_format, opt_patch_compatible} },
{ "export", svn_cl__export, {0}, N_
("Create an unversioned copy of a tree.\n"
"usage: 1. export [-r REV] URL[@PEGREV] [PATH]\n"
@@ -671,15 +678,29 @@ const svn_opt_subcommand_desc2_t svn_cl_
"\n"
" Examples:\n"
- " svn log\n"
- " svn log foo.c\n"
- " svn log bar.c@42\n"
- " svn log http://www.example.com/repo/project/foo.c\n"
- " svn log http://www.example.com/repo/project foo.c bar.c\n"
- " svn log http://www.example.com/repo/project@50 foo.c bar.c\n"
"\n"
- " This command shows the log entry for the revision the branch\n"
- " ^/branches/foo was created in:\n"
+ " Show the latest 5 log messages for the current working copy\n"
+ " directory and display paths changed in each commit:\n"
+ " svn log -l 5 -v\n"
+ "\n"
+ " Show the log for bar.c as of revision 42:\n"
+ " svn log bar.c@42\n"
+ "\n"
+ " Show log messages and diffs for each commit to foo.c:\n"
+ " svn log --diff http://www.example.com/repo/project/foo.c\n"
+ " (Because the above command uses a full URL it does not require\n"
+ " a working copy.)\n"
+ "\n"
+ " Show log messages for the children foo.c and bar.c of the directory\n"
+ " '/trunk' as it appeared in revision 50, using the ^/ URL shortcut:\n"
+ " svn log ^/trunk@50 foo.c bar.c\n"
+ "\n"
+ " Show the log messages for any incoming changes to foo.c during the\n"
+ " next 'svn update':\n"
+ " svn log -r BASE:HEAD foo.c\n"
+ "\n"
+ " Show the log message for the revision in which /branches/foo\n"
+ " was created:\n"
" svn log --stop-on-copy --limit 1 -r0:HEAD ^/branches/foo\n"),
{'r', 'q', 'v', 'g', 'c', opt_targets, opt_stop_on_copy, opt_incremental,
opt_xml, 'l', opt_with_all_revprops, opt_with_no_revprops, opt_with_revprop,
@@ -1014,7 +1035,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
" repositories.\n"),
{'r', 'c', 'N', opt_depth, 'q', opt_force, opt_dry_run, opt_merge_cmd,
opt_record_only, 'x', opt_ignore_ancestry, opt_accept, opt_reintegrate,
- opt_allow_mixed_revisions} },
+ opt_allow_mixed_revisions, opt_symmetric} },
{ "mergeinfo", svn_cl__mergeinfo, {0}, N_
("Display merge-related information.\n"
@@ -1257,9 +1278,12 @@ const svn_opt_subcommand_desc2_t svn_cl_
{ "resolve", svn_cl__resolve, {0}, N_
("Resolve conflicts on working copy files or directories.\n"
- "usage: resolve --accept=ARG [PATH...]\n"
+ "usage: resolve [PATH...]\n"
"\n"
- " Note: the --accept option is currently required.\n"),
+ " If no arguments are given, perform interactive conflict resolution for\n"
+ " all conflicted paths in the working copy, with default depth 'infinity'.\n"
+ " The --accept=ARG option prevents prompting and forces conflicts on PATH\n"
+ " to resolved in the manner specified by ARG, with default depth 'empty'.\n"),
{opt_targets, 'R', opt_depth, 'q', opt_accept},
{{opt_accept, N_("specify automatic conflict resolution source\n"
" "
@@ -1539,7 +1563,6 @@ int
main(int argc, const char *argv[])
{
svn_error_t *err;
- apr_allocator_t *allocator;
apr_pool_t *pool;
int opt_id;
apr_getopt_t *os;
@@ -1564,14 +1587,7 @@ main(int argc, const char *argv[])
/* Create our top-level pool. Use a separate mutexless allocator,
* given this application is single threaded.
*/
- if (apr_allocator_create(&allocator))
- return EXIT_FAILURE;
-
- apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
-
- pool = svn_pool_create_ex(NULL, allocator);
- apr_allocator_owner_set(allocator, pool);
-
+ 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 */
@@ -1919,8 +1935,8 @@ main(int argc, const char *argv[])
case opt_no_diff_deleted:
opt_state.no_diff_deleted = TRUE;
break;
- case opt_ignore_props:
- opt_state.ignore_props = TRUE;
+ case opt_ignore_properties:
+ opt_state.ignore_properties = TRUE;
break;
case opt_show_copies_as_adds:
opt_state.show_copies_as_adds = TRUE;
@@ -1951,6 +1967,9 @@ main(int argc, const char *argv[])
case opt_record_only:
opt_state.record_only = TRUE;
break;
+ case opt_symmetric:
+ opt_state.symmetric_merge = TRUE;
+ break;
case opt_editor_cmd:
opt_state.editor_cmd = apr_pstrdup(pool, opt_arg);
break;
@@ -2102,8 +2121,8 @@ main(int argc, const char *argv[])
case opt_internal_diff:
opt_state.internal_diff = TRUE;
break;
- case opt_use_patch_diff_format:
- opt_state.use_patch_diff_format = TRUE;
+ case opt_patch_compatible:
+ opt_state.patch_compatible = TRUE;
break;
case opt_use_git_diff_format:
opt_state.use_git_diff_format = TRUE;
@@ -2114,6 +2133,9 @@ main(int argc, const char *argv[])
case opt_include_externals:
opt_state.include_externals = TRUE;
break;
+ case opt_properties_only:
+ opt_state.properties_only = TRUE;
+ break;
default:
/* Hmmm. Perhaps this would be a good place to squirrel away
opts that commands like svn diff might need. Hmmm indeed. */
@@ -2656,9 +2678,12 @@ main(int argc, const char *argv[])
the user said to postpone. */
ctx->conflict_func = NULL;
ctx->conflict_baton = NULL;
+ ctx->conflict_func2 = NULL;
+ ctx->conflict_baton2 = NULL;
}
else
{
+ svn_cl__conflict_baton_t * conflict_baton2;
svn_cmdline_prompt_baton_t *pb = apr_palloc(pool, sizeof(*pb));
pb->cancel_func = ctx->cancel_func;
pb->cancel_baton = ctx->cancel_baton;
@@ -2680,13 +2705,16 @@ main(int argc, const char *argv[])
pool, "svn: ");
}
- ctx->conflict_func = svn_cl__conflict_handler;
- ctx->conflict_baton = svn_cl__conflict_baton_make(
- opt_state.accept_which,
- ctx->config,
- opt_state.editor_cmd,
- pb,
- pool);
+ ctx->conflict_func = NULL;
+ ctx->conflict_baton = NULL;
+ ctx->conflict_func2 = svn_cl__conflict_handler;
+ SVN_INT_ERR(svn_cl__conflict_baton_make(&conflict_baton2,
+ opt_state.accept_which,
+ ctx->config,
+ opt_state.editor_cmd,
+ pb,
+ pool));
+ ctx->conflict_baton2 = conflict_baton2;
}
/* And now we finally run the subcommand. */
@@ -2698,8 +2726,10 @@ main(int argc, const char *argv[])
if (err->apr_err == SVN_ERR_CL_INSUFFICIENT_ARGS
|| err->apr_err == SVN_ERR_CL_ARG_PARSING_ERROR)
{
- err = svn_error_quick_wrap(err,
- _("Try 'svn help' for more info"));
+ err = svn_error_quick_wrap(
+ err, apr_psprintf(pool,
+ _("Try 'svn help %s' for more information"),
+ subcommand->name));
}
if (err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED)
{
Modified: subversion/branches/fix-rdump-editor/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svn/merge-cmd.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svn/merge-cmd.c Wed May 16 20:32:43 2012
@@ -33,6 +33,7 @@
#include "svn_error.h"
#include "svn_types.h"
#include "cl.h"
+#include "private/svn_client_private.h"
#include "svn_private_config.h"
@@ -97,6 +98,43 @@ ensure_wc_path_has_repo_revision(const c
return SVN_NO_ERROR;
}
+#ifdef SVN_WITH_SYMMETRIC_MERGE
+/* Symmetric, merge-tracking merge, used for sync or reintegrate purposes. */
+static svn_error_t *
+symmetric_merge(const char *source_path_or_url,
+ const svn_opt_revision_t *source_revision,
+ const char *target_wcpath,
+ svn_depth_t depth,
+ svn_boolean_t ignore_ancestry,
+ svn_boolean_t force,
+ svn_boolean_t record_only,
+ svn_boolean_t dry_run,
+ svn_boolean_t allow_mixed_rev,
+ svn_boolean_t allow_local_mods,
+ svn_boolean_t allow_switched_subtrees,
+ const apr_array_header_t *merge_options,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool)
+{
+ svn_client__symmetric_merge_t *merge;
+
+ /* Find the 3-way merges needed (and check suitability of the WC). */
+ SVN_ERR(svn_client__find_symmetric_merge(&merge,
+ source_path_or_url, source_revision,
+ target_wcpath, allow_mixed_rev,
+ allow_local_mods, allow_switched_subtrees,
+ ctx, scratch_pool, scratch_pool));
+
+ /* Perform the 3-way merges */
+ SVN_ERR(svn_client__do_symmetric_merge(merge, target_wcpath, depth,
+ ignore_ancestry, force, record_only,
+ dry_run, merge_options,
+ ctx, scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+#endif
+
/* This implements the `svn_opt_subcommand_t' interface. */
svn_error_t *
svn_cl__merge(apr_getopt_t *os,
@@ -346,6 +384,34 @@ svn_cl__merge(apr_getopt_t *os,
"with --reintegrate"));
}
+#ifdef SVN_WITH_SYMMETRIC_MERGE
+ if (opt_state->symmetric_merge)
+ {
+ svn_boolean_t allow_local_mods = ! opt_state->reintegrate;
+ svn_boolean_t allow_switched_subtrees = ! opt_state->reintegrate;
+
+ if (two_sources_specified)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("SOURCE2 can't be used with --symmetric"));
+
+ SVN_ERR_W(svn_cl__check_related_source_and_target(
+ sourcepath1, &peg_revision1, targetpath, &unspecified,
+ ctx, pool),
+ _("Source and target must be different but related branches"));
+
+ err = symmetric_merge(sourcepath1, &peg_revision1, targetpath,
+ opt_state->depth,
+ opt_state->ignore_ancestry,
+ opt_state->force,
+ opt_state->record_only,
+ opt_state->dry_run,
+ opt_state->allow_mixed_rev,
+ allow_local_mods,
+ allow_switched_subtrees,
+ options, ctx, pool);
+ }
+ else
+#endif
if (opt_state->reintegrate)
{
SVN_ERR_W(svn_cl__check_related_source_and_target(
Modified: subversion/branches/fix-rdump-editor/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svn/notify.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svn/notify.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svn/notify.c Wed May 16 20:32:43 2012
@@ -181,6 +181,10 @@ notify(void *baton, const svn_wc_notify_
if ((err = svn_cmdline_printf(pool, "D %s\n", path_local)))
goto print_error;
break;
+ case svn_wc_notify_update_broken_lock:
+ if ((err = svn_cmdline_printf(pool, "B %s\n", path_local)))
+ goto print_error;
+ break;
case svn_wc_notify_update_external_removed:
nb->received_some_change = TRUE;
Modified: subversion/branches/fix-rdump-editor/subversion/svn/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svn/props.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svn/props.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svn/props.c Wed May 16 20:32:43 2012
@@ -94,7 +94,6 @@ svn_cl__print_prop_hash(svn_stream_t *ou
const char *pname = svn__apr_hash_index_key(hi);
svn_string_t *propval = svn__apr_hash_index_val(hi);
const char *pname_stdout;
- apr_size_t len;
if (svn_prop_needs_translation(pname))
SVN_ERR(svn_subst_detranslate_string(&propval, propval,
@@ -112,8 +111,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 +132,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
{
Modified: subversion/branches/fix-rdump-editor/subversion/svn/resolve-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svn/resolve-cmd.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svn/resolve-cmd.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svn/resolve-cmd.c Wed May 16 20:32:43 2012
@@ -77,8 +77,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 (ctx->conflict_func2 == 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,10 +92,15 @@ 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));
Modified: subversion/branches/fix-rdump-editor/subversion/svn/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svn/status.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svn/status.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svn/status.c Wed May 16 20:32:43 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/fix-rdump-editor/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svnadmin/main.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svnadmin/main.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svnadmin/main.c Wed May 16 20:32:43 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));
@@ -725,8 +727,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 +742,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 +836,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")));
@@ -1768,7 +1768,6 @@ main(int argc, const char *argv[])
{
svn_error_t *err;
apr_status_t apr_err;
- apr_allocator_t *allocator;
apr_pool_t *pool;
const svn_opt_subcommand_desc2_t *subcommand = NULL;
@@ -1785,13 +1784,7 @@ main(int argc, const char *argv[])
/* Create our top-level pool. Use a separate mutexless allocator,
* given this application is single threaded.
*/
- if (apr_allocator_create(&allocator))
- return EXIT_FAILURE;
-
- apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
-
- pool = svn_pool_create_ex(NULL, allocator);
- apr_allocator_owner_set(allocator, pool);
+ pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
Modified: subversion/branches/fix-rdump-editor/subversion/svndumpfilter/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svndumpfilter/main.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svndumpfilter/main.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svndumpfilter/main.c Wed May 16 20:32:43 2012
@@ -79,7 +79,7 @@ create_stdio_stream(svn_stream_t **strea
/* Writes a property in dumpfile format to given stringbuf. */
static void
-write_prop_to_stringbuf(svn_stringbuf_t **strbuf,
+write_prop_to_stringbuf(svn_stringbuf_t *strbuf,
const char *name,
const svn_string_t *value)
{
@@ -89,24 +89,24 @@ write_prop_to_stringbuf(svn_stringbuf_t
/* Output name length, then name. */
namelen = strlen(name);
- svn_stringbuf_appendbytes(*strbuf, "K ", 2);
+ svn_stringbuf_appendbytes(strbuf, "K ", 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, buf, bytes_used);
+ svn_stringbuf_appendbyte(strbuf, '\n');
- svn_stringbuf_appendbytes(*strbuf, name, namelen);
- svn_stringbuf_appendbyte(*strbuf, '\n');
+ svn_stringbuf_appendbytes(strbuf, name, namelen);
+ svn_stringbuf_appendbyte(strbuf, '\n');
/* Output value length, then value. */
- svn_stringbuf_appendbytes(*strbuf, "V ", 2);
+ 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_appendbyte(*strbuf, '\n');
+ svn_stringbuf_appendbytes(strbuf, buf, bytes_used);
+ svn_stringbuf_appendbyte(strbuf, '\n');
- svn_stringbuf_appendbytes(*strbuf, value->data, value->len);
- svn_stringbuf_appendbyte(*strbuf, '\n');
+ svn_stringbuf_appendbytes(strbuf, value->data, value->len);
+ svn_stringbuf_appendbyte(strbuf, '\n');
}
@@ -364,7 +364,7 @@ output_revision(struct revision_baton_t
const char *pname = svn__apr_hash_index_key(hi);
const svn_string_t *pval = svn__apr_hash_index_val(hi);
- write_prop_to_stringbuf(&props, pname, pval);
+ write_prop_to_stringbuf(props, pname, pval);
}
svn_stringbuf_appendcstr(props, "PROPS-END\n");
svn_stringbuf_appendcstr(rb->header,
@@ -804,7 +804,7 @@ set_node_property(void *node_baton,
value = filtered_mergeinfo;
}
- write_prop_to_stringbuf(&(nb->props), name, value);
+ write_prop_to_stringbuf(nb->props, name, value);
return SVN_NO_ERROR;
}
@@ -1262,7 +1262,6 @@ main(int argc, const char *argv[])
{
svn_error_t *err;
apr_status_t apr_err;
- apr_allocator_t *allocator;
apr_pool_t *pool;
const svn_opt_subcommand_desc2_t *subcommand = NULL;
@@ -1280,13 +1279,7 @@ main(int argc, const char *argv[])
/* Create our top-level pool. Use a separate mutexless allocator,
* given this application is single threaded.
*/
- if (apr_allocator_create(&allocator))
- return EXIT_FAILURE;
-
- apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
-
- pool = svn_pool_create_ex(NULL, allocator);
- apr_allocator_owner_set(allocator, pool);
+ pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
/* Check library versions */
err = check_lib_versions();
Modified: subversion/branches/fix-rdump-editor/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svnlook/main.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svnlook/main.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svnlook/main.c Wed May 16 20:32:43 2012
@@ -445,7 +445,6 @@ generate_delta_tree(svn_repos_node_t **t
svn_repos_t *repos,
svn_fs_root_t *root,
svn_revnum_t base_rev,
- svn_boolean_t use_copy_history,
apr_pool_t *pool)
{
svn_fs_root_t *base_root;
@@ -462,7 +461,7 @@ generate_delta_tree(svn_repos_node_t **t
base_root, root, pool, edit_pool));
/* Drive our editor. */
- SVN_ERR(svn_repos_replay2(root, "", SVN_INVALID_REVNUM, FALSE,
+ SVN_ERR(svn_repos_replay2(root, "", SVN_INVALID_REVNUM, TRUE,
editor, edit_baton, NULL, NULL, edit_pool));
/* Return the tree we just built. */
@@ -901,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));
}
}
}
@@ -1401,8 +1399,7 @@ do_dirs_changed(svnlook_ctxt_t *c, apr_p
_("Transaction '%s' is not based on a revision; how odd"),
c->txn_name);
- SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id,
- TRUE, pool));
+ SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id, pool));
if (tree)
SVN_ERR(print_dirs_changed_tree(tree, "", pool));
@@ -1507,8 +1504,7 @@ do_changed(svnlook_ctxt_t *c, apr_pool_t
_("Transaction '%s' is not based on a revision; how odd"),
c->txn_name);
- SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id,
- TRUE, pool));
+ SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id, pool));
if (tree)
SVN_ERR(print_changed_tree(tree, "", c->copy_info, pool));
@@ -1536,8 +1532,7 @@ do_diff(svnlook_ctxt_t *c, apr_pool_t *p
_("Transaction '%s' is not based on a revision; how odd"),
c->txn_name);
- SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id,
- TRUE, pool));
+ SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id, pool));
if (tree)
{
const char *tmpdir;
@@ -2255,7 +2250,6 @@ main(int argc, const char *argv[])
{
svn_error_t *err;
apr_status_t apr_err;
- apr_allocator_t *allocator;
apr_pool_t *pool;
const svn_opt_subcommand_desc2_t *subcommand = NULL;
@@ -2272,13 +2266,7 @@ main(int argc, const char *argv[])
/* Create our top-level pool. Use a separate mutexless allocator,
* given this application is single threaded.
*/
- if (apr_allocator_create(&allocator))
- return EXIT_FAILURE;
-
- apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
-
- pool = svn_pool_create_ex(NULL, allocator);
- apr_allocator_owner_set(allocator, pool);
+ pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
Propchange: subversion/branches/fix-rdump-editor/subversion/svnmucc/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed May 16 20:32:43 2012
@@ -0,0 +1,7 @@
+svnmucc
+svnmucc.exe
+.libs
+*.o
+*~
+.*~
+svnmucc-test-repos
Modified: subversion/branches/fix-rdump-editor/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svnrdump/dump_editor.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svnrdump/dump_editor.c Wed May 16 20:32:43 2012
@@ -31,6 +31,7 @@
#include "svn_dirent_uri.h"
#include "private/svn_fspath.h"
+#include "private/svn_subr_private.h"
#include "svnrdump.h"
@@ -293,7 +294,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));
@@ -312,7 +313,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;
@@ -367,27 +368,25 @@ dump_node(svn_stream_t *stream,
/* 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(stream, pool,
- SVN_REPOS_DUMPFILE_NODE_ACTION
- ": change\n"));
+ SVN_ERR(svn_stream_puts(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(stream, pool,
- SVN_REPOS_DUMPFILE_NODE_ACTION
- ": replace\n"));
+ SVN_ERR(svn_stream_puts(stream,
+ SVN_REPOS_DUMPFILE_NODE_ACTION
+ ": replace\n"));
break;
}
/* More complex case: is_copy is true, and copyfrom_path/
copyfrom_rev are present: delete the original, and then re-add
it */
- SVN_ERR(svn_stream_printf(stream, pool,
- SVN_REPOS_DUMPFILE_NODE_ACTION
- ": delete\n\n"));
+ SVN_ERR(svn_stream_puts(stream,
+ SVN_REPOS_DUMPFILE_NODE_ACTION ": delete\n\n"));
/* Recurse: Print an additional add-with-history record. */
SVN_ERR(dump_node(stream, path, kind, svn_node_action_add, props,
@@ -399,19 +398,18 @@ dump_node(svn_stream_t *stream,
break;
case svn_node_action_delete:
- SVN_ERR(svn_stream_printf(stream, pool,
- SVN_REPOS_DUMPFILE_NODE_ACTION
- ": delete\n"));
+ SVN_ERR(svn_stream_puts(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(stream, pool, "\n\n"));
+ SVN_ERR(svn_stream_puts(stream, "\n\n"));
break;
case svn_node_action_add:
- SVN_ERR(svn_stream_printf(stream, pool,
- SVN_REPOS_DUMPFILE_NODE_ACTION ": add\n"));
+ SVN_ERR(svn_stream_puts(stream,
+ SVN_REPOS_DUMPFILE_NODE_ACTION ": add\n"));
SVN_ERR(svn_stream_printf(stream, pool,
SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV
@@ -619,7 +617,7 @@ change_dir_prop(void *parent_baton,
LDR_DBG(("change_dir_prop %p\n", parent_baton));
- if (svn_property_kind(NULL, name) != svn_prop_regular_kind)
+ if (svn_property_kind2(name) != svn_prop_regular_kind)
return SVN_NO_ERROR;
/* The fact that we're here means this node has information, it isn't just
@@ -654,7 +652,7 @@ change_file_prop(void *file_baton,
LDR_DBG(("change_file_prop %p\n", file_baton));
- if (svn_property_kind(NULL, name) != svn_prop_regular_kind)
+ if (svn_property_kind2(name) != svn_prop_regular_kind)
return SVN_NO_ERROR;
if (value)
@@ -759,9 +757,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)
@@ -821,7 +819,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;
}
@@ -997,7 +995,7 @@ svn_rdump__get_dump_editor(const svn_del
shim_callbacks->fetch_baton = eb;
SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
- shim_callbacks, pool, pool));
+ NULL, NULL, shim_callbacks, pool, pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/fix-rdump-editor/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svnrdump/load_editor.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svnrdump/load_editor.c Wed May 16 20:32:43 2012
@@ -384,6 +384,121 @@ lock_retry_func(void *baton,
reposlocktoken->data);
}
+
+static svn_error_t *
+fetch_base_func(const char **filename,
+ void *baton,
+ const char *path,
+ svn_revnum_t base_revision,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ struct revision_baton *rb = baton;
+ svn_stream_t *fstream;
+ svn_error_t *err;
+
+ if (! SVN_IS_VALID_REVNUM(base_revision))
+ base_revision = rb->rev - 1;
+
+ SVN_ERR(svn_stream_open_unique(&fstream, filename, NULL,
+ svn_io_file_del_on_pool_cleanup,
+ result_pool, scratch_pool));
+
+ err = svn_ra_get_file(rb->pb->aux_session, path, base_revision,
+ fstream, NULL, NULL, scratch_pool);
+ if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
+ {
+ svn_error_clear(err);
+ SVN_ERR(svn_stream_close(fstream));
+
+ *filename = NULL;
+ return SVN_NO_ERROR;
+ }
+ else if (err)
+ return svn_error_trace(err);
+
+ SVN_ERR(svn_stream_close(fstream));
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+fetch_props_func(apr_hash_t **props,
+ void *baton,
+ const char *path,
+ svn_revnum_t base_revision,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ struct revision_baton *rb = baton;
+ svn_node_kind_t node_kind;
+
+ if (! SVN_IS_VALID_REVNUM(base_revision))
+ base_revision = rb->rev - 1;
+
+ SVN_ERR(svn_ra_check_path(rb->pb->aux_session, path, base_revision,
+ &node_kind, scratch_pool));
+
+ if (node_kind == svn_node_file)
+ {
+ SVN_ERR(svn_ra_get_file(rb->pb->aux_session, path, base_revision,
+ NULL, NULL, props, result_pool));
+ }
+ else if (node_kind == svn_node_dir)
+ {
+ apr_array_header_t *tmp_props;
+
+ SVN_ERR(svn_ra_get_dir2(rb->pb->aux_session, NULL, NULL, props, path,
+ base_revision, 0 /* Dirent fields */,
+ result_pool));
+ tmp_props = svn_prop_hash_to_array(*props, result_pool);
+ SVN_ERR(svn_categorize_props(tmp_props, NULL, NULL, &tmp_props,
+ result_pool));
+ *props = svn_prop_array_to_hash(tmp_props, result_pool);
+ }
+ else
+ {
+ *props = apr_hash_make(result_pool);
+ }
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+fetch_kind_func(svn_kind_t *kind,
+ void *baton,
+ const char *path,
+ svn_revnum_t base_revision,
+ apr_pool_t *scratch_pool)
+{
+ struct revision_baton *rb = baton;
+ svn_node_kind_t node_kind;
+
+ if (! SVN_IS_VALID_REVNUM(base_revision))
+ base_revision = rb->rev - 1;
+
+ SVN_ERR(svn_ra_check_path(rb->pb->aux_session, path, base_revision,
+ &node_kind, scratch_pool));
+
+ *kind = svn__kind_from_node_kind(node_kind, FALSE);
+ return SVN_NO_ERROR;
+}
+
+static svn_delta_shim_callbacks_t *
+get_shim_callbacks(struct revision_baton *rb,
+ apr_pool_t *pool)
+{
+ svn_delta_shim_callbacks_t *callbacks =
+ svn_delta_shim_callbacks_default(pool);
+
+ callbacks->fetch_props_func = fetch_props_func;
+ callbacks->fetch_kind_func = fetch_kind_func;
+ callbacks->fetch_base_func = fetch_base_func;
+ callbacks->fetch_baton = rb;
+
+ return callbacks;
+}
+
/* 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.
@@ -452,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)))
@@ -518,6 +633,8 @@ new_node_record(void **node_baton,
apr_hash_set(rb->revprop_table, SVN_PROP_REVISION_DATE,
APR_HASH_KEY_STRING, NULL);
+ SVN_ERR(svn_ra__register_editor_shim_callbacks(rb->pb->session,
+ get_shim_callbacks(rb, rb->pool)));
SVN_ERR(svn_ra_get_commit_editor3(rb->pb->session, &commit_editor,
&commit_edit_baton, rb->revprop_table,
commit_callback, revision_baton,
@@ -876,7 +993,7 @@ remove_node_props(void *baton)
for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
{
const char *name = svn__apr_hash_index_key(hi);
- svn_prop_kind_t kind = svn_property_kind(NULL, name);
+ svn_prop_kind_t kind = svn_property_kind2(name);
if (kind == svn_prop_regular_kind)
SVN_ERR(set_node_property(nb, name, NULL));
Modified: subversion/branches/fix-rdump-editor/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svnrdump/svnrdump.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svnrdump/svnrdump.c Wed May 16 20:32:43 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;
}
@@ -694,7 +694,6 @@ main(int argc, const char **argv)
apr_getopt_t *os;
const char *first_arg;
apr_array_header_t *received_opts;
- apr_allocator_t *allocator;
int i;
if (svn_cmdline_init ("svnrdump", stderr) != EXIT_SUCCESS)
@@ -703,13 +702,7 @@ main(int argc, const char **argv)
/* Create our top-level pool. Use a separate mutexless allocator,
* given this application is single threaded.
*/
- if (apr_allocator_create(&allocator))
- return EXIT_FAILURE;
-
- apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
-
- pool = svn_pool_create_ex(NULL, allocator);
- apr_allocator_owner_set(allocator, pool);
+ pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
opt_baton = apr_pcalloc(pool, sizeof(*opt_baton));
opt_baton->start_revision.kind = svn_opt_revision_unspecified;
Modified: subversion/branches/fix-rdump-editor/subversion/svnserve/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svnserve/main.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svnserve/main.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svnserve/main.c Wed May 16 20:32:43 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. */
@@ -413,7 +426,6 @@ int main(int argc, const char *argv[])
apr_sockaddr_t *sa;
apr_pool_t *pool;
apr_pool_t *connection_pool;
- apr_allocator_t *allocator;
svn_error_t *err;
apr_getopt_t *os;
int opt;
@@ -483,6 +495,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)
{
@@ -626,6 +639,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)
@@ -928,22 +946,12 @@ int main(int argc, const char *argv[])
return ERROR_SUCCESS;
#endif
- /* If we are using fulltext caches etc. we will allocate many large
- chunks of memory of various sizes outside the cache for those
- fulltexts. Make sure we use the memory wisely: use an allocator
- that causes memory fragments to be given back to the OS early. */
-
- if (apr_allocator_create(&allocator))
- return EXIT_FAILURE;
-
- apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
-
/* Non-standard pool handling. The main thread never blocks to join
the connection threads so it cannot clean up after each one. So
separate pools that can be cleared at thread exit are used. */
- connection_pool = svn_pool_create_ex(NULL, allocator);
- apr_allocator_owner_set(allocator, connection_pool);
+ connection_pool
+ = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
status = apr_socket_accept(&usock, sock, connection_pool);
if (handling_mode == connection_mode_fork)
Modified: subversion/branches/fix-rdump-editor/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svnserve/serve.c?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svnserve/serve.c (original)
+++ subversion/branches/fix-rdump-editor/subversion/svnserve/serve.c Wed May 16 20:32:43 2012
@@ -1470,9 +1470,9 @@ static svn_error_t *get_dir(svn_ra_svn_c
apr_array_header_t *params, void *baton)
{
server_baton_t *b = baton;
- const char *path, *full_path, *file_path, *cdate;
+ const char *path, *full_path;
svn_revnum_t rev;
- apr_hash_t *entries, *props = NULL, *file_props;
+ apr_hash_t *entries, *props = NULL;
apr_hash_index_t *hi;
svn_fs_root_t *root;
apr_pool_t *subpool;
@@ -1548,7 +1548,9 @@ static svn_error_t *get_dir(svn_ra_svn_c
/* Fetch the directory entries if requested and send them immediately. */
if (want_contents)
{
- const char *zero_date = svn_time_to_cstring(0, pool);
+ /* Use epoch for a placeholder for a missing date. */
+ const char *missing_date = svn_time_to_cstring(0, pool);
+
SVN_CMD_ERR(svn_fs_dir_entries(&entries, root, full_path, pool));
/* Transform the hash table's FS entries into dirents. This probably
@@ -1558,9 +1560,20 @@ static svn_error_t *get_dir(svn_ra_svn_c
{
const char *name = svn__apr_hash_index_key(hi);
svn_fs_dirent_t *fsent = svn__apr_hash_index_val(hi);
+ const char *file_path;
- svn_dirent_t entry;
- memset(&entry, 0, sizeof(entry));
+ /* The fields in the entry tuple. */
+ svn_node_kind_t entry_kind = svn_node_none;
+ svn_filesize_t entry_size = 0;
+ svn_boolean_t has_props = FALSE;
+ /* 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;
svn_pool_clear(subpool);
@@ -1570,44 +1583,49 @@ static svn_error_t *get_dir(svn_ra_svn_c
continue;
if (dirent_fields & SVN_DIRENT_KIND)
- entry.kind = fsent->kind;
+ entry_kind = fsent->kind;
if (dirent_fields & SVN_DIRENT_SIZE)
- if (entry.kind != svn_node_dir)
- SVN_CMD_ERR(svn_fs_file_length(&entry.size, root, file_path,
+ if (entry_kind != svn_node_dir)
+ SVN_CMD_ERR(svn_fs_file_length(&entry_size, root, file_path,
subpool));
if (dirent_fields & SVN_DIRENT_HAS_PROPS)
{
+ apr_hash_t *file_props;
+
/* has_props */
SVN_CMD_ERR(svn_fs_node_proplist(&file_props, root, file_path,
subpool));
- entry.has_props = (apr_hash_count(file_props) > 0);
+ has_props = (apr_hash_count(file_props) > 0);
}
- cdate = NULL;
if ((dirent_fields & SVN_DIRENT_LAST_AUTHOR)
|| (dirent_fields & SVN_DIRENT_TIME)
|| (dirent_fields & SVN_DIRENT_CREATED_REV))
{
/* created_rev, last_author, time */
- SVN_CMD_ERR(svn_repos_get_committed_info(&entry.created_rev,
+ SVN_CMD_ERR(svn_repos_get_committed_info(&created_rev,
&cdate,
- &entry.last_author,
+ &last_author,
root,
file_path,
subpool));
}
+ /* The client does not properly handle a missing CDATE. For
+ interoperability purposes, we must fill in some junk.
+
+ See libsvn_ra_svn/client.c:ra_svn_get_dir() */
if (cdate == NULL)
- cdate = zero_date;
+ cdate = missing_date;
/* Send the entry. */
SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "cwnbr(?c)(?c)", name,
- svn_node_kind_to_word(entry.kind),
- (apr_uint64_t) entry.size,
- entry.has_props, entry.created_rev,
- cdate, entry.last_author));
+ svn_node_kind_to_word(entry_kind),
+ (apr_uint64_t) entry_size,
+ has_props, created_rev,
+ cdate, last_author));
}
svn_pool_destroy(subpool);
}
@@ -3236,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/fix-rdump-editor/subversion/svnserve/server.h
URL: http://svn.apache.org/viewvc/subversion/branches/fix-rdump-editor/subversion/svnserve/server.h?rev=1339349&r1=1339348&r2=1339349&view=diff
==============================================================================
--- subversion/branches/fix-rdump-editor/subversion/svnserve/server.h (original)
+++ subversion/branches/fix-rdump-editor/subversion/svnserve/server.h Wed May 16 20:32:43 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;