Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2029E188C8 for ; Fri, 29 Jan 2016 11:44:38 +0000 (UTC) Received: (qmail 73359 invoked by uid 500); 29 Jan 2016 11:44:02 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 73321 invoked by uid 500); 29 Jan 2016 11:44:02 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 73305 invoked by uid 99); 29 Jan 2016 11:44:02 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jan 2016 11:44:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 8A70D180633 for ; Fri, 29 Jan 2016 11:44:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.446 X-Spam-Level: X-Spam-Status: No, score=0.446 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.554] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id qwnR58mkGHDz for ; Fri, 29 Jan 2016 11:44:00 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id 1AF9D31A90 for ; Fri, 29 Jan 2016 11:43:59 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 24622E064F for ; Fri, 29 Jan 2016 11:43:58 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 1E4323A0185 for ; Fri, 29 Jan 2016 11:43:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1727547 - /subversion/trunk/subversion/svn/conflict-callbacks.c Date: Fri, 29 Jan 2016 11:43:58 -0000 To: commits@subversion.apache.org From: stsp@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160129114358.1E4323A0185@svn01-us-west.apache.org> Author: stsp Date: Fri Jan 29 11:43:57 2016 New Revision: 1727547 URL: http://svn.apache.org/viewvc?rev=1727547&view=rev Log: Put the code 'svn' uses to mark a conflict resolved into a subroutine. No functional change. This just prepares 'svn' for making more use of the new svn_client_conflict APIs. * subversion/svn/conflict-callbacks.c (mark_conflict_resolved): New helper, factored out verbatim from... (svn_cl__resolve_conflict): ... here. Modified: subversion/trunk/subversion/svn/conflict-callbacks.c Modified: subversion/trunk/subversion/svn/conflict-callbacks.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=1727547&r1=1727546&r2=1727547&view=diff ============================================================================== --- subversion/trunk/subversion/svn/conflict-callbacks.c (original) +++ subversion/trunk/subversion/svn/conflict-callbacks.c Fri Jan 29 11:43:57 2016 @@ -1617,6 +1617,61 @@ conflict_option_id_to_wc_conflict_choice return svn_wc_conflict_choose_undefined; } +/* Mark CONFLICT as resolved to resolution option with ID OPTION_ID. + * If TEXT_CONFLICTED is true, resolve text conflicts described by CONFLICT. + * IF PROPNAME is not NULL, mark the conflict in the specified property as + * resolved. If PROPNAME is "", mark all property conflicts described by + * CONFLICT as resolved. + * If TREE_CONFLICTED is true, resolve tree conflicts described by CONFLICT. + * Adjust CONFLICT_STATS as necessary (PATH_PREFIX is needed for this step). */ +static svn_error_t * +mark_conflict_resolved(svn_client_conflict_t *conflict, + svn_client_conflict_option_id_t option_id, + svn_boolean_t text_conflicted, + const char *propname, + svn_boolean_t tree_conflicted, + const char *path_prefix, + svn_cl__conflict_stats_t *conflict_stats, + svn_client_ctx_t *ctx, + apr_pool_t *scratch_pool) +{ + const char *local_relpath + = svn_cl__local_style_skip_ancestor( + path_prefix, svn_client_conflict_get_local_abspath(conflict), + scratch_pool); + const char *local_abspath; + const char *lock_abspath; + svn_error_t *err; + + local_abspath = svn_client_conflict_get_local_abspath(conflict); + + /* ### for now, resolve conflict using legacy API */ + SVN_ERR(svn_wc__acquire_write_lock_for_resolve(&lock_abspath, + ctx->wc_ctx, + local_abspath, + scratch_pool, + scratch_pool)); + err = svn_wc_resolved_conflict5( + ctx->wc_ctx, local_abspath, svn_depth_empty, /* ??? */ + text_conflicted, propname, tree_conflicted, + conflict_option_id_to_wc_conflict_choice(option_id), + ctx->cancel_func, ctx->cancel_baton, + ctx->notify_func2, ctx->notify_baton2, + scratch_pool); + + err = svn_error_compose_create(err, svn_wc__release_write_lock(ctx->wc_ctx, + lock_abspath, + scratch_pool)); + svn_io_sleep_for_timestamps(local_abspath, scratch_pool); + + SVN_ERR(err); + + svn_cl__conflict_stats_resolved(conflict_stats, local_relpath, + svn_client_conflict_get_kind(conflict)); + + return SVN_NO_ERROR; +} + svn_error_t * svn_cl__resolve_conflict(svn_boolean_t *resolved, svn_cl__accept_t *accept_which, @@ -1654,44 +1709,14 @@ svn_cl__resolve_conflict(svn_boolean_t * SVN_ERR_ASSERT(option_id != svn_client_conflict_option_unspecified); - /* If we are resolving a conflict, adjust the summary of conflicts. */ if (option_id != svn_client_conflict_option_postpone) { - const char *local_relpath - = svn_cl__local_style_skip_ancestor( - path_prefix, svn_client_conflict_get_local_abspath(conflict), - scratch_pool); - const char *local_abspath; - const char *lock_abspath; - svn_error_t *err; - - local_abspath = svn_client_conflict_get_local_abspath(conflict); - - /* ### for now, resolve conflict using legacy API */ - SVN_ERR(svn_wc__acquire_write_lock_for_resolve(&lock_abspath, - ctx->wc_ctx, - local_abspath, - scratch_pool, - scratch_pool)); - err = svn_wc_resolved_conflict5( - ctx->wc_ctx, local_abspath, svn_depth_empty, /* ??? */ - text_conflicted, - props_conflicted != NULL ? "" : NULL, - tree_conflicted, - conflict_option_id_to_wc_conflict_choice(option_id), - ctx->cancel_func, ctx->cancel_baton, - ctx->notify_func2, ctx->notify_baton2, - scratch_pool); - - err = svn_error_compose_create(err, svn_wc__release_write_lock(ctx->wc_ctx, - lock_abspath, - scratch_pool)); - svn_io_sleep_for_timestamps(local_abspath, scratch_pool); - - SVN_ERR(err); - - svn_cl__conflict_stats_resolved(conflict_stats, local_relpath, - svn_client_conflict_get_kind(conflict)); + SVN_ERR(mark_conflict_resolved(conflict, option_id, + text_conflicted, + props_conflicted != NULL ? "" : NULL, + tree_conflicted, + path_prefix, conflict_stats, + ctx, scratch_pool)); *resolved = TRUE; } else