subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kot...@apache.org
Subject svn commit: r1806031 - /subversion/trunk/subversion/libsvn_ra_serf/merge.c
Date Thu, 24 Aug 2017 11:48:36 GMT
Author: kotkov
Date: Thu Aug 24 11:48:36 2017
New Revision: 1806031

URL: http://svn.apache.org/viewvc?rev=1806031&view=rev
Log:
ra_serf: Minor code tweak: introduce a field in merge_context_t that keeps
track of whether we require the full MERGE response.

* subversion/libsvn_ra_serf/merge.c
  (struct merge_context_t): Add new 'disable_merge_response' field.
  (svn_ra_serf__run_merge): Initialize the new field.
  (setup_merge_headers): Check the new field.

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/merge.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/merge.c?rev=1806031&r1=1806030&r2=1806031&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/merge.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/merge.c Thu Aug 24 11:48:36 2017
@@ -79,6 +79,7 @@ typedef struct merge_context_t
 
   apr_hash_t *lock_tokens;
   svn_boolean_t keep_locks;
+  svn_boolean_t disable_merge_response;
 
   const char *merge_resource_url; /* URL of resource to be merged. */
   const char *merge_url; /* URL at which the MERGE request is aimed. */
@@ -282,11 +283,7 @@ setup_merge_headers(serf_bucket_t *heade
       svn_stringbuf_appendcstr(val, SVN_DAV_OPTION_RELEASE_LOCKS);
     }
 
-  /* We don't need the full merge response when working over HTTPv2.
-   * Over HTTPv1, this response is only required with a non-null
-   * svn_ra_push_wc_prop_func_t callback. */
-  if (SVN_RA_SERF__HAVE_HTTPV2_SUPPORT(ctx->session) ||
-      ctx->session->wc_callbacks->push_wc_prop == NULL)
+  if (ctx->disable_merge_response)
     {
       if (val->len > 0)
         svn_stringbuf_appendcstr(val, " ");
@@ -425,6 +422,13 @@ svn_ra_serf__run_merge(const svn_commit_
   merge_ctx->lock_tokens = lock_tokens;
   merge_ctx->keep_locks = keep_locks;
 
+  /* We don't need the full merge response when working over HTTPv2.
+   * Over HTTPv1, this response is only required with a non-null
+   * svn_ra_push_wc_prop_func_t callback. */
+  merge_ctx->disable_merge_response =
+    SVN_RA_SERF__HAVE_HTTPV2_SUPPORT(session) ||
+    session->wc_callbacks->push_wc_prop == NULL;
+
   merge_ctx->commit_info = svn_create_commit_info(result_pool);
 
   merge_ctx->merge_url = session->session_url.path;



Mime
View raw message