You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/08/16 12:18:03 UTC
svn commit: r1373783 [37/50] - in /subversion/branches/compressed-pristines:
./ build/ build/ac-macros/ build/generator/ build/generator/templates/
build/win32/ contrib/client-side/emacs/ contrib/client-side/svn-push/
contrib/client-side/svnmerge/ cont...
Modified: subversion/branches/compressed-pristines/subversion/svn/blame-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/blame-cmd.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/blame-cmd.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/blame-cmd.c Thu Aug 16 10:17:48 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/compressed-pristines/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/cl.h?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/cl.h (original)
+++ subversion/branches/compressed-pristines/subversion/svn/cl.h Thu Aug 16 10:17:48 2012
@@ -163,7 +163,6 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t no_unlock;
const char *message; /* log message */
- const char *ancestor_path; /* ### todo: who sets this? */
svn_boolean_t force; /* be more forceful, as in "svn rm -f ..." */
svn_boolean_t force_log; /* force validity of a suspect log msg file */
svn_boolean_t incremental; /* yield output suitable for concatenation */
@@ -183,20 +182,27 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t xml; /* output in xml, e.g., "svn log --xml" */
svn_boolean_t no_ignore; /* disregard default ignores & svn:ignore's */
svn_boolean_t no_auth_cache; /* do not cache authentication information */
+ struct
+ {
+ const char *diff_cmd; /* the external diff command to use */
+ svn_boolean_t internal_diff; /* override diff_cmd in config file */
svn_boolean_t no_diff_deleted; /* do not show diffs for deleted files */
- svn_boolean_t ignore_props; /* 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 summarize; /* create a summary of a diff */
+ svn_boolean_t use_git_diff_format; /* Use git's extended diff format */
+ svn_boolean_t ignore_properties; /* ignore properties */
+ svn_boolean_t properties_only; /* Show properties only */
+ svn_boolean_t patch_compatible; /* Output compatible with GNU patch */
+ } diff;
svn_boolean_t ignore_ancestry; /* ignore ancestry for merge-y operations */
svn_boolean_t ignore_externals;/* ignore externals definitions */
svn_boolean_t stop_on_copy; /* don't cross copies during processing */
svn_boolean_t dry_run; /* try operation but make no changes */
svn_boolean_t revprop; /* operate on a revision property */
- const char *diff_cmd; /* the external diff command to use */
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) */
@@ -205,7 +211,6 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t autoprops; /* enable automatic properties */
svn_boolean_t no_autoprops; /* disable automatic properties */
const char *native_eol; /* override system standard eol marker */
- svn_boolean_t summarize; /* create a summary of a diff */
svn_boolean_t remove; /* deassociate a changelist */
apr_array_header_t *changelists; /* changelist filters */
const char *changelist; /* operate on this changelist
@@ -229,11 +234,13 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t ignore_whitespace; /* don't account for whitespace when
patching */
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 allow_mixed_rev; /* Allow operation on mixed-revision WC */
svn_boolean_t include_externals; /* Recurses (in)to file & dir externals */
+ const char *search_pattern; /* pattern argument for --search */
+ svn_boolean_t case_insensitive_search; /* perform case-insensitive search */
+
+ svn_wc_conflict_resolver_func2_t conflict_func;
+ void *conflict_baton;
} svn_cl__opt_state_t;
@@ -332,13 +339,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,
@@ -350,9 +359,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);
@@ -565,6 +575,19 @@ svn_cl__merge_file_externally(const char
svn_boolean_t *remains_in_conflict,
apr_pool_t *pool);
+/* Like svn_cl__merge_file_externally, but using a built-in merge tool
+ * with help from an external editor specified by EDITOR_CMD. */
+svn_error_t *
+svn_cl__merge_file(const char *base_path,
+ const char *their_path,
+ const char *my_path,
+ const char *merged_path,
+ const char *wc_path,
+ const char *path_prefix,
+ const char *editor_cmd,
+ apr_hash_t *config,
+ svn_boolean_t *remains_in_conflict,
+ apr_pool_t *scratch_pool);
/*** Notification functions to display results on the terminal. */
@@ -595,6 +618,14 @@ svn_cl__notifier_mark_export(void *baton
svn_error_t *
svn_cl__notifier_mark_wc_to_repos_copy(void *baton);
+/* Return TRUE if any conflicts were detected during notification. */
+svn_boolean_t
+svn_cl__notifier_check_conflicts(void *baton);
+
+/* Return a sorted array of conflicted paths detected during notification. */
+apr_array_header_t *
+svn_cl__notifier_get_conflicted_paths(void *baton, apr_pool_t *result_pool);
+
/* Baton for use with svn_cl__check_externals_failed_notify_wrapper(). */
struct svn_cl__check_externals_failed_notify_baton
{
@@ -842,6 +873,15 @@ svn_cl__check_related_source_and_target(
svn_client_ctx_t *ctx,
apr_pool_t *pool);
+/* Run the conflict resolver for all targets in the TARGETS list with
+ * the specified DEPTH. */
+svn_error_t *
+svn_cl__resolve_conflicts(apr_array_header_t *targets,
+ svn_depth_t depth,
+ const svn_cl__opt_state_t *opt_state,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/compressed-pristines/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/conflict-callbacks.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/conflict-callbacks.c Thu Aug 16 10:17:48 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)
{
@@ -187,15 +191,19 @@ open_editor(svn_boolean_t *performed_edi
b->config, pool);
if (err && (err->apr_err == SVN_ERR_CL_NO_EXTERNAL_EDITOR))
{
+ svn_error_t *root_err = svn_error_root_cause(err);
+
SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
- err->message ? err->message :
+ root_err->message ? root_err->message :
_("No editor found.")));
svn_error_clear(err);
}
else if (err && (err->apr_err == SVN_ERR_EXTERNAL_PROGRAM))
{
+ svn_error_t *root_err = svn_error_root_cause(err);
+
SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
- err->message ? err->message :
+ root_err->message ? root_err->message :
_("Error running editor.")));
svn_error_clear(err);
}
@@ -223,27 +231,30 @@ 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",
err->message ? err->message :
- _("No merge tool found.\n")));
+ _("No merge tool found, "
+ "try '(m) merge' instead.\n")));
svn_error_clear(err);
}
else if (err && err->apr_err == SVN_ERR_EXTERNAL_PROGRAM)
{
SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
err->message ? err->message :
- _("Error running merge tool.")));
+ _("Error running merge tool, "
+ "try '(m) merge' instead.")));
svn_error_clear(err);
}
else if (err)
@@ -255,13 +266,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 +281,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 +320,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 +333,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 +348,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 +359,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 +378,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 +400,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 +424,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 +457,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 +475,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)
@@ -469,7 +488,7 @@ svn_cl__conflict_handler(svn_wc_conflict
if (diff_allowed)
{
prompt = apr_pstrcat(subpool, prompt,
- _(", (df) diff-full, (e) edit"),
+ _(", (df) diff-full, (e) edit, (m) merge"),
(char *)NULL);
if (knows_something)
@@ -525,6 +544,8 @@ svn_cl__conflict_handler(svn_wc_conflict
"\n"
" (p) postpone - mark the conflict to be "
"resolved later\n"
+ " (m) merge - use internal merge tool to "
+ "resolve conflict\n"
" (l) launch - launch external tool to "
"resolve conflict\n"
" (s) show all - show this list\n\n")));
@@ -614,7 +635,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 "
@@ -643,6 +665,39 @@ svn_cl__conflict_handler(svn_wc_conflict
if (performed_edit)
knows_something = TRUE;
}
+ else if (strcmp(answer, "m") == 0 || strcmp(answer, ":-M") == 0)
+ {
+ if (desc->kind != svn_wc_conflict_kind_text)
+ {
+ SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
+ _("Invalid option; can only "
+ "resolve text conflicts with "
+ "the internal merge tool."
+ "\n\n")));
+ continue;
+ }
+
+ if (desc->base_abspath && desc->their_abspath &&
+ desc->my_abspath && desc->merged_file)
+ {
+ svn_boolean_t remains_in_conflict;
+
+ SVN_ERR(svn_cl__merge_file(desc->base_abspath,
+ desc->their_abspath,
+ desc->my_abspath,
+ desc->merged_file,
+ desc->local_abspath,
+ b->path_prefix,
+ b->editor_cmd,
+ b->config,
+ &remains_in_conflict,
+ subpool));
+ knows_something = !remains_in_conflict;
+ }
+ else
+ SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
+ _("Invalid option.\n\n")));
+ }
else if (strcmp(answer, "l") == 0 || strcmp(answer, ":-l") == 0)
{
if (desc->kind == svn_wc_conflict_kind_property)
@@ -654,8 +709,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 +764,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 +804,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;
@@ -755,3 +855,57 @@ svn_cl__conflict_handler(svn_wc_conflict
svn_pool_destroy(subpool);
return SVN_NO_ERROR;
}
+
+svn_error_t *
+svn_cl__resolve_conflicts(apr_array_header_t *targets,
+ svn_depth_t depth,
+ const svn_cl__opt_state_t *opt_state,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool)
+{
+ int i;
+ apr_pool_t *iterpool;
+
+ iterpool = svn_pool_create(scratch_pool);
+ for (i = 0; i < targets->nelts; i++)
+ {
+ const char *target = APR_ARRAY_IDX(targets, i, const char *);
+ svn_error_t *err = SVN_NO_ERROR;
+ const char *local_abspath;
+ svn_wc_conflict_resolver_func2_t conflict_func2;
+ void *conflict_baton2;
+
+ svn_pool_clear(iterpool);
+
+ SVN_ERR(svn_dirent_get_absolute(&local_abspath, target, iterpool));
+
+
+ /* Store old state */
+ conflict_func2 = ctx->conflict_func2;
+ conflict_baton2 = ctx->conflict_baton2;
+
+ /* Store interactive resolver */
+ ctx->conflict_func2 = opt_state->conflict_func;
+ ctx->conflict_baton2 = opt_state->conflict_baton;
+
+ err = svn_client_resolve(local_abspath, depth,
+ svn_wc_conflict_choose_unspecified,
+ ctx, iterpool);
+
+ /* Restore state */
+ ctx->conflict_func2 = conflict_func2;
+ ctx->conflict_baton2 = conflict_baton2;
+
+ if (err)
+ {
+ if ((err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY)
+ && (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND))
+ return svn_error_trace(err);
+
+ svn_error_clear(err);
+ }
+ }
+ svn_pool_destroy(iterpool);
+
+ return SVN_NO_ERROR;
+}
Modified: subversion/branches/compressed-pristines/subversion/svn/diff-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/diff-cmd.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/diff-cmd.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/diff-cmd.c Thu Aug 16 10:17:48 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->diff.patch_compatible || opt_state->diff.show_copies_as_adds;
+ svn_boolean_t ignore_properties =
+ opt_state->diff.patch_compatible || opt_state->diff.ignore_properties;
int i;
const svn_client_diff_summarize_func_t summarize_func =
(opt_state->xml ? summarize_xml : summarize_regular);
@@ -194,7 +194,7 @@ svn_cl__diff(apr_getopt_t *os,
svn_stringbuf_t *sb;
/* Check that the --summarize is passed as well. */
- if (!opt_state->summarize)
+ if (!opt_state->diff.summarize)
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("'--xml' option only valid with "
"'--summarize' option"));
@@ -349,14 +349,14 @@ svn_cl__diff(apr_getopt_t *os,
else
target2 = svn_dirent_join(new_target, path, iterpool);
- if (opt_state->summarize)
+ if (opt_state->diff.summarize)
SVN_ERR(svn_client_diff_summarize2
(target1,
&opt_state->start_revision,
target2,
&opt_state->end_revision,
opt_state->depth,
- ! opt_state->notice_ancestry,
+ ! opt_state->diff.notice_ancestry,
opt_state->changelists,
summarize_func, &target1,
ctx, iterpool));
@@ -369,12 +369,13 @@ svn_cl__diff(apr_getopt_t *os,
&(opt_state->end_revision),
NULL,
opt_state->depth,
- ! opt_state->notice_ancestry,
- opt_state->no_diff_deleted,
+ ! opt_state->diff.notice_ancestry,
+ opt_state->diff.no_diff_deleted,
show_copies_as_adds,
opt_state->force,
- ignore_prop_diff,
- opt_state->use_git_diff_format,
+ ignore_properties,
+ opt_state->diff.properties_only,
+ opt_state->diff.use_git_diff_format,
svn_cmdline_output_encoding(pool),
outstream,
errstream,
@@ -395,14 +396,14 @@ svn_cl__diff(apr_getopt_t *os,
peg_revision.kind = svn_path_is_url(path)
? svn_opt_revision_head : svn_opt_revision_working;
- if (opt_state->summarize)
+ if (opt_state->diff.summarize)
SVN_ERR(svn_client_diff_summarize_peg2
(truepath,
&peg_revision,
&opt_state->start_revision,
&opt_state->end_revision,
opt_state->depth,
- ! opt_state->notice_ancestry,
+ ! opt_state->diff.notice_ancestry,
opt_state->changelists,
summarize_func, &truepath,
ctx, iterpool));
@@ -415,12 +416,13 @@ svn_cl__diff(apr_getopt_t *os,
&opt_state->end_revision,
NULL,
opt_state->depth,
- ! opt_state->notice_ancestry,
- opt_state->no_diff_deleted,
+ ! opt_state->diff.notice_ancestry,
+ opt_state->diff.no_diff_deleted,
show_copies_as_adds,
opt_state->force,
- ignore_prop_diff,
- opt_state->use_git_diff_format,
+ ignore_properties,
+ opt_state->diff.properties_only,
+ opt_state->diff.use_git_diff_format,
svn_cmdline_output_encoding(pool),
outstream,
errstream,
Modified: subversion/branches/compressed-pristines/subversion/svn/export-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/export-cmd.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/export-cmd.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/export-cmd.c Thu Aug 16 10:17:48 2012
@@ -114,9 +114,15 @@ svn_cl__export(apr_getopt_t *os,
"the directory or use --force to overwrite"));
if (nwb.had_externals_error)
- return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
- _("Failure occurred processing one or more "
- "externals definitions"));
+ {
+ svn_error_t *externals_err;
+
+ externals_err = svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS,
+ NULL,
+ _("Failure occurred processing one or "
+ "more externals definitions"));
+ return svn_error_compose_create(externals_err, err);
+ }
return svn_error_trace(err);
}
Modified: subversion/branches/compressed-pristines/subversion/svn/help-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/help-cmd.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/help-cmd.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/help-cmd.c Thu Aug 16 10:17:48 2012
@@ -79,10 +79,11 @@ svn_cl__help(apr_getopt_t *os,
version_footer = svn_stringbuf_create(ra_desc_start, pool);
SVN_ERR(svn_ra_print_modules(version_footer, pool));
- return svn_opt_print_help3(os,
+ return svn_opt_print_help4(os,
"svn", /* ### erm, derive somehow? */
opt_state ? opt_state->version : FALSE,
opt_state ? opt_state->quiet : FALSE,
+ opt_state ? opt_state->verbose : FALSE,
version_footer->data,
help_header, /* already gettext()'d */
svn_cl__cmd_table,
Modified: subversion/branches/compressed-pristines/subversion/svn/import-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/import-cmd.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/import-cmd.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/import-cmd.c Thu Aug 16 10:17:48 2012
@@ -114,12 +114,13 @@ svn_cl__import(apr_getopt_t *os,
SVN_ERR(svn_cl__cleanup_log_msg
(ctx->log_msg_baton3,
- svn_client_import4(path,
+ svn_client_import5(path,
url,
opt_state->depth,
opt_state->no_ignore,
opt_state->force,
opt_state->revprop_table,
+ NULL, NULL, /* filter callback / baton */
(opt_state->quiet
? NULL : svn_cl__print_commit_info),
NULL,
Modified: subversion/branches/compressed-pristines/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/svn/log-cmd.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/svn/log-cmd.c (original)
+++ subversion/branches/compressed-pristines/subversion/svn/log-cmd.c Thu Aug 16 10:17:48 2012
@@ -24,6 +24,7 @@
#define APR_WANT_STRFUNC
#define APR_WANT_STDIO
#include <apr_want.h>
+#include <apr_fnmatch.h>
#include "svn_client.h"
#include "svn_compat.h"
@@ -70,6 +71,11 @@ struct log_receiver_baton
/* Stack which keeps track of merge revision nesting, using svn_revnum_t's */
apr_array_header_t *merge_stack;
+ /* Log message search pattern. Log entries will only be shown if the author,
+ * the log message, or a changed path matches this pattern. */
+ const char *search_pattern;
+ svn_boolean_t case_insensitive_search;
+
/* Pool for persistent allocations. */
apr_pool_t *pool;
};
@@ -80,6 +86,124 @@ struct log_receiver_baton
"------------------------------------------------------------------------\n"
+/* Display a diff of the subtree TARGET_PATH_OR_URL@TARGET_PEG_REVISION as
+ * it changed in the revision that LOG_ENTRY describes.
+ *
+ * Restrict the diff to depth DEPTH. Pass DIFF_EXTENSIONS along to the diff
+ * subroutine.
+ *
+ * Write the diff to OUTSTREAM and write any stderr output to ERRSTREAM.
+ * ### How is exit code handled? 0 and 1 -> SVN_NO_ERROR, else an svn error?
+ * ### Should we get rid of ERRSTREAM and use svn_error_t instead?
+ */
+static svn_error_t *
+display_diff(const svn_log_entry_t *log_entry,
+ const char *target_path_or_url,
+ const svn_opt_revision_t *target_peg_revision,
+ svn_depth_t depth,
+ const char *diff_extensions,
+ svn_stream_t *outstream,
+ svn_stream_t *errstream,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
+{
+ apr_array_header_t *diff_options;
+ svn_opt_revision_t start_revision;
+ svn_opt_revision_t end_revision;
+
+ /* Fall back to "" to get options initialized either way. */
+ if (diff_extensions)
+ diff_options = svn_cstring_split(diff_extensions, " \t\n\r",
+ TRUE, pool);
+ else
+ diff_options = NULL;
+
+ start_revision.kind = svn_opt_revision_number;
+ start_revision.value.number = log_entry->revision - 1;
+ end_revision.kind = svn_opt_revision_number;
+ end_revision.value.number = log_entry->revision;
+
+ SVN_ERR(svn_stream_puts(outstream, "\n"));
+ SVN_ERR(svn_client_diff_peg6(diff_options,
+ target_path_or_url,
+ target_peg_revision,
+ &start_revision, &end_revision,
+ NULL,
+ depth,
+ FALSE, /* ignore ancestry */
+ TRUE, /* no diff deleted */
+ 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,
+ ctx, pool));
+ SVN_ERR(svn_stream_puts(outstream, _("\n")));
+ return SVN_NO_ERROR;
+}
+
+
+/* Return TRUE if SEARCH_PATTERN matches the AUTHOR, DATE, LOG_MESSAGE,
+ * or a path in the set of keys of the CHANGED_PATHS hash. Else, return FALSE.
+ * Any of AUTHOR, DATE, LOG_MESSAGE, and CHANGED_PATHS may be NULL. */
+static svn_boolean_t
+match_search_pattern(const char *search_pattern,
+ const char *author,
+ const char *date,
+ const char *log_message,
+ apr_hash_t *changed_paths,
+ svn_boolean_t case_insensitive_search,
+ apr_pool_t *pool)
+{
+ /* Match any substring containing the pattern, like UNIX 'grep' does. */
+ const char *pattern = apr_psprintf(pool, "*%s*", search_pattern);
+ int flags = (case_insensitive_search ? APR_FNM_CASE_BLIND : 0);
+
+ /* Does the author match the search pattern? */
+ if (author && apr_fnmatch(pattern, author, flags) == APR_SUCCESS)
+ return TRUE;
+
+ /* Does the date the search pattern? */
+ if (date && apr_fnmatch(pattern, date, flags) == APR_SUCCESS)
+ return TRUE;
+
+ /* Does the log message the search pattern? */
+ if (log_message && apr_fnmatch(pattern, log_message, flags) == APR_SUCCESS)
+ return TRUE;
+
+ if (changed_paths)
+ {
+ apr_hash_index_t *hi;
+
+ /* Does a changed path match the search pattern? */
+ for (hi = apr_hash_first(pool, changed_paths);
+ hi;
+ hi = apr_hash_next(hi))
+ {
+ const char *path = svn__apr_hash_index_key(hi);
+ svn_log_changed_path2_t *log_item;
+
+ if (apr_fnmatch(pattern, path, flags) == APR_SUCCESS)
+ return TRUE;
+
+ /* Match copy-from paths, too. */
+ log_item = svn__apr_hash_index_val(hi);
+ if (log_item->copyfrom_path
+ && SVN_IS_VALID_REVNUM(log_item->copyfrom_rev)
+ && apr_fnmatch(pattern,
+ log_item->copyfrom_path, flags) == APR_SUCCESS)
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+
/* Implement `svn_log_entry_receiver_t', printing the logs in
* a human-readable and machine-parseable format.
*
@@ -196,6 +320,17 @@ log_entry_receiver(void *baton,
if (! lb->omit_log_message && message == NULL)
message = "";
+ if (lb->search_pattern &&
+ ! match_search_pattern(lb->search_pattern, author, date, message,
+ log_entry->changed_paths2,
+ lb->case_insensitive_search, pool))
+ {
+ if (log_entry->has_children)
+ APR_ARRAY_PUSH(lb->merge_stack, svn_revnum_t) = log_entry->revision;
+
+ return SVN_NO_ERROR;
+ }
+
SVN_ERR(svn_cmdline_printf(pool,
SEP_STRING "r%ld | %s | %s",
log_entry->revision, author, date));
@@ -282,44 +417,16 @@ log_entry_receiver(void *baton,
{
svn_stream_t *outstream;
svn_stream_t *errstream;
- apr_array_header_t *diff_options;
- svn_opt_revision_t start_revision;
- svn_opt_revision_t end_revision;
SVN_ERR(svn_stream_for_stdout(&outstream, pool));
SVN_ERR(svn_stream_for_stderr(&errstream, pool));
- /* Fall back to "" to get options initialized either way. */
- if (lb->diff_extensions)
- diff_options = svn_cstring_split(lb->diff_extensions, " \t\n\r",
- TRUE, pool);
- else
- diff_options = NULL;
+ SVN_ERR(display_diff(log_entry,
+ lb->target_path_or_url, &lb->target_peg_revision,
+ lb->depth, lb->diff_extensions,
+ outstream, errstream,
+ lb->ctx, pool));
- start_revision.kind = svn_opt_revision_number;
- start_revision.value.number = log_entry->revision - 1;
- 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_client_diff_peg6(diff_options,
- lb->target_path_or_url,
- &lb->target_peg_revision,
- &start_revision, &end_revision,
- NULL,
- lb->depth,
- FALSE, /* ignore ancestry */
- TRUE, /* no diff deleted */
- FALSE, /* show copies as adds */
- FALSE, /* ignore content type */
- FALSE, /* ignore prop diff */
- 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_close(outstream));
SVN_ERR(svn_stream_close(errstream));
}
@@ -385,13 +492,6 @@ log_entry_receiver_xml(void *baton,
svn_compat_log_revprops_out(&author, &date, &message, log_entry->revprops);
- if (author)
- author = svn_xml_fuzzy_escape(author, pool);
- if (date)
- date = svn_xml_fuzzy_escape(date, pool);
- if (message)
- message = svn_xml_fuzzy_escape(message, pool);
-
if (log_entry->revision == 0 && message == NULL)
return SVN_NO_ERROR;
@@ -404,6 +504,25 @@ log_entry_receiver_xml(void *baton,
return SVN_NO_ERROR;
}
+ /* Match search pattern before XML-escaping. */
+ if (lb->search_pattern &&
+ ! match_search_pattern(lb->search_pattern, author, date, message,
+ log_entry->changed_paths2,
+ lb->case_insensitive_search, pool))
+ {
+ if (log_entry->has_children)
+ APR_ARRAY_PUSH(lb->merge_stack, svn_revnum_t) = log_entry->revision;
+
+ return SVN_NO_ERROR;
+ }
+
+ if (author)
+ author = svn_xml_fuzzy_escape(author, pool);
+ if (date)
+ date = svn_xml_fuzzy_escape(date, pool);
+ if (message)
+ message = svn_xml_fuzzy_escape(message, pool);
+
revstr = apr_psprintf(pool, "%ld", log_entry->revision);
/* <logentry revision="xxx"> */
svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "logentry",
@@ -544,11 +663,11 @@ svn_cl__log(apr_getopt_t *os,
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("'quiet' and 'diff' options are "
"mutually exclusive"));
- if (opt_state->diff_cmd && (! opt_state->show_diff))
+ if (opt_state->diff.diff_cmd && (! opt_state->show_diff))
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("'diff-cmd' option requires 'diff' "
"option"));
- if (opt_state->internal_diff && (! opt_state->show_diff))
+ if (opt_state->diff.internal_diff && (! opt_state->show_diff))
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("'internal-diff' option requires "
"'diff' option"));
@@ -621,6 +740,8 @@ svn_cl__log(apr_getopt_t *os,
: opt_state->depth;
lb.diff_extensions = opt_state->extensions;
lb.merge_stack = apr_array_make(pool, 0, sizeof(svn_revnum_t));
+ lb.search_pattern = opt_state->search_pattern;
+ lb.case_insensitive_search = opt_state->case_insensitive_search;
lb.pool = pool;
if (opt_state->xml)