Modified: subversion/branches/fsx-1.10/subversion/svn/auth-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/auth-cmd.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svn/auth-cmd.c (original) +++ subversion/branches/fsx-1.10/subversion/svn/auth-cmd.c Sun Jun 14 20:58:10 2015 @@ -96,6 +96,39 @@ show_cert_failures(const char *failure_s return SVN_NO_ERROR; } + +/* decodes from format we store certs in for auth creds and + * turns parsing errors into warnings if PRINT_WARNING is TRUE + * and ignores them otherwise. returns NULL if it couldn't + * parse a cert for any reason. */ +static svn_x509_certinfo_t * +parse_certificate(const svn_string_t *ascii_cert, + svn_boolean_t print_warning, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) +{ + svn_x509_certinfo_t *certinfo; + const svn_string_t *der_cert; + svn_error_t *err; + + /* Convert header-less PEM to DER by undoing base64 encoding. */ + der_cert = svn_base64_decode_string(ascii_cert, scratch_pool); + + err = svn_x509_parse_cert(&certinfo, der_cert->data, der_cert->len, + result_pool, scratch_pool); + if (err) + { + /* Just display X.509 parsing errors as warnings and continue */ + if (print_warning) + svn_handle_warning2(stderr, err, "svn: "); + svn_error_clear(err); + return NULL; + } + + return certinfo; +} + + struct walk_credentials_baton_t { int matches; @@ -115,12 +148,58 @@ match_pattern(const char *pattern, const return (apr_fnmatch(p, value, flags) == APR_SUCCESS); } +static svn_boolean_t +match_certificate(svn_x509_certinfo_t **certinfo, + const char *pattern, + const svn_string_t *ascii_cert, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) +{ + const char *value; + const svn_checksum_t *checksum; + const apr_array_header_t *hostnames; + int i; + + *certinfo = parse_certificate(ascii_cert, FALSE, result_pool, scratch_pool); + if (*certinfo == NULL) + return FALSE; + + value = svn_x509_certinfo_get_subject(*certinfo, scratch_pool); + if (match_pattern(pattern, value, FALSE, scratch_pool)) + return TRUE; + + value = svn_x509_certinfo_get_issuer(*certinfo, scratch_pool); + if (match_pattern(pattern, value, FALSE, scratch_pool)) + return TRUE; + + checksum = svn_x509_certinfo_get_digest(*certinfo); + value = svn_checksum_to_cstring_display(checksum, scratch_pool); + if (match_pattern(pattern, value, TRUE, scratch_pool)) + return TRUE; + + hostnames = svn_x509_certinfo_get_hostnames(*certinfo); + if (hostnames) + { + for (i = 0; i < hostnames->nelts; i++) + { + const char *hostname = APR_ARRAY_IDX(hostnames, i, const char *); + if (match_pattern(pattern, hostname, TRUE, scratch_pool)) + return TRUE; + } + } + + return FALSE; +} + + static svn_error_t * match_credential(svn_boolean_t *match, + svn_x509_certinfo_t **certinfo, const char *cred_kind, const char *realmstring, apr_array_header_t *patterns, apr_array_header_t *cred_items, + apr_pool_t *result_pool, apr_pool_t *scratch_pool) { int i; @@ -152,7 +231,8 @@ match_credential(svn_boolean_t *match, strcmp(key, SVN_CONFIG_AUTHN_PASSPHRASE_KEY) == 0) continue; /* don't match secrets */ else if (strcmp(key, SVN_CONFIG_AUTHN_ASCII_CERT_KEY) == 0) - continue; /* don't match base64 data */ + *match = match_certificate(certinfo, pattern, value, + result_pool, iterpool); else *match = match_pattern(pattern, value->data, FALSE, iterpool); @@ -168,25 +248,15 @@ match_credential(svn_boolean_t *match, } static svn_error_t * -show_cert(const svn_string_t *pem_cert, apr_pool_t *scratch_pool) +show_cert(svn_x509_certinfo_t *certinfo, const svn_string_t *pem_cert, + apr_pool_t *scratch_pool) { - const svn_string_t *der_cert; - svn_x509_certinfo_t *certinfo; const apr_array_header_t *hostnames; - svn_error_t *err; - /* Convert header-less PEM to DER by undoing base64 encoding. */ - der_cert = svn_base64_decode_string(pem_cert, scratch_pool); - - err = svn_x509_parse_cert(&certinfo, der_cert->data, der_cert->len, - scratch_pool, scratch_pool); - if (err) - { - /* Just display X.509 parsing errors as warnings and continue */ - svn_handle_warning2(stderr, err, "svn: "); - svn_error_clear(err); - return SVN_NO_ERROR; - } + if (certinfo == NULL) + certinfo = parse_certificate(pem_cert, TRUE, scratch_pool, scratch_pool); + if (certinfo == NULL) + return SVN_NO_ERROR; SVN_ERR(svn_cmdline_printf(scratch_pool, _("Subject: %s\n"), svn_x509_certinfo_get_subject(certinfo, scratch_pool))); @@ -229,6 +299,7 @@ list_credential(const char *cred_kind, const char *realmstring, apr_array_header_t *cred_items, svn_boolean_t show_passwords, + svn_x509_certinfo_t *certinfo, apr_pool_t *scratch_pool) { int i; @@ -275,7 +346,7 @@ list_credential(const char *cred_kind, else if (strcmp(key, SVN_CONFIG_AUTHN_USERNAME_KEY) == 0) SVN_ERR(svn_cmdline_printf(iterpool, _("Username: %s\n"), value->data)); else if (strcmp(key, SVN_CONFIG_AUTHN_ASCII_CERT_KEY) == 0) - SVN_ERR(show_cert(value, iterpool)); + SVN_ERR(show_cert(certinfo, value, iterpool)); else if (strcmp(key, SVN_CONFIG_AUTHN_FAILURES_KEY) == 0) SVN_ERR(show_cert_failures(value->data, iterpool)); else @@ -298,6 +369,7 @@ walk_credentials(svn_boolean_t *delete_c { struct walk_credentials_baton_t *b = baton; apr_array_header_t *sorted_cred_items; + svn_x509_certinfo_t *certinfo = NULL; *delete_cred = FALSE; @@ -308,9 +380,9 @@ walk_credentials(svn_boolean_t *delete_c { svn_boolean_t match; - SVN_ERR(match_credential(&match, cred_kind, realmstring, + SVN_ERR(match_credential(&match, &certinfo, cred_kind, realmstring, b->patterns, sorted_cred_items, - scratch_pool)); + scratch_pool, scratch_pool)); if (!match) return SVN_NO_ERROR; } @@ -319,7 +391,7 @@ walk_credentials(svn_boolean_t *delete_c if (b->list) SVN_ERR(list_credential(cred_kind, realmstring, sorted_cred_items, - b->show_passwords, scratch_pool)); + b->show_passwords, certinfo, scratch_pool)); if (b->delete) { *delete_cred = TRUE; @@ -373,7 +445,7 @@ svn_cl__auth(apr_getopt_t *os, void *bat SVN_ERR(svn_cmdline_printf(pool, _("Credentials cache in '%s' is empty\n"), svn_dirent_local_style(config_path, pool))); - else + else return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, 0, _("Credentials cache in '%s' contains " "no matching credentials"),
Modified: subversion/branches/fsx-1.10/subversion/svn/blame-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/blame-cmd.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svn/blame-cmd.c (original) +++ subversion/branches/fsx-1.10/subversion/svn/blame-cmd.c Sun Jun 14 20:58:10 2015 @@ -31,6 +31,7 @@ #include "svn_pools.h" #include "svn_props.h" #include "svn_cmdline.h" +#include "svn_sorts.h" #include "svn_xml.h" #include "svn_time.h" #include "cl.h" @@ -42,6 +43,8 @@ typedef struct blame_baton_t svn_cl__opt_state_t *opt_state; svn_stream_t *out; svn_stringbuf_t *sbuf; + + int rev_maxlength; } blame_baton_t; @@ -63,9 +66,9 @@ blame_receiver_xml(void *baton, svn_boolean_t local_change, apr_pool_t *pool) { - svn_cl__opt_state_t *opt_state = - ((blame_baton_t *) baton)->opt_state; - svn_stringbuf_t *sb = ((blame_baton_t *) baton)->sbuf; + blame_baton_t *bb = baton; + svn_cl__opt_state_t *opt_state = bb->opt_state; + svn_stringbuf_t *sb = bb->sbuf; /* "<entry ...>" */ /* line_no is 0-based, but the rest of the world is probably Pascal @@ -119,23 +122,13 @@ print_line_info(svn_stream_t *out, const char *date, const char *path, svn_boolean_t verbose, - svn_revnum_t end_revnum, + int rev_maxlength, apr_pool_t *pool) { const char *time_utf8; const char *time_stdout; const char *rev_str; - int rev_maxlength; - /* The standard column width for the revision number is 6 characters. - If the revision number can potentially be larger (i.e. if the end_revnum - is larger than 1000000), we increase the column width as needed. */ - rev_maxlength = 6; - while (end_revnum >= 1000000) - { - rev_maxlength++; - end_revnum = end_revnum / 10; - } rev_str = SVN_IS_VALID_REVNUM(revision) ? apr_psprintf(pool, "%*ld", rev_maxlength, revision) : apr_psprintf(pool, "%*s", rev_maxlength, "-"); @@ -189,11 +182,26 @@ blame_receiver(void *baton, svn_boolean_t local_change, apr_pool_t *pool) { - svn_cl__opt_state_t *opt_state = - ((blame_baton_t *) baton)->opt_state; - svn_stream_t *out = ((blame_baton_t *)baton)->out; + blame_baton_t *bb = baton; + svn_cl__opt_state_t *opt_state = bb->opt_state; + svn_stream_t *out = bb->out; svn_boolean_t use_merged = FALSE; + if (!bb->rev_maxlength) + { + svn_revnum_t max_revnum = MAX(start_revnum, end_revnum); + /* The standard column width for the revision number is 6 characters. + If the revision number can potentially be larger (i.e. if the end_revnum + is larger than 1000000), we increase the column width as needed. */ + + bb->rev_maxlength = 6; + while (max_revnum >= 1000000) + { + bb->rev_maxlength++; + max_revnum = max_revnum / 10; + } + } + if (opt_state->use_merge_history) { /* Choose which revision to use. If they aren't equal, prefer the @@ -216,7 +224,8 @@ blame_receiver(void *baton, SVN_PROP_REVISION_AUTHOR), svn_prop_get_value(merged_rev_props, SVN_PROP_REVISION_DATE), - merged_path, opt_state->verbose, end_revnum, + merged_path, opt_state->verbose, + bb->rev_maxlength, pool)); else SVN_ERR(print_line_info(out, revision, @@ -224,7 +233,8 @@ blame_receiver(void *baton, SVN_PROP_REVISION_AUTHOR), svn_prop_get_value(rev_props, SVN_PROP_REVISION_DATE), - NULL, opt_state->verbose, end_revnum, + NULL, opt_state->verbose, + bb->rev_maxlength, pool)); return svn_stream_printf(out, pool, "%s%s", line, APR_EOL_STR); @@ -286,6 +296,7 @@ svn_cl__blame(apr_getopt_t *os, bl.sbuf = svn_stringbuf_create_empty(pool); bl.opt_state = opt_state; + bl.rev_maxlength = 0; subpool = svn_pool_create(pool); Modified: subversion/branches/fsx-1.10/subversion/svn/changelist-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/changelist-cmd.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svn/changelist-cmd.c (original) +++ subversion/branches/fsx-1.10/subversion/svn/changelist-cmd.c Sun Jun 14 20:58:10 2015 @@ -72,25 +72,7 @@ svn_cl__changelist(apr_getopt_t *os, SVN_ERR(svn_cl__check_targets_are_local_paths(targets)); if (opt_state->quiet) - /* FIXME: This is required because svn_client_create_context() - always initializes ctx->notify_func2 to a wrapper function - which calls ctx->notify_func() if it isn't NULL. In other - words, typically, ctx->notify_func2 is never NULL. This isn't - usually a problem, but the changelist logic generates - svn_error_t's as part of its notification. - - So, svn_wc_set_changelist() checks its notify_func (our - ctx->notify_func2) for NULL-ness, and seeing non-NULL-ness, - generates a notificaton object and svn_error_t to describe some - problem. It passes that off to its notify_func (our - ctx->notify_func2) which drops the notification on the floor - (because it wraps a NULL ctx->notify_func). But svn_error_t's - dropped on the floor cause SEGFAULTs at pool cleanup time -- - they need instead to be cleared. - - SOOOooo... we set our ctx->notify_func2 to NULL so the WC code - doesn't even generate the errors. */ - ctx->notify_func2 = NULL; + ctx->notify_func2 = NULL; /* Easy out: avoid unneeded work */ if (depth == svn_depth_unknown) depth = svn_depth_empty; Modified: subversion/branches/fsx-1.10/subversion/svn/cl-conflicts.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/cl-conflicts.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svn/cl-conflicts.c (original) +++ subversion/branches/fsx-1.10/subversion/svn/cl-conflicts.c Sun Jun 14 20:58:10 2015 @@ -236,7 +236,7 @@ svn_cl__get_human_readable_prop_conflict /* We provide separately translatable strings for the values that we * know about, and a fall-back in case any other values occur. */ - switch (conflict->reason) + switch (svn_client_conflict_get_local_change(conflict)) { case svn_wc_conflict_reason_edited: reason_str = _("local edit"); @@ -251,12 +251,14 @@ svn_cl__get_human_readable_prop_conflict reason_str = _("local obstruction"); break; default: - reason_str = apr_psprintf(pool, _("local %s"), - svn_token__to_word(map_conflict_reason_xml, - conflict->reason)); + reason_str = apr_psprintf( + pool, _("local %s"), + svn_token__to_word( + map_conflict_reason_xml, + svn_client_conflict_get_local_change(conflict))); break; } - switch (conflict->action) + switch (svn_client_conflict_get_incoming_change(conflict)) { case svn_wc_conflict_action_edit: action_str = _("incoming edit"); @@ -268,15 +270,18 @@ svn_cl__get_human_readable_prop_conflict action_str = _("incoming delete"); break; default: - action_str = apr_psprintf(pool, _("incoming %s"), - svn_token__to_word(map_conflict_action_xml, - conflict->action)); + action_str = apr_psprintf( + pool, _("incoming %s"), + svn_token__to_word( + map_conflict_action_xml, + svn_client_conflict_get_incoming_change(conflict))); break; } SVN_ERR_ASSERT(reason_str && action_str); *desc = apr_psprintf(pool, _("%s, %s %s"), reason_str, action_str, - operation_str(conflict->operation)); + operation_str( + svn_client_conflict_get_operation(conflict))); return SVN_NO_ERROR; } @@ -288,31 +293,46 @@ svn_cl__get_human_readable_tree_conflict { const char *action, *reason, *operation; svn_node_kind_t incoming_kind; + svn_wc_conflict_action_t conflict_action; + svn_wc_conflict_reason_t conflict_reason; + svn_wc_operation_t conflict_operation; + svn_node_kind_t conflict_node_kind; + + conflict_action = svn_client_conflict_get_incoming_change(conflict); + conflict_reason = svn_client_conflict_get_local_change(conflict); + conflict_operation = svn_client_conflict_get_operation(conflict); + conflict_node_kind = svn_client_conflict_get_node_kind(conflict); /* Determine the node kind of the incoming change. */ incoming_kind = svn_node_unknown; - if (conflict->action == svn_wc_conflict_action_edit || - conflict->action == svn_wc_conflict_action_delete) + if (conflict_action == svn_wc_conflict_action_edit || + conflict_action == svn_wc_conflict_action_delete) { + const svn_wc_conflict_version_t *src_left_version; + /* Change is acting on 'src_left' version of the node. */ - if (conflict->src_left_version) - incoming_kind = conflict->src_left_version->node_kind; + src_left_version = svn_client_conflict_get_src_left_version(conflict); + if (src_left_version) + incoming_kind = src_left_version->node_kind; } - else if (conflict->action == svn_wc_conflict_action_add || - conflict->action == svn_wc_conflict_action_replace) + else if (conflict_action == svn_wc_conflict_action_add || + conflict_action == svn_wc_conflict_action_replace) { + const svn_wc_conflict_version_t *src_right_version; + /* Change is acting on 'src_right' version of the node. * * ### For 'replace', the node kind is ambiguous. However, src_left * ### is NULL for replace, so we must use src_right. */ - if (conflict->src_right_version) - incoming_kind = conflict->src_right_version->node_kind; + src_right_version = svn_client_conflict_get_src_right_version(conflict); + if (src_right_version) + incoming_kind = src_right_version->node_kind; } - reason = local_reason_str(conflict->node_kind, conflict->reason, - conflict->operation); - action = incoming_action_str(incoming_kind, conflict->action); - operation = operation_str(conflict->operation); + reason = local_reason_str(conflict_node_kind, conflict_reason, + conflict_operation); + action = incoming_action_str(incoming_kind, conflict_action); + operation = operation_str(conflict_operation); SVN_ERR_ASSERT(operation); if (action && reason) @@ -326,17 +346,38 @@ svn_cl__get_human_readable_tree_conflict It will not be pretty, but is closer to an internal error than an ordinary user-facing string. */ *desc = apr_psprintf(pool, _("local: %s %s incoming: %s %s %s"), - svn_node_kind_to_word(conflict->node_kind), + svn_node_kind_to_word(conflict_node_kind), svn_token__to_word(map_conflict_reason_xml, - conflict->reason), + conflict_reason), svn_node_kind_to_word(incoming_kind), svn_token__to_word(map_conflict_action_xml, - conflict->action), + conflict_action), operation); } return SVN_NO_ERROR; } +svn_error_t * +svn_cl__get_human_readable_action_description( + const char **desc, + svn_wc_conflict_action_t action, + svn_wc_operation_t operation, + svn_node_kind_t kind, + apr_pool_t *pool) +{ + const char *action_s, *operation_s; + + action_s = incoming_action_str(kind, action); + operation_s = operation_str(operation); + + SVN_ERR_ASSERT(operation_s); + + *desc = apr_psprintf(pool, _("%s %s"), + action_s, operation_s); + + return SVN_NO_ERROR; +} + /* Helper for svn_cl__append_tree_conflict_info_xml(). * Appends the attributes of the given VERSION to ATT_HASH. @@ -379,20 +420,27 @@ append_tree_conflict_info_xml(svn_string { apr_hash_t *att_hash = apr_hash_make(pool); const char *tmp; + const svn_wc_conflict_version_t *src_left_version; + const svn_wc_conflict_version_t *src_right_version; svn_hash_sets(att_hash, "victim", - svn_dirent_basename(conflict->local_abspath, pool)); + svn_dirent_basename( + svn_client_conflict_get_local_abspath(conflict), pool)); svn_hash_sets(att_hash, "kind", - svn_cl__node_kind_str_xml(conflict->node_kind)); + svn_cl__node_kind_str_xml( + svn_client_conflict_get_node_kind(conflict))); svn_hash_sets(att_hash, "operation", - svn_cl__operation_str_xml(conflict->operation, pool)); + svn_cl__operation_str_xml( + svn_client_conflict_get_operation(conflict), pool)); - tmp = svn_token__to_word(map_conflict_action_xml, conflict->action); + tmp = svn_token__to_word(map_conflict_action_xml, + svn_client_conflict_get_incoming_change(conflict)); svn_hash_sets(att_hash, "action", tmp); - tmp = svn_token__to_word(map_conflict_reason_xml, conflict->reason); + tmp = svn_token__to_word(map_conflict_reason_xml, + svn_client_conflict_get_local_change(conflict)); svn_hash_sets(att_hash, "reason", tmp); /* Open the tree-conflict tag. */ @@ -401,16 +449,18 @@ append_tree_conflict_info_xml(svn_string /* Add child tags for OLDER_VERSION and THEIR_VERSION. */ - if (conflict->src_left_version) + src_left_version = svn_client_conflict_get_src_left_version(conflict); + if (src_left_version) SVN_ERR(add_conflict_version_xml(&str, "source-left", - conflict->src_left_version, + src_left_version, pool)); - if (conflict->src_right_version) + src_right_version = svn_client_conflict_get_src_right_version(conflict); + if (src_right_version) SVN_ERR(add_conflict_version_xml(&str, "source-right", - conflict->src_right_version, + src_right_version, pool)); svn_xml_make_close_tag(&str, pool, "tree-conflict"); @@ -425,7 +475,15 @@ svn_cl__append_conflict_info_xml(svn_str { apr_hash_t *att_hash; const char *kind; - if (conflict->kind == svn_wc_conflict_kind_tree) + svn_wc_conflict_kind_t conflict_kind; + svn_wc_operation_t conflict_operation; + const svn_wc_conflict_version_t *src_left_version; + const svn_wc_conflict_version_t *src_right_version; + + conflict_kind = svn_client_conflict_get_kind(conflict); + conflict_operation = svn_client_conflict_get_operation(conflict); + + if (conflict_kind == svn_wc_conflict_kind_tree) { /* Uses other element type */ return svn_error_trace( @@ -435,53 +493,59 @@ svn_cl__append_conflict_info_xml(svn_str att_hash = apr_hash_make(scratch_pool); svn_hash_sets(att_hash, "operation", - svn_cl__operation_str_xml(conflict->operation, scratch_pool)); + svn_cl__operation_str_xml(conflict_operation, scratch_pool)); - kind = svn_token__to_word(map_conflict_kind_xml, conflict->kind); + kind = svn_token__to_word(map_conflict_kind_xml, conflict_kind); svn_hash_sets(att_hash, "type", kind); svn_hash_sets(att_hash, "operation", - svn_cl__operation_str_xml(conflict->operation, scratch_pool)); + svn_cl__operation_str_xml(conflict_operation, scratch_pool)); /* "<conflict>" */ svn_xml_make_open_tag_hash(&str, scratch_pool, svn_xml_normal, "conflict", att_hash); - if (conflict->src_left_version) + src_left_version = svn_client_conflict_get_src_left_version(conflict); + if (src_left_version) SVN_ERR(add_conflict_version_xml(&str, "source-left", - conflict->src_left_version, + src_left_version, scratch_pool)); - if (conflict->src_right_version) + src_right_version = svn_client_conflict_get_src_right_version(conflict); + if (src_right_version) SVN_ERR(add_conflict_version_xml(&str, "source-right", - conflict->src_right_version, + src_right_version, scratch_pool)); - switch (conflict->kind) + switch (conflict_kind) { case svn_wc_conflict_kind_text: /* "<prev-base-file> xx </prev-base-file>" */ - svn_cl__xml_tagged_cdata(&str, scratch_pool, "prev-base-file", - conflict->base_abspath); + svn_cl__xml_tagged_cdata( + &str, scratch_pool, "prev-base-file", + svn_client_conflict_get_base_abspath(conflict)); /* "<prev-wc-file> xx </prev-wc-file>" */ - svn_cl__xml_tagged_cdata(&str, scratch_pool, "prev-wc-file", - conflict->my_abspath); + svn_cl__xml_tagged_cdata( + &str, scratch_pool, "prev-wc-file", + svn_client_conflict_get_my_abspath(conflict)); /* "<cur-base-file> xx </cur-base-file>" */ - svn_cl__xml_tagged_cdata(&str, scratch_pool, "cur-base-file", - conflict->their_abspath); + svn_cl__xml_tagged_cdata( + &str, scratch_pool, "cur-base-file", + svn_client_conflict_get_their_abspath(conflict)); break; case svn_wc_conflict_kind_property: /* "<prop-file> xx </prop-file>" */ - svn_cl__xml_tagged_cdata(&str, scratch_pool, "prop-file", - conflict->their_abspath); + svn_cl__xml_tagged_cdata( + &str, scratch_pool, "prop-file", + svn_client_conflict_get_their_abspath(conflict)); break; default: Modified: subversion/branches/fsx-1.10/subversion/svn/cl-conflicts.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/cl-conflicts.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svn/cl-conflicts.h (original) +++ subversion/branches/fsx-1.10/subversion/svn/cl-conflicts.h Sun Jun 14 20:58:10 2015 @@ -63,6 +63,16 @@ svn_cl__get_human_readable_tree_conflict const svn_wc_conflict_description2_t *conflict, apr_pool_t *pool); +/* Like svn_cl__get_human_readable_tree_conflict_description but + for other conflict types */ +svn_error_t * +svn_cl__get_human_readable_action_description( + const char **desc, + svn_wc_conflict_action_t action, + svn_wc_operation_t operation, + svn_node_kind_t kind, + apr_pool_t *pool); + /** * Append to @a str an XML representation of the conflict data * for @a conflict, in a format suitable for 'svn info --xml'. Modified: subversion/branches/fsx-1.10/subversion/svn/cl.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/cl.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svn/cl.h (original) +++ subversion/branches/fsx-1.10/subversion/svn/cl.h Sun Jun 14 20:58:10 2015 @@ -167,7 +167,6 @@ typedef struct svn_cl__opt_state_t svn_boolean_t version; /* print version information */ svn_boolean_t verbose; /* be verbose */ svn_boolean_t update; /* contact the server for the full story */ - svn_boolean_t strict; /* do strictly what was requested */ svn_stringbuf_t *filedata; /* contents of file used as option data (not converted to UTF-8) */ const char *encoding; /* the locale/encoding of 'message' and of @@ -248,6 +247,8 @@ typedef struct svn_cl__opt_state_t svn_boolean_t remove_ignored; /* remove ignored items */ svn_boolean_t no_newline; /* do not output the trailing newline */ svn_boolean_t show_passwords; /* show cached passwords */ + svn_boolean_t pin_externals; /* pin externals to last-changed revisions */ + const char *show_item; /* print only the given item */ } svn_cl__opt_state_t; @@ -296,8 +297,7 @@ svn_opt_subcommand_t svn_cl__switch, svn_cl__unlock, svn_cl__update, - svn_cl__upgrade, - svn_cl__youngest; + svn_cl__upgrade; /* See definition in svn.c for documentation. */ @@ -855,6 +855,48 @@ svn_cl__deprecated_merge_reintegrate(con svn_client_ctx_t *ctx, apr_pool_t *pool); + +/* Forward declaration of the similarity check context. */ +typedef struct svn_cl__simcheck_context_t svn_cl__simcheck_context_t; + +/* Token definition for the similarity check. */ +typedef struct svn_cl__simcheck_t +{ + /* The token we're checking for similarity. */ + svn_string_t token; + + /* User data associated with this token. */ + const void *data; + + /* + * The following fields are populated by svn_cl__similarity_check. + */ + + /* Similarity score [0..SVN_STRING__SIM_RANGE_MAX] */ + apr_size_t score; + + /* Number of characters of difference from the key. */ + apr_size_t diff; + + /* Similarity check context (private) */ + svn_cl__simcheck_context_t *context; +} svn_cl__simcheck_t; + +/* Find the entries in TOKENS that are most similar to KEY. + * TOKEN_COUNT is the number of entries in the (mutable) TOKENS array. + * Use SCRATCH_POOL for temporary allocations. + * + * On return, the TOKENS array will be sorted according to similarity + * to KEY, in descending order. The return value will be zero if the + * first token is an exact match; otherwise, it will be one more than + * the number of tokens that are at least two-thirds similar to KEY. + */ +apr_size_t +svn_cl__similarity_check(const char *key, + svn_cl__simcheck_t **tokens, + apr_size_t token_count, + apr_pool_t *scratch_pool); + #ifdef __cplusplus } #endif /* __cplusplus */ Modified: subversion/branches/fsx-1.10/subversion/svn/commit-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/commit-cmd.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svn/commit-cmd.c (original) +++ subversion/branches/fsx-1.10/subversion/svn/commit-cmd.c Sun Jun 14 20:58:10 2015 @@ -137,7 +137,9 @@ svn_cl__commit(apr_getopt_t *os, if (opt_state->depth == svn_depth_unknown) opt_state->depth = svn_depth_infinity; - cfg = svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_CONFIG); + cfg = ctx->config + ? svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_CONFIG) + : NULL; if (cfg) SVN_ERR(svn_config_get_bool(cfg, &no_unlock, SVN_CONFIG_SECTION_MISCELLANY, Modified: subversion/branches/fsx-1.10/subversion/svn/conflict-callbacks.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/conflict-callbacks.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svn/conflict-callbacks.c (original) +++ subversion/branches/fsx-1.10/subversion/svn/conflict-callbacks.c Sun Jun 14 20:58:10 2015 @@ -44,6 +44,9 @@ #include "svn_private_config.h" #define ARRAY_LEN(ary) ((sizeof (ary)) / (sizeof ((ary)[0]))) +#define MAX_ARRAY_LEN(aryx, aryz) \ + (ARRAY_LEN((aryx)) > ARRAY_LEN((aryz)) \ + ? ARRAY_LEN((aryx)) : ARRAY_LEN((aryz))) @@ -138,8 +141,10 @@ show_diff(const svn_wc_conflict_descript svn_diff_t *diff; svn_stream_t *output; svn_diff_file_options_t *options; + const char *merged_file; - if (desc->merged_file) + merged_file = svn_client_conflict_get_merged_file(desc); + if (merged_file) { /* For conflicts recorded by the 'merge' operation, show a diff between * 'mine' (the working version of the file as it appeared before the @@ -153,26 +158,26 @@ show_diff(const svn_wc_conflict_descript * * This way, the diff is always minimal and clearly identifies changes * brought into the working copy by the update/switch/merge operation. */ - if (desc->operation == svn_wc_operation_merge) + if (svn_client_conflict_get_operation(desc) == svn_wc_operation_merge) { - path1 = desc->my_abspath; + path1 = svn_client_conflict_get_my_abspath(desc); label1 = _("MINE"); } else { - path1 = desc->their_abspath; + path1 = svn_client_conflict_get_their_abspath(desc); label1 = _("THEIRS"); } - path2 = desc->merged_file; + path2 = merged_file; label2 = _("MERGED"); } else { /* There's no merged file, but we can show the difference between mine and theirs. */ - path1 = desc->their_abspath; + path1 = svn_client_conflict_get_their_abspath(desc); label1 = _("THEIRS"); - path2 = desc->my_abspath; + path2 = svn_client_conflict_get_my_abspath(desc); label2 = _("MINE"); } @@ -216,24 +221,25 @@ 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_abspath, - desc->my_abspath, - desc->their_abspath, + svn_client_conflict_get_base_abspath(desc), + svn_client_conflict_get_my_abspath(desc), + svn_client_conflict_get_their_abspath(desc), options, pool)); /* ### Consider putting the markers/labels from ### svn_wc__merge_internal in the conflict description. */ - return svn_diff_file_output_merge3(output, diff, - desc->base_abspath, - desc->my_abspath, - desc->their_abspath, - _("||||||| ORIGINAL"), - _("<<<<<<< MINE (select with 'mc')"), - _(">>>>>>> THEIRS (select with 'tc')"), - "=======", - svn_diff_conflict_display_only_conflicts, - cancel_func, - cancel_baton, - pool); + return svn_diff_file_output_merge3( + output, diff, + svn_client_conflict_get_base_abspath(desc), + svn_client_conflict_get_my_abspath(desc), + svn_client_conflict_get_their_abspath(desc), + _("||||||| ORIGINAL"), + _("<<<<<<< MINE (select with 'mc')"), + _(">>>>>>> THEIRS (select with 'tc')"), + "=======", + svn_diff_conflict_display_only_conflicts, + cancel_func, + cancel_baton, + pool); } /* Perform a 3-way merge of the conflicting values of a property, @@ -252,9 +258,9 @@ merge_prop_conflict(svn_stream_t *output void *cancel_baton, apr_pool_t *pool) { - const char *base_abspath = desc->base_abspath; - const char *my_abspath = desc->my_abspath; - const char *their_abspath = desc->their_abspath; + const char *base_abspath = svn_client_conflict_get_base_abspath(desc); + const char *my_abspath = svn_client_conflict_get_my_abspath(desc); + const char *their_abspath = svn_client_conflict_get_their_abspath(desc); svn_diff_file_options_t *options = svn_diff_file_options_create(pool); svn_diff_t *diff; @@ -422,7 +428,7 @@ static const resolver_option_t text_conf svn_wc_conflict_choose_undefined }, { "df", N_("show diff"), N_("show all changes made to merged file"), svn_wc_conflict_choose_undefined }, - { "r", N_("mark resolved"), N_("accept merged version of file"), + { "r", N_("mark resolved"), N_("accept merged version of file [working]"), svn_wc_conflict_choose_merged }, { "", "", "", svn_wc_conflict_choose_unspecified }, { "dc", N_("display conflict"), N_("show all conflicts " @@ -461,6 +467,28 @@ static const resolver_option_t text_conf { NULL } }; +/* Resolver options for a binary file conflict. */ +static const resolver_option_t binary_conflict_options[] = +{ + /* Translators: keep long_desc below 70 characters (wrap with a left + margin of 9 spaces if needed); don't translate the words within square + brackets. */ + { "r", N_("mark resolved"), N_("accept the working copy version of file " + " [working]"), + svn_wc_conflict_choose_merged }, + { "tf", N_("their version"), N_("accept the incoming version of file " + " [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 }, + { "s", N_("show all options"), N_("show this list (also 'h', '?')"), + svn_wc_conflict_choose_undefined }, + { NULL } +}; + /* Resolver options for a property conflict */ static const resolver_option_t prop_conflict_options[] = { @@ -686,14 +714,29 @@ handle_text_conflict(svn_wc_conflict_res /* Have they done *something* (edit, look at diff, etc) to give them a rational basis for choosing (r)esolved? */ svn_boolean_t knows_something = FALSE; - - SVN_ERR_ASSERT(desc->kind == svn_wc_conflict_kind_text); - - SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, - _("Conflict discovered in file '%s'.\n"), - svn_cl__local_style_skip_ancestor( - b->path_prefix, desc->local_abspath, - scratch_pool))); + const char *local_relpath; + const char *local_abspath = svn_client_conflict_get_local_abspath(desc); + svn_boolean_t is_binary = svn_client_conflict_get_is_binary(desc); + const char *base_abspath = svn_client_conflict_get_base_abspath(desc); + const char *my_abspath = svn_client_conflict_get_my_abspath(desc); + const char *their_abspath = svn_client_conflict_get_their_abspath(desc); + const char *merged_file = svn_client_conflict_get_merged_file(desc); + + SVN_ERR_ASSERT(svn_client_conflict_get_kind(desc) == + svn_wc_conflict_kind_text); + + local_relpath = svn_cl__local_style_skip_ancestor(b->path_prefix, + local_abspath, + scratch_pool); + + if (is_binary) + SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, + _("Conflict discovered in binary file '%s'.\n"), + local_relpath)); + else + SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, + _("Conflict discovered in file '%s'.\n"), + local_relpath)); /* ### TODO This whole feature availability check is grossly outdated. DIFF_ALLOWED needs either to be redefined or to go away. @@ -703,13 +746,19 @@ handle_text_conflict(svn_wc_conflict_res 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_abspath) - || (!desc->base_abspath && desc->my_abspath && desc->their_abspath)) + if (!is_binary && + ((merged_file && base_abspath) + || (!base_abspath && my_abspath && their_abspath))) diff_allowed = TRUE; while (TRUE) { - const char *options[ARRAY_LEN(text_conflict_options)]; + const char *options[1 + MAX_ARRAY_LEN(binary_conflict_options, + text_conflict_options)]; + + const resolver_option_t *conflict_options = is_binary + ? binary_conflict_options + : text_conflict_options; const char **next_option = options; const resolver_option_t *opt; @@ -719,36 +768,38 @@ handle_text_conflict(svn_wc_conflict_res if (diff_allowed) { /* We need one more path for this feature. */ - if (desc->my_abspath) + if (my_abspath) *next_option++ = "df"; *next_option++ = "e"; /* We need one more path for this feature. */ - if (desc->my_abspath) + if (my_abspath) *next_option++ = "m"; if (knows_something) *next_option++ = "r"; - if (! desc->is_binary) - { - *next_option++ = "mc"; - *next_option++ = "tc"; - } + *next_option++ = "mc"; + *next_option++ = "tc"; } else { if (knows_something) *next_option++ = "r"; - *next_option++ = "mf"; + + /* The 'mine-full' option selects the ".mine" file so only offer + * it if that file exists. It does not exist for binary files, + * for example (questionable historical behaviour since 1.0). */ + if (my_abspath) + *next_option++ = "mf"; + *next_option++ = "tf"; } *next_option++ = "s"; *next_option++ = NULL; - SVN_ERR(prompt_user(&opt, text_conflict_options, options, b->pb, - iterpool)); + SVN_ERR(prompt_user(&opt, conflict_options, options, b->pb, iterpool)); if (! opt) continue; @@ -762,12 +813,12 @@ handle_text_conflict(svn_wc_conflict_res else if (strcmp(opt->code, "s") == 0) { SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "\n%s\n", - help_string(text_conflict_options, + help_string(conflict_options, iterpool))); } else if (strcmp(opt->code, "dc") == 0) { - if (desc->is_binary) + if (is_binary) { SVN_ERR(svn_cmdline_fprintf(stderr, iterpool, _("Invalid option; cannot " @@ -775,8 +826,7 @@ handle_text_conflict(svn_wc_conflict_res "binary file.\n\n"))); continue; } - else if (! (desc->my_abspath && desc->base_abspath && - desc->their_abspath)) + else if (! (my_abspath && base_abspath && their_abspath)) { SVN_ERR(svn_cmdline_fprintf(stderr, iterpool, _("Invalid option; original " @@ -792,7 +842,7 @@ handle_text_conflict(svn_wc_conflict_res else if (strcmp(opt->code, "df") == 0) { /* Re-check preconditions. */ - if (! diff_allowed || ! desc->my_abspath) + if (! diff_allowed || ! my_abspath) { SVN_ERR(svn_cmdline_fprintf(stderr, iterpool, _("Invalid option; there's no " @@ -807,7 +857,7 @@ handle_text_conflict(svn_wc_conflict_res } else if (strcmp(opt->code, "e") == 0 || strcmp(opt->code, ":-E") == 0) { - SVN_ERR(open_editor(&performed_edit, desc->merged_file, b, iterpool)); + SVN_ERR(open_editor(&performed_edit, merged_file, b, iterpool)); if (performed_edit) knows_something = TRUE; } @@ -817,7 +867,7 @@ handle_text_conflict(svn_wc_conflict_res svn_error_t *err; /* Re-check preconditions. */ - if (! desc->my_abspath) + if (! my_abspath) { SVN_ERR(svn_cmdline_fprintf(stderr, iterpool, _("Invalid option; there's no " @@ -825,11 +875,11 @@ handle_text_conflict(svn_wc_conflict_res continue; } - err = svn_cl__merge_file_externally(desc->base_abspath, - desc->their_abspath, - desc->my_abspath, - desc->merged_file, - desc->local_abspath, b->config, + err = svn_cl__merge_file_externally(base_abspath, + their_abspath, + my_abspath, + merged_file, + local_abspath, b->config, NULL, iterpool); if (err) { @@ -840,11 +890,11 @@ handle_text_conflict(svn_wc_conflict_res /* Try the internal merge tool. */ svn_error_clear(err); SVN_ERR(svn_cl__merge_file(&remains_in_conflict, - desc->base_abspath, - desc->their_abspath, - desc->my_abspath, - desc->merged_file, - desc->local_abspath, + base_abspath, + their_abspath, + my_abspath, + merged_file, + local_abspath, b->path_prefix, b->editor_cmd, b->config, @@ -883,18 +933,17 @@ handle_text_conflict(svn_wc_conflict_res * and then when the user chooses it say 'Invalid option'. */ /* ### 'merged_file' shouldn't be necessary *before* we launch the * resolver: it should be the *result* of doing so. */ - if (desc->base_abspath && desc->their_abspath && - desc->my_abspath && desc->merged_file) + if (base_abspath && their_abspath && my_abspath && merged_file) { svn_error_t *err; char buf[1024]; const char *message; - err = svn_cl__merge_file_externally(desc->base_abspath, - desc->their_abspath, - desc->my_abspath, - desc->merged_file, - desc->local_abspath, + err = svn_cl__merge_file_externally(base_abspath, + their_abspath, + my_abspath, + merged_file, + local_abspath, b->config, NULL, iterpool); if (err && (err->apr_err == SVN_ERR_CL_NO_EXTERNAL_MERGE_TOOL || err->apr_err == SVN_ERR_EXTERNAL_PROGRAM)) @@ -921,11 +970,11 @@ handle_text_conflict(svn_wc_conflict_res svn_boolean_t remains_in_conflict = TRUE; SVN_ERR(svn_cl__merge_file(&remains_in_conflict, - desc->base_abspath, - desc->their_abspath, - desc->my_abspath, - desc->merged_file, - desc->local_abspath, + base_abspath, + their_abspath, + my_abspath, + merged_file, + local_abspath, b->path_prefix, b->editor_cmd, b->config, @@ -940,7 +989,7 @@ handle_text_conflict(svn_wc_conflict_res { if ((opt->choice == svn_wc_conflict_choose_mine_conflict || opt->choice == svn_wc_conflict_choose_theirs_conflict) - && desc->is_binary) + && is_binary) { SVN_ERR(svn_cmdline_fprintf(stderr, iterpool, _("Invalid option; cannot choose " @@ -995,14 +1044,16 @@ handle_prop_conflict(svn_wc_conflict_res ((svn_wc_conflict_description2_t *)desc)->their_abspath = desc->merged_file; ((svn_wc_conflict_description2_t *)desc)->merged_file = NULL; - SVN_ERR_ASSERT(desc->kind == svn_wc_conflict_kind_property); + SVN_ERR_ASSERT(svn_client_conflict_get_kind(desc) == + svn_wc_conflict_kind_property); SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, _("Conflict for property '%s' discovered" " on '%s'.\n"), - desc->property_name, + svn_client_conflict_get_property_name(desc), svn_cl__local_style_skip_ancestor( - b->path_prefix, desc->local_abspath, + b->path_prefix, + svn_client_conflict_get_local_abspath(desc), scratch_pool))); SVN_ERR(svn_cl__get_human_readable_prop_conflict_description(&message, desc, @@ -1089,6 +1140,8 @@ handle_tree_conflict(svn_wc_conflict_res apr_pool_t *scratch_pool) { const char *readable_desc; + const char *src_left_version; + const char *src_right_version; apr_pool_t *iterpool; SVN_ERR(svn_cl__get_human_readable_tree_conflict_description( @@ -1097,10 +1150,26 @@ handle_tree_conflict(svn_wc_conflict_res stderr, scratch_pool, _("Tree conflict on '%s'\n > %s\n"), svn_cl__local_style_skip_ancestor(b->path_prefix, - desc->local_abspath, - scratch_pool), + svn_client_conflict_get_local_abspath(desc), scratch_pool), readable_desc)); + src_left_version = + svn_cl__node_description( + svn_client_conflict_get_src_left_version(desc), + svn_client_conflict_get_src_left_version(desc)->repos_url, + scratch_pool); + if (src_left_version) + SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "%s: %s\n", + _("Source left"), src_left_version)); + src_right_version = + svn_cl__node_description( + svn_client_conflict_get_src_right_version(desc), + svn_client_conflict_get_src_right_version(desc)->repos_url, + scratch_pool); + if (src_right_version) + SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "%s: %s\n", + _("Source right"), src_right_version)); + iterpool = svn_pool_create(scratch_pool); while (1) { @@ -1111,18 +1180,22 @@ handle_tree_conflict(svn_wc_conflict_res tc_opts = tree_conflict_options; - if (desc->operation == svn_wc_operation_update || - desc->operation == svn_wc_operation_switch) + if (svn_client_conflict_get_operation(desc) == svn_wc_operation_update || + svn_client_conflict_get_operation(desc) == svn_wc_operation_switch) { - if (desc->reason == svn_wc_conflict_reason_moved_away) + svn_wc_conflict_reason_t reason; + + reason = svn_client_conflict_get_local_change(desc); + if (reason == svn_wc_conflict_reason_moved_away) { tc_opts = tree_conflict_options_update_moved_away; } - else if (desc->reason == svn_wc_conflict_reason_deleted || - desc->reason == svn_wc_conflict_reason_replaced) + else if (reason == svn_wc_conflict_reason_deleted || + reason == svn_wc_conflict_reason_replaced) { - if (desc->action == svn_wc_conflict_action_edit && - desc->node_kind == svn_node_dir) + if (svn_client_conflict_get_incoming_change(desc) == + svn_wc_conflict_action_edit && + svn_client_conflict_get_node_kind(desc) == svn_node_dir) tc_opts = tree_conflict_options_update_edit_deleted_dir; } } @@ -1159,6 +1232,10 @@ conflict_func_interactive(svn_wc_conflic { svn_cl__interactive_conflict_baton_t *b = baton; svn_error_t *err; + const char *base_abspath = svn_client_conflict_get_base_abspath(desc); + const char *my_abspath = svn_client_conflict_get_my_abspath(desc); + const char *their_abspath = svn_client_conflict_get_their_abspath(desc); + const char *merged_file = svn_client_conflict_get_merged_file(desc); /* Start out assuming we're going to postpone the conflict. */ *result = svn_wc_create_conflict_result(svn_wc_conflict_choose_postpone, @@ -1179,8 +1256,8 @@ conflict_func_interactive(svn_wc_conflic case svn_cl__accept_working: /* If the caller didn't merge the property values, then I guess * 'choose working' means 'choose mine'... */ - if (! desc->merged_file) - (*result)->merged_file = desc->my_abspath; + if (! merged_file) + (*result)->merged_file = my_abspath; (*result)->choice = svn_wc_conflict_choose_merged; return SVN_NO_ERROR; case svn_cl__accept_mine_conflict: @@ -1196,7 +1273,7 @@ conflict_func_interactive(svn_wc_conflic (*result)->choice = svn_wc_conflict_choose_theirs_full; return SVN_NO_ERROR; case svn_cl__accept_edit: - if (desc->merged_file) + if (merged_file) { if (b->external_failed) { @@ -1204,7 +1281,7 @@ conflict_func_interactive(svn_wc_conflic return SVN_NO_ERROR; } - err = svn_cmdline__edit_file_externally(desc->merged_file, + err = svn_cmdline__edit_file_externally(merged_file, b->editor_cmd, b->config, scratch_pool); if (err && (err->apr_err == SVN_ERR_CL_NO_EXTERNAL_EDITOR || @@ -1227,10 +1304,10 @@ conflict_func_interactive(svn_wc_conflic /* else, fall through to prompting. */ break; case svn_cl__accept_launch: - if (desc->base_abspath && desc->their_abspath - && desc->my_abspath && desc->merged_file) + if (base_abspath && their_abspath && my_abspath && merged_file) { svn_boolean_t remains_in_conflict; + const char *local_abspath; if (b->external_failed) { @@ -1238,11 +1315,12 @@ conflict_func_interactive(svn_wc_conflic return SVN_NO_ERROR; } - err = svn_cl__merge_file_externally(desc->base_abspath, - desc->their_abspath, - desc->my_abspath, - desc->merged_file, - desc->local_abspath, + local_abspath = svn_client_conflict_get_local_abspath(desc); + err = svn_cl__merge_file_externally(base_abspath, + their_abspath, + my_abspath, + merged_file, + local_abspath, b->config, &remains_in_conflict, scratch_pool); @@ -1286,13 +1364,15 @@ conflict_func_interactive(svn_wc_conflic Conflicting edits on a file's text, or Conflicting edits on a property. */ - if (((desc->kind == svn_wc_conflict_kind_text) - && (desc->action == svn_wc_conflict_action_edit) - && (desc->reason == svn_wc_conflict_reason_edited))) + if (((svn_client_conflict_get_kind(desc) == svn_wc_conflict_kind_text) + && (svn_client_conflict_get_incoming_change(desc) == + svn_wc_conflict_action_edit) + && (svn_client_conflict_get_local_change(desc) == + svn_wc_conflict_reason_edited))) SVN_ERR(handle_text_conflict(*result, desc, b, scratch_pool)); - else if (desc->kind == svn_wc_conflict_kind_property) + else if (svn_client_conflict_get_kind(desc) == svn_wc_conflict_kind_property) SVN_ERR(handle_prop_conflict(*result, desc, b, result_pool, scratch_pool)); - else if (desc->kind == svn_wc_conflict_kind_tree) + else if (svn_client_conflict_get_kind(desc) == svn_wc_conflict_kind_tree) SVN_ERR(handle_tree_conflict(*result, desc, b, scratch_pool)); else /* other types of conflicts -- do nothing about them. */ @@ -1320,10 +1400,11 @@ svn_cl__conflict_func_interactive(svn_wc { const char *local_path = svn_cl__local_style_skip_ancestor( - b->path_prefix, desc->local_abspath, scratch_pool); + b->path_prefix, svn_client_conflict_get_local_abspath(desc), + scratch_pool); svn_cl__conflict_stats_resolved(b->conflict_stats, local_path, - desc->kind); + svn_client_conflict_get_kind(desc)); } return SVN_NO_ERROR; } Modified: subversion/branches/fsx-1.10/subversion/svn/copy-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/copy-cmd.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svn/copy-cmd.c (original) +++ subversion/branches/fsx-1.10/subversion/svn/copy-cmd.c Sun Jun 14 20:58:10 2015 @@ -167,8 +167,11 @@ svn_cl__copy(apr_getopt_t *os, SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), opt_state, NULL, ctx->config, pool)); - err = svn_client_copy6(sources, dst_path, TRUE, + err = svn_client_copy7(sources, dst_path, TRUE, opt_state->parents, opt_state->ignore_externals, + FALSE /* metadata_only */, + opt_state->pin_externals, + NULL, /* pin all externals */ opt_state->revprop_table, (opt_state->quiet ? NULL : svn_cl__print_commit_info), NULL, Modified: subversion/branches/fsx-1.10/subversion/svn/diff-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/diff-cmd.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svn/diff-cmd.c (original) +++ subversion/branches/fsx-1.10/subversion/svn/diff-cmd.c Sun Jun 14 20:58:10 2015 @@ -82,6 +82,7 @@ kind_to_word(svn_client_diff_summarize_k 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_summ * 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_summ 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_ { 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_ * 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); } @@ -216,6 +233,43 @@ svn_cl__diff(apr_getopt_t *os, svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "paths", SVN_VA_NULL); SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout)); } + if (opt_state->diff.summarize) + { + if (opt_state->diff.use_git_diff_format) + return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, + _("'%s' not valid with '--summarize' option"), + "--git"); + if (opt_state->diff.patch_compatible) + return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, + _("'%s' not valid with '--summarize' option"), + "--patch-compatible"); + if (opt_state->diff.show_copies_as_adds) + return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, + _("'%s' not valid with '--summarize' option"), + "--show-copies-as-adds"); + if (opt_state->diff.internal_diff) + return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, + _("'%s' not valid with '--summarize' option"), + "--internal-diff"); + if (opt_state->diff.diff_cmd) + return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, + _("'%s' not valid with '--summarize' option"), + "--diff-cmd"); + if (opt_state->diff.no_diff_added) + return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, + _("'%s' not valid with '--summarize' option"), + "--no-diff-added"); + if (opt_state->diff.no_diff_deleted) + return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, + _("'%s' not valid with '--summarize' option"), + "--no-diff-deleted"); + if (opt_state->force) + return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, + _("'%s' not valid with '--summarize' option"), + "--force"); + /* Not handling ignore-properties, and properties-only as there should + be a patch adding support for these being applied soon */ + } SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os, opt_state->targets, @@ -344,7 +398,7 @@ svn_cl__diff(apr_getopt_t *os, { ignore_content_type = TRUE; } - else + else if (ctx->config) { SVN_ERR(svn_config_get_bool(svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_CONFIG), @@ -353,6 +407,10 @@ svn_cl__diff(apr_getopt_t *os, SVN_CONFIG_OPTION_DIFF_IGNORE_CONTENT_TYPE, FALSE)); } + else + { + ignore_content_type = FALSE; + } svn_opt_push_implicit_dot_target(targets, pool); @@ -391,6 +449,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, @@ -443,6 +502,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,
