aboutsummaryrefslogtreecommitdiff
path: root/subversion/svn
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/svn')
-rw-r--r--subversion/svn/cl.h17
-rw-r--r--subversion/svn/conflict-callbacks.c85
-rw-r--r--subversion/svn/file-merge.c20
-rw-r--r--subversion/svn/merge-cmd.c9
-rw-r--r--subversion/svn/mergeinfo-cmd.c19
-rw-r--r--subversion/svn/svn.c49
-rw-r--r--subversion/svn/util.c40
7 files changed, 115 insertions, 124 deletions
diff --git a/subversion/svn/cl.h b/subversion/svn/cl.h
index f7ebee668290..8cc358c9822d 100644
--- a/subversion/svn/cl.h
+++ b/subversion/svn/cl.h
@@ -806,23 +806,6 @@ svn_cl__local_style_skip_ancestor(const char *parent_path,
const char *path,
apr_pool_t *pool);
-/* Check that PATH_OR_URL1@REVISION1 is related to PATH_OR_URL2@REVISION2.
- * Raise an error if not.
- *
- * ### Ideally we would also check that they are on different lines of
- * history. That is easy in common cases, but to give a correct answer in
- * general we need to know the operative revision(s) as well. For example,
- * when one location is the branch point from which the other branch was
- * copied.
- */
-svn_error_t *
-svn_cl__check_related_source_and_target(const char *path_or_url1,
- const svn_opt_revision_t *revision1,
- const char *path_or_url2,
- const svn_opt_revision_t *revision2,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool);
-
/* If the user is setting a mime-type to mark one of the TARGETS as binary,
* as determined by property name PROPNAME and value PROPVAL, then check
* whether Subversion's own binary-file detection recognizes the target as
diff --git a/subversion/svn/conflict-callbacks.c b/subversion/svn/conflict-callbacks.c
index 096a1892cdec..d5a98ddf6fbb 100644
--- a/subversion/svn/conflict-callbacks.c
+++ b/subversion/svn/conflict-callbacks.c
@@ -453,7 +453,7 @@ static const resolver_option_t text_conflict_options[] =
-1 },
{ "df", N_("show diff"), N_("show all changes made to merged file"),
-1 },
- { "r", N_("resolved"), N_("accept merged version of file"),
+ { "r", N_("mark resolved"), N_("accept merged version of file"),
svn_wc_conflict_choose_merged },
{ "", "", "", svn_wc_conflict_choose_unspecified },
{ "dc", N_("display conflict"), N_("show all conflicts "
@@ -473,13 +473,13 @@ static const resolver_option_t text_conflict_options[] =
"(same) [theirs-full]"),
svn_wc_conflict_choose_theirs_full },
{ "", "", "", svn_wc_conflict_choose_unspecified },
- { "p", N_("postpone"), N_("mark the conflict to be resolved later"
- " [postpone]"),
- svn_wc_conflict_choose_postpone },
{ "m", N_("merge"), N_("use internal merge tool to resolve "
"conflict"), -1 },
{ "l", N_("launch tool"), N_("launch external tool to resolve "
"conflict [launch]"), -1 },
+ { "p", N_("postpone"), N_("mark the conflict to be resolved later"
+ " [postpone]"),
+ svn_wc_conflict_choose_postpone },
{ "q", N_("quit resolution"), N_("postpone all remaining conflicts"),
svn_wc_conflict_choose_postpone },
{ "s", N_("show all options"), N_("show this list (also 'h', '?')"), -1 },
@@ -489,9 +489,6 @@ static const resolver_option_t text_conflict_options[] =
/* Resolver options for a property conflict */
static const resolver_option_t prop_conflict_options[] =
{
- { "p", N_("postpone"), N_("mark the conflict to be resolved later"
- " [postpone]"),
- svn_wc_conflict_choose_postpone },
{ "mf", N_("my version"), N_("accept my version of entire file (even "
"non-conflicts) [mine-full]"),
svn_wc_conflict_choose_mine_full },
@@ -501,8 +498,11 @@ static const resolver_option_t prop_conflict_options[] =
{ "dc", N_("display conflict"), N_("show conflicts in this property"), -1 },
{ "e", N_("edit property"), N_("change merged property value in an editor"
" [edit]"), -1 },
- { "r", N_("resolved"), N_("accept edited version of property"),
+ { "r", N_("mark resolved"), N_("accept edited version of property"),
svn_wc_conflict_choose_merged },
+ { "p", N_("postpone"), N_("mark the conflict to be resolved later"
+ " [postpone]"),
+ svn_wc_conflict_choose_postpone },
{ "q", N_("quit resolution"), N_("postpone all remaining conflicts"),
svn_wc_conflict_choose_postpone },
{ "h", N_("help"), N_("show this help (also '?')"), -1 },
@@ -512,15 +512,15 @@ static const resolver_option_t prop_conflict_options[] =
/* Resolver options for an obstructued addition */
static const resolver_option_t obstructed_add_options[] =
{
- { "p", N_("postpone"), N_("mark the conflict to be resolved later"
- " [postpone]"),
- svn_wc_conflict_choose_postpone },
{ "mf", N_("my version"), N_("accept pre-existing item (ignore "
"upstream addition) [mine-full]"),
svn_wc_conflict_choose_mine_full },
{ "tf", N_("their version"), N_("accept incoming item (overwrite "
"pre-existing item) [theirs-full]"),
svn_wc_conflict_choose_theirs_full },
+ { "p", N_("postpone"), N_("mark the conflict to be resolved later"
+ " [postpone]"),
+ svn_wc_conflict_choose_postpone },
{ "q", N_("quit resolution"), N_("postpone all remaining conflicts"),
svn_wc_conflict_choose_postpone },
{ "h", N_("help"), N_("show this help (also '?')"), -1 },
@@ -530,10 +530,10 @@ static const resolver_option_t obstructed_add_options[] =
/* Resolver options for a tree conflict */
static const resolver_option_t tree_conflict_options[] =
{
+ { "r", N_("mark resolved"), N_("accept current working copy state"),
+ svn_wc_conflict_choose_merged },
{ "p", N_("postpone"), N_("resolve the conflict later [postpone]"),
svn_wc_conflict_choose_postpone },
- { "r", N_("resolved"), N_("accept current working copy state"),
- svn_wc_conflict_choose_merged },
{ "q", N_("quit resolution"), N_("postpone all remaining conflicts"),
svn_wc_conflict_choose_postpone },
{ "h", N_("help"), N_("show this help (also '?')"), -1 },
@@ -542,30 +542,46 @@ static const resolver_option_t tree_conflict_options[] =
static const resolver_option_t tree_conflict_options_update_moved_away[] =
{
- { "p", N_("postpone"), N_("resolve the conflict later [postpone]"),
- svn_wc_conflict_choose_postpone },
- { "mc", N_("my side of conflict"), N_("apply update to the move destination"
- " [mine-conflict]"),
+ { "mc", N_("apply update (recommended)"),
+ N_("apply update to the move destination"
+ " [mine-conflict]"),
svn_wc_conflict_choose_mine_conflict },
- { "r", N_("resolved"), N_("mark resolved "
- "(the move will become a copy)"),
+ { "r", N_("discard update (breaks move)"), N_("discard update, mark "
+ "resolved, the move will "
+ "will become a copy"),
svn_wc_conflict_choose_merged },
+ { "p", N_("postpone"), N_("resolve the conflict later [postpone]"),
+ svn_wc_conflict_choose_postpone },
{ "q", N_("quit resolution"), N_("postpone all remaining conflicts"),
svn_wc_conflict_choose_postpone },
{ "h", N_("help"), N_("show this help (also '?')"), -1 },
{ NULL }
};
-static const resolver_option_t tree_conflict_options_update_deleted[] =
+static const resolver_option_t tree_conflict_options_update_edit_moved_away[] =
{
+ { "mc", N_("apply update to move destination"),
+ N_("apply incoming update to move destination"
+ " [mine-conflict]"),
+ svn_wc_conflict_choose_mine_conflict },
{ "p", N_("postpone"), N_("resolve the conflict later [postpone]"),
svn_wc_conflict_choose_postpone },
- { "mc", N_("my side of conflict"), N_("keep any moves affected "
- "by this deletion [mine-conflict]"),
+ { "q", N_("quit resolution"), N_("postpone all remaining conflicts"),
+ svn_wc_conflict_choose_postpone },
+ { "h", N_("help"), N_("show this help (also '?')"), -1 },
+ { NULL }
+};
+
+static const resolver_option_t tree_conflict_options_update_deleted[] =
+{
+ { "mc", N_("keep affected local moves"), N_("keep any local moves affected "
+ "by this deletion [mine-conflict]"),
svn_wc_conflict_choose_mine_conflict },
- { "r", N_("resolved"), N_("mark resolved (any affected moves will "
- "become copies)"),
+ { "r", N_("mark resolved (breaks moves)"), N_("mark resolved, any affected "
+ "moves will become copies"),
svn_wc_conflict_choose_merged },
+ { "p", N_("postpone"), N_("resolve the conflict later [postpone]"),
+ svn_wc_conflict_choose_postpone },
{ "q", N_("quit resolution"), N_("postpone all remaining conflicts"),
svn_wc_conflict_choose_postpone },
{ "h", N_("help"), N_("show this help (also '?')"), -1 },
@@ -574,14 +590,14 @@ static const resolver_option_t tree_conflict_options_update_deleted[] =
static const resolver_option_t tree_conflict_options_update_replaced[] =
{
- { "p", N_("postpone"), N_("resolve the conflict later [postpone]"),
- svn_wc_conflict_choose_postpone },
- { "mc", N_("my side of conflict"), N_("keep any moves affected by this "
- "replacement [mine-conflict]"),
+ { "mc", N_("keep affected local moves"), N_("keep any moves affected by this "
+ "replacement [mine-conflict]"),
svn_wc_conflict_choose_mine_conflict },
- { "r", N_("resolved"), N_("mark resolved (any affected moves will "
- "become copies)"),
+ { "r", N_("mark resolved (breaks moves)"), N_("mark resolved (any affected "
+ "moves will become copies)"),
svn_wc_conflict_choose_merged },
+ { "p", N_("postpone"), N_("resolve the conflict later [postpone]"),
+ svn_wc_conflict_choose_postpone },
{ "q", N_("quit resolution"), N_("postpone all remaining conflicts"),
svn_wc_conflict_choose_postpone },
{ "h", N_("help"), N_("show this help (also '?')"), -1 },
@@ -925,7 +941,7 @@ handle_text_conflict(svn_wc_conflict_result_t *result,
SVN_ERR(svn_cmdline_fprintf(
stderr, iterpool,
_("Invalid option; use diff/edit/merge/launch "
- "before choosing 'resolved'.\n\n")));
+ "before choosing 'mark resolved'.\n\n")));
continue;
}
@@ -1078,7 +1094,12 @@ handle_tree_conflict(svn_wc_conflict_result_t *result,
desc->operation == svn_wc_operation_switch)
{
if (desc->reason == svn_wc_conflict_reason_moved_away)
- tc_opts = tree_conflict_options_update_moved_away;
+ {
+ if (desc->action == svn_wc_conflict_action_edit)
+ tc_opts = tree_conflict_options_update_edit_moved_away;
+ else
+ tc_opts = tree_conflict_options_update_moved_away;
+ }
else if (desc->reason == svn_wc_conflict_reason_deleted)
tc_opts = tree_conflict_options_update_deleted;
else if (desc->reason == svn_wc_conflict_reason_replaced)
diff --git a/subversion/svn/file-merge.c b/subversion/svn/file-merge.c
index 43ebba920406..c64f5772df45 100644
--- a/subversion/svn/file-merge.c
+++ b/subversion/svn/file-merge.c
@@ -655,6 +655,8 @@ merge_chunks(apr_array_header_t **merged_chunk,
svn_stringbuf_appendcstr(
prompt,
_("Select: (1) use their version, (2) use your version,\n"
+ " (12) their version first, then yours,\n"
+ " (21) your version first, then theirs,\n"
" (e1) edit their version and use the result,\n"
" (e2) edit your version and use the result,\n"
" (eb) edit both versions and use the result,\n"
@@ -679,6 +681,24 @@ merge_chunks(apr_array_header_t **merged_chunk,
*merged_chunk = chunk2;
break;
}
+ if (strcmp(answer, "12") == 0)
+ {
+ *merged_chunk = apr_array_make(result_pool,
+ chunk1->nelts + chunk2->nelts,
+ sizeof(svn_stringbuf_t *));
+ apr_array_cat(*merged_chunk, chunk1);
+ apr_array_cat(*merged_chunk, chunk2);
+ break;
+ }
+ if (strcmp(answer, "21") == 0)
+ {
+ *merged_chunk = apr_array_make(result_pool,
+ chunk1->nelts + chunk2->nelts,
+ sizeof(svn_stringbuf_t *));
+ apr_array_cat(*merged_chunk, chunk2);
+ apr_array_cat(*merged_chunk, chunk1);
+ break;
+ }
else if (strcmp(answer, "p") == 0)
{
*merged_chunk = NULL;
diff --git a/subversion/svn/merge-cmd.c b/subversion/svn/merge-cmd.c
index c14f769a8d26..17507a2cbaee 100644
--- a/subversion/svn/merge-cmd.c
+++ b/subversion/svn/merge-cmd.c
@@ -101,15 +101,6 @@ run_merge(svn_boolean_t two_sources_specified,
&& (first_range_end.kind == svn_opt_revision_unspecified))
{
ranges_to_merge = NULL;
-
- /* This must be a 'sync' merge so check branch relationship. */
- if (opt_state->verbose)
- SVN_ERR(svn_cmdline_printf(
- scratch_pool, _("--- Checking branch relationship\n")));
- SVN_ERR_W(svn_cl__check_related_source_and_target(
- sourcepath1, &peg_revision1,
- targetpath, &unspecified_revision, ctx, scratch_pool),
- _("Source and target must be different but related branches"));
}
if (opt_state->verbose)
diff --git a/subversion/svn/mergeinfo-cmd.c b/subversion/svn/mergeinfo-cmd.c
index a78c42a6c388..41edcdafc730 100644
--- a/subversion/svn/mergeinfo-cmd.c
+++ b/subversion/svn/mergeinfo-cmd.c
@@ -297,11 +297,6 @@ svn_cl__mergeinfo(apr_getopt_t *os,
tgt_peg_revision.kind = svn_opt_revision_base;
}
- SVN_ERR_W(svn_cl__check_related_source_and_target(source, &src_peg_revision,
- target, &tgt_peg_revision,
- ctx, pool),
- _("Source and target must be different but related branches"));
-
src_start_revision = &(opt_state->start_revision);
if (opt_state->end_revision.kind == svn_opt_revision_unspecified)
src_end_revision = src_start_revision;
@@ -311,22 +306,32 @@ svn_cl__mergeinfo(apr_getopt_t *os,
/* Do the real work, depending on the requested data flavor. */
if (opt_state->show_revs == svn_cl__show_revs_merged)
{
+ apr_array_header_t *revprops;
+
+ /* We need only revisions number, not revision properties. */
+ revprops = apr_array_make(pool, 0, sizeof(const char *));
+
SVN_ERR(svn_client_mergeinfo_log2(TRUE, target, &tgt_peg_revision,
source, &src_peg_revision,
src_start_revision,
src_end_revision,
print_log_rev, NULL,
- TRUE, depth, NULL, ctx,
+ TRUE, depth, revprops, ctx,
pool));
}
else if (opt_state->show_revs == svn_cl__show_revs_eligible)
{
+ apr_array_header_t *revprops;
+
+ /* We need only revisions number, not revision properties. */
+ revprops = apr_array_make(pool, 0, sizeof(const char *));
+
SVN_ERR(svn_client_mergeinfo_log2(FALSE, target, &tgt_peg_revision,
source, &src_peg_revision,
src_start_revision,
src_end_revision,
print_log_rev, NULL,
- TRUE, depth, NULL, ctx,
+ TRUE, depth, revprops, ctx,
pool));
}
else
diff --git a/subversion/svn/svn.c b/subversion/svn/svn.c
index cbcec87cf07a..5432e8bac086 100644
--- a/subversion/svn/svn.c
+++ b/subversion/svn/svn.c
@@ -484,9 +484,19 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] =
{'r', 'q', 'N', opt_depth, opt_force, opt_ignore_externals} },
{ "cleanup", svn_cl__cleanup, {0}, N_
- ("Recursively clean up the working copy, removing locks, resuming\n"
+ ("Recursively clean up the working copy, removing write locks, resuming\n"
"unfinished operations, etc.\n"
- "usage: cleanup [WCPATH...]\n"),
+ "usage: cleanup [WCPATH...]\n"
+ "\n"
+ " Finish any unfinished business in the working copy at WCPATH, and remove\n"
+ " write locks (shown as 'L' by the 'svn status' command) from the working\n"
+ " copy. Usually, this is only necessary if a Subversion client has crashed\n"
+ " while using the working copy, leaving it in an unusable state.\n"
+ "\n"
+ " WARNING: There is no mechanism that will protect write locks still\n"
+ " being used by other Subversion clients. Running this command\n"
+ " while another client is using the working copy can corrupt\n"
+ " the working copy beyond repair!\n"),
{opt_merge_cmd} },
{ "commit", svn_cl__commit, {"ci"},
@@ -750,18 +760,18 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] =
* (with quotes and newlines removed). */
"Merge changes into a working copy.\n"
"usage: 1. merge SOURCE[@REV] [TARGET_WCPATH]\n"
-" (the 'automatic' merge)\n"
+" (the 'complete' merge)\n"
" 2. merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]\n"
" (the 'cherry-pick' merge)\n"
" 3. merge SOURCE1[@REV1] SOURCE2[@REV2] [TARGET_WCPATH]\n"
" (the '2-URL' merge)\n"
"\n"
" 1. This form, with one source path and no revision range, is called\n"
-" an 'automatic' merge:\n"
+" a 'complete' merge:\n"
"\n"
" svn merge SOURCE[@REV] [TARGET_WCPATH]\n"
"\n"
-" The automatic merge is used for the 'sync' and 'reintegrate' merges\n"
+" The complete merge is used for the 'sync' and 'reintegrate' merges\n"
" in the 'feature branch' pattern described below. It finds all the\n"
" changes on the source branch that have not already been merged to the\n"
" target branch, and merges them into the working copy. Merge tracking\n"
@@ -900,7 +910,7 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] =
" of 'REV' is the base revision (usually the revision last updated to).\n"
"\n"
" TARGET_WCPATH is a working copy path; if omitted, '.' is generally\n"
-" assumed. The special cases noted above in the 'automatic' merge form\n"
+" assumed. The special cases noted above in the 'complete' merge form\n"
" also apply here.\n"
"\n"
" The revision ranges to be merged are specified by the '-r' and/or '-c'\n"
@@ -971,7 +981,7 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] =
" The three branches involved can be completely unrelated.\n"
"\n"
" TARGET_WCPATH is a working copy path; if omitted, '.' is generally\n"
-" assumed. The special cases noted above in the 'automatic' merge form\n"
+" assumed. The special cases noted above in the 'complete' merge form\n"
" also apply here.\n"
"\n"
" SOURCE1 and/or SOURCE2 can also be specified as a working copy path,\n"
@@ -1088,7 +1098,7 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] =
" shows, from left to right:\n"
" the youngest common ancestor of the branches;\n"
" the latest full merge in either direction, and thus the common base\n"
- " that will be used for the next automatic merge;\n"
+ " that will be used for the next complete merge;\n"
" the repository path and revision number of the tip of each branch.\n"
"\n"
" 2. Print the revision numbers on SOURCE that have been merged to TARGET\n"
@@ -1430,9 +1440,10 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] =
" ' ' no modifications\n"
" 'C' Conflicted\n"
" 'M' Modified\n"
- " Third column: Whether the working copy directory is locked\n"
- " ' ' not locked\n"
- " 'L' locked\n"
+ " Third column: Whether the working copy is locked for writing by\n"
+ " another Subversion client modifying the working copy\n"
+ " ' ' not locked for writing\n"
+ " 'L' locked for writing\n"
" Fourth column: Scheduled commit will contain addition-with-history\n"
" ' ' no history scheduled with commit\n"
" '+' history scheduled with commit\n"
@@ -1440,16 +1451,16 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] =
" ' ' normal\n"
" 'S' the item has a Switched URL relative to the parent\n"
" 'X' a versioned file created by an eXternals definition\n"
- " Sixth column: Repository lock token\n"
+ " Sixth column: Whether the item is locked in repository for exclusive commit\n"
" (without -u)\n"
- " ' ' no lock token\n"
- " 'K' lock token present\n"
+ " ' ' not locked by this working copy\n"
+ " 'K' locked by this working copy, but lock might be stolen or broken\n"
" (with -u)\n"
- " ' ' not locked in repository, no lock token\n"
- " 'K' locked in repository, lock toKen present\n"
- " 'O' locked in repository, lock token in some Other working copy\n"
- " 'T' locked in repository, lock token present but sTolen\n"
- " 'B' not locked in repository, lock token present but Broken\n"
+ " ' ' not locked in repository, not locked by this working copy\n"
+ " 'K' locked in repository, lock owned by this working copy\n"
+ " 'O' locked in repository, lock owned by another working copy\n"
+ " 'T' locked in repository, lock owned by this working copy was stolen\n"
+ " 'B' not locked in repository, lock owned by this working copy is broken\n"
" Seventh column: Whether the item is the victim of a tree conflict\n"
" ' ' normal\n"
" 'C' tree-Conflicted\n"
diff --git a/subversion/svn/util.c b/subversion/svn/util.c
index 5d386f8bdc97..092bc7e3afcf 100644
--- a/subversion/svn/util.c
+++ b/subversion/svn/util.c
@@ -1012,46 +1012,6 @@ svn_cl__local_style_skip_ancestor(const char *parent_path,
return svn_dirent_local_style(relpath ? relpath : path, pool);
}
-/* Return a string of the form "PATH_OR_URL@REVISION". */
-static const char *
-path_for_display(const char *path_or_url,
- const svn_opt_revision_t *revision,
- apr_pool_t *pool)
-{
- const char *rev_str = svn_opt__revision_to_string(revision, pool);
-
- if (! svn_path_is_url(path_or_url))
- path_or_url = svn_dirent_local_style(path_or_url, pool);
- return apr_psprintf(pool, "%s@%s", path_or_url, rev_str);
-}
-
-svn_error_t *
-svn_cl__check_related_source_and_target(const char *path_or_url1,
- const svn_opt_revision_t *revision1,
- const char *path_or_url2,
- const svn_opt_revision_t *revision2,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool)
-{
- const char *ancestor_url;
- svn_revnum_t ancestor_rev;
-
- SVN_ERR(svn_client__youngest_common_ancestor(
- &ancestor_url, &ancestor_rev,
- path_or_url1, revision1, path_or_url2, revision2,
- ctx, pool, pool));
-
- if (ancestor_url == NULL)
- {
- return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("Source and target have no common ancestor: "
- "'%s' and '%s'"),
- path_for_display(path_or_url1, revision1, pool),
- path_for_display(path_or_url2, revision2, pool));
- }
- return SVN_NO_ERROR;
-}
-
svn_error_t *
svn_cl__propset_print_binary_mime_type_warning(apr_array_header_t *targets,
const char *propname,