aboutsummaryrefslogtreecommitdiffstats
path: root/subversion/svn
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-04-29 19:16:59 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-04-29 19:16:59 +0000
commitc94cceea9c2262c5b2ad5f215bb9a8ae48b02764 (patch)
treedbb8174cbf6f1cc45b8de8031b18adb4030509a8 /subversion/svn
parentdc5d469d6574e9fb03bdd793658bb371315b306a (diff)
downloadsrc-c94cceea9c2262c5b2ad5f215bb9a8ae48b02764.tar.gz
src-c94cceea9c2262c5b2ad5f215bb9a8ae48b02764.zip
Vendor import of subversion-1.9.4.vendor/subversion/subversion-1.9.4
Notes
Notes: svn path=/vendor/subversion/dist/; revision=298794 svn path=/vendor/subversion/subversion-1.9.4/; revision=298795; tag=vendor/subversion/subversion-1.9.4
Diffstat (limited to 'subversion/svn')
-rw-r--r--subversion/svn/conflict-callbacks.c4
-rw-r--r--subversion/svn/diff-cmd.c29
-rw-r--r--subversion/svn/lock-cmd.c39
-rw-r--r--subversion/svn/unlock-cmd.c40
4 files changed, 102 insertions, 10 deletions
diff --git a/subversion/svn/conflict-callbacks.c b/subversion/svn/conflict-callbacks.c
index 356f59d95e05..a9cb39a2ade1 100644
--- a/subversion/svn/conflict-callbacks.c
+++ b/subversion/svn/conflict-callbacks.c
@@ -775,7 +775,7 @@ handle_text_conflict(svn_wc_conflict_result_t *result,
}
else
{
- if (knows_something)
+ if (knows_something || desc->is_binary)
*next_option++ = "r";
/* The 'mine-full' option selects the ".mine" file so only offer
@@ -994,7 +994,7 @@ handle_text_conflict(svn_wc_conflict_result_t *result,
the file if they've edited it, or at least looked at
the diff. */
if (opt->choice == svn_wc_conflict_choose_merged
- && ! knows_something)
+ && ! knows_something && diff_allowed)
{
SVN_ERR(svn_cmdline_fprintf(
stderr, iterpool,
diff --git a/subversion/svn/diff-cmd.c b/subversion/svn/diff-cmd.c
index 7a84736bee91..71853c7f2776 100644
--- a/subversion/svn/diff-cmd.c
+++ b/subversion/svn/diff-cmd.c
@@ -82,6 +82,7 @@ kind_to_word(svn_client_diff_summarize_kind_t kind)
struct summarize_baton_t
{
const char *anchor;
+ svn_boolean_t ignore_properties;
};
/* Print summary information about a given change as XML, implements the
@@ -98,6 +99,11 @@ summarize_xml(const svn_client_diff_summarize_t *summary,
* baton, and appending the target's relative path. */
const char *path = b->anchor;
svn_stringbuf_t *sb = svn_stringbuf_create_empty(pool);
+ const char *prop_change;
+
+ if (b->ignore_properties &&
+ summary->summarize_kind == svn_client_diff_summarize_kind_normal)
+ return SVN_NO_ERROR;
/* Tack on the target path, so we can differentiate between different parts
* of the output when we're given multiple targets. */
@@ -114,10 +120,14 @@ summarize_xml(const svn_client_diff_summarize_t *summary,
path = svn_dirent_local_style(path, pool);
}
+ prop_change = summary->prop_changed ? "modified" : "none";
+ if (b->ignore_properties)
+ prop_change = "none";
+
svn_xml_make_open_tag(&sb, pool, svn_xml_protect_pcdata, "path",
"kind", svn_cl__node_kind_str_xml(summary->node_kind),
"item", kind_to_word(summary->summarize_kind),
- "props", summary->prop_changed ? "modified" : "none",
+ "props", prop_change,
SVN_VA_NULL);
svn_xml_escape_cdata_cstring(&sb, path, pool);
@@ -135,6 +145,11 @@ summarize_regular(const svn_client_diff_summarize_t *summary,
{
struct summarize_baton_t *b = baton;
const char *path = b->anchor;
+ char prop_change;
+
+ if (b->ignore_properties &&
+ summary->summarize_kind == svn_client_diff_summarize_kind_normal)
+ return SVN_NO_ERROR;
/* Tack on the target path, so we can differentiate between different parts
* of the output when we're given multiple targets. */
@@ -155,11 +170,13 @@ summarize_regular(const svn_client_diff_summarize_t *summary,
* thus the blank spaces where information that is not relevant to
* a diff summary would go. */
- SVN_ERR(svn_cmdline_printf(pool,
- "%c%c %s\n",
+ prop_change = summary->prop_changed ? 'M' : ' ';
+ if (b->ignore_properties)
+ prop_change = ' ';
+
+ SVN_ERR(svn_cmdline_printf(pool, "%c%c %s\n",
kind_to_char(summary->summarize_kind),
- summary->prop_changed ? 'M' : ' ',
- path));
+ prop_change, path));
return svn_cmdline_fflush(stdout);
}
@@ -395,6 +412,7 @@ svn_cl__diff(apr_getopt_t *os,
if (opt_state->diff.summarize)
{
summarize_baton.anchor = target1;
+ summarize_baton.ignore_properties = ignore_properties;
SVN_ERR(svn_client_diff_summarize2(
target1,
@@ -447,6 +465,7 @@ svn_cl__diff(apr_getopt_t *os,
if (opt_state->diff.summarize)
{
summarize_baton.anchor = truepath;
+ summarize_baton.ignore_properties = ignore_properties;
SVN_ERR(svn_client_diff_summarize_peg2(
truepath,
&peg_revision,
diff --git a/subversion/svn/lock-cmd.c b/subversion/svn/lock-cmd.c
index c2795da9add8..e527ff858934 100644
--- a/subversion/svn/lock-cmd.c
+++ b/subversion/svn/lock-cmd.c
@@ -80,6 +80,29 @@ get_comment(const char **comment, svn_client_ctx_t *ctx,
return SVN_NO_ERROR;
}
+/* Baton for notify_lock_handler */
+struct notify_lock_baton_t
+{
+ void *inner_baton;
+ svn_wc_notify_func2_t inner_notify;
+ svn_boolean_t had_failure;
+};
+
+/* Implements svn_wc_notify_func2_t for svn_cl__lock */
+static void
+notify_lock_handler(void *baton,
+ const svn_wc_notify_t *notify,
+ apr_pool_t *scratch_pool)
+{
+ struct notify_lock_baton_t *nlb = baton;
+
+ if (notify->action == svn_wc_notify_failed_lock)
+ nlb->had_failure = TRUE;
+
+ if (nlb->inner_notify)
+ nlb->inner_notify(nlb->inner_baton, notify, scratch_pool);
+}
+
/* This implements the `svn_opt_subcommand_t' interface. */
svn_error_t *
svn_cl__lock(apr_getopt_t *os,
@@ -90,6 +113,7 @@ svn_cl__lock(apr_getopt_t *os,
svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
apr_array_header_t *targets;
const char *comment;
+ struct notify_lock_baton_t nlb;
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
opt_state->targets,
@@ -106,5 +130,18 @@ svn_cl__lock(apr_getopt_t *os,
SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
- return svn_client_lock(targets, comment, opt_state->force, ctx, pool);
+ nlb.inner_notify = ctx->notify_func2;
+ nlb.inner_baton = ctx->notify_baton2;
+ nlb.had_failure = FALSE;
+
+ ctx->notify_func2 = notify_lock_handler;
+ ctx->notify_baton2 = &nlb;
+
+ SVN_ERR(svn_client_lock(targets, comment, opt_state->force, ctx, pool));
+
+ if (nlb.had_failure)
+ return svn_error_create(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("One or more locks could not be obtained"));
+
+ return SVN_NO_ERROR;
}
diff --git a/subversion/svn/unlock-cmd.c b/subversion/svn/unlock-cmd.c
index 0f94d2a2201f..3818d1f2450b 100644
--- a/subversion/svn/unlock-cmd.c
+++ b/subversion/svn/unlock-cmd.c
@@ -39,6 +39,29 @@
/*** Code. ***/
+/* Baton for notify_unlock_handler */
+struct notify_unlock_baton_t
+{
+ void *inner_baton;
+ svn_wc_notify_func2_t inner_notify;
+ svn_boolean_t had_failure;
+};
+
+/* Implements svn_wc_notify_func2_t for svn_cl__unlock */
+static void
+notify_unlock_handler(void *baton,
+ const svn_wc_notify_t *notify,
+ apr_pool_t *scratch_pool)
+{
+ struct notify_unlock_baton_t *nub = baton;
+
+ if (notify->action == svn_wc_notify_failed_unlock)
+ nub->had_failure = TRUE;
+
+ if (nub->inner_notify)
+ nub->inner_notify(nub->inner_baton, notify, scratch_pool);
+}
+
/* This implements the `svn_opt_subcommand_t' interface. */
svn_error_t *
@@ -49,6 +72,7 @@ svn_cl__unlock(apr_getopt_t *os,
svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
apr_array_header_t *targets;
+ struct notify_unlock_baton_t nub;
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
opt_state->targets,
@@ -63,6 +87,18 @@ svn_cl__unlock(apr_getopt_t *os,
SVN_ERR(svn_cl__assert_homogeneous_target_type(targets));
- return svn_error_trace(
- svn_client_unlock(targets, opt_state->force, ctx, scratch_pool));
+ nub.inner_notify = ctx->notify_func2;
+ nub.inner_baton = ctx->notify_baton2;
+ nub.had_failure = FALSE;
+
+ ctx->notify_func2 = notify_unlock_handler;
+ ctx->notify_baton2 = &nub;
+
+ SVN_ERR(svn_client_unlock(targets, opt_state->force, ctx, scratch_pool));
+
+ if (nub.had_failure)
+ return svn_error_create(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("One or more locks could not be released"));
+
+ return SVN_NO_ERROR;
}