Author: lgo
Date: Wed Dec  5 20:54:03 2012
New Revision: 1417642

URL: http://svn.apache.org/viewvc?rev=1417642&view=rev
Log:
Add a bulk-updates option to the global and per-server section in servers.
This allows a user to disable the default skelta mode of ra_serf back to bulk
update mode.

* subversion/include/svn_config.h
  (SVN_CONFIG_OPTION_BULK_UPDATES): New option in servers file.

* subversion/libsvn_ra_serf/ra_serf.h
  (struct svn_ra_serf__session_t): New member variable.

* subversion/libsvn_ra_serf/serf.c
  (load_config): Load the global or per server group bulk-updates flag.

* subversion/libsvn_ra_serf/update.c
  (make_update_reporter): Remove the compile-time flag
   SVN_RA_SERF__UPDATES_SEND_ALL and replace it with the new runtime option.
   Update comments.

* subversion/libsvn_subr/config_file.c
  (svn_config_ensure): Add new directive in the default servers file.

Modified:
    subversion/trunk/subversion/include/svn_config.h
    subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
    subversion/trunk/subversion/libsvn_ra_serf/serf.c
    subversion/trunk/subversion/libsvn_ra_serf/update.c
    subversion/trunk/subversion/libsvn_subr/config_file.c

Modified: subversion/trunk/subversion/include/svn_config.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_config.h?rev=1417642&r1=1417641&r2=1417642&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_config.h (original)
+++ subversion/trunk/subversion/include/svn_config.h Wed Dec  5 20:54:03 2012
@@ -86,6 +86,8 @@ typedef struct svn_config_t svn_config_t
 #define SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \
                                           "store-ssl-client-cert-pp-plaintext"
 #define SVN_CONFIG_OPTION_USERNAME                  "username"
+/** @since New in 1.8. */
+#define SVN_CONFIG_OPTION_BULK_UPDATES              "bulk-updates"
 
 #define SVN_CONFIG_CATEGORY_CONFIG          "config"
 #define SVN_CONFIG_SECTION_AUTH                 "auth"

Modified: subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h?rev=1417642&r1=1417641&r2=1417642&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h Wed Dec  5 20:54:03 
2012
@@ -223,6 +223,11 @@ struct svn_ra_serf__session_t {
   /*** End HTTP v2 stuff ***/
 
   svn_ra_serf__blncache_t *blncache;
+
+  /* Flag that indicates if we request the server for bulk updates (TRUE) with
+     all the properties and content in the update-report response. If FALSE,
+     request a skelta update-report with inlined properties. */
+  svn_boolean_t bulk_updates;
 };
 
 #define SVN_RA_SERF__HAVE_HTTPV2_SUPPORT(sess) ((sess)->me_resource != NULL)

Modified: subversion/trunk/subversion/libsvn_ra_serf/serf.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/serf.c?rev=1417642&r1=1417641&r2=1417642&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/serf.c Wed Dec  5 20:54:03 2012
@@ -218,6 +218,13 @@ load_config(svn_ra_serf__session_t *sess
   svn_config_get(config, &session->ssl_authorities, SVN_CONFIG_SECTION_GLOBAL,
                  SVN_CONFIG_OPTION_SSL_AUTHORITY_FILES, NULL);
 
+  /* If set, read the flag that tells us to do bulk updates or not. Defaults
+     to skelta updates. */
+  SVN_ERR(svn_config_get_bool(config, &session->bulk_updates,
+                              SVN_CONFIG_SECTION_GLOBAL,
+                              SVN_CONFIG_OPTION_BULK_UPDATES,
+                              FALSE));
+
   if (config)
     server_group = svn_config_find_group(config,
                                          session->session_url.hostname,
@@ -254,6 +261,12 @@ load_config(svn_ra_serf__session_t *sess
                                   TRUE));
       svn_config_get(config, &session->ssl_authorities, server_group,
                      SVN_CONFIG_OPTION_SSL_AUTHORITY_FILES, NULL);
+
+      /* Load the group bulk updates flag. */
+      SVN_ERR(svn_config_get_bool(config, &session->bulk_updates,
+                                  server_group,
+                                  SVN_CONFIG_OPTION_BULK_UPDATES,
+                                  FALSE));
     }
 
   /* Parse the connection timeout value, if any. */

Modified: subversion/trunk/subversion/libsvn_ra_serf/update.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/update.c?rev=1417642&r1=1417641&r2=1417642&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/update.c Wed Dec  5 20:54:03 2012
@@ -3161,19 +3161,23 @@ make_update_reporter(svn_ra_session_t *r
                                    svn_io_file_del_on_pool_cleanup,
                                    report->pool, scratch_pool));
 
-#ifdef SVN_RA_SERF__UPDATES_SEND_ALL
-  svn_xml_make_open_tag(&buf, scratch_pool, svn_xml_normal, "S:update-report",
-                        "xmlns:S", SVN_XML_NAMESPACE, "send-all", "true",
-                        NULL);
-#else
-  svn_xml_make_open_tag(&buf, scratch_pool, svn_xml_normal, "S:update-report",
-                        "xmlns:S", SVN_XML_NAMESPACE,
-                        NULL);
-  /* Subversion 1.8+ servers can be told to send properties for newly
-     added items inline even when doing a skelta response. */
-  make_simple_xml_tag(&buf, "S:include-props", "yes", scratch_pool);
-#endif
-
+  if (sess->bulk_updates)
+    {
+      svn_xml_make_open_tag(&buf, scratch_pool, svn_xml_normal,
+                            "S:update-report",
+                            "xmlns:S", SVN_XML_NAMESPACE, "send-all", "true",
+                            NULL);
+    }
+  else
+    {
+      svn_xml_make_open_tag(&buf, scratch_pool, svn_xml_normal,
+                            "S:update-report",
+                            "xmlns:S", SVN_XML_NAMESPACE,
+                            NULL);
+      /* Subversion 1.8+ servers can be told to send properties for newly
+       added items inline even when doing a skelta response. */
+      make_simple_xml_tag(&buf, "S:include-props", "yes", scratch_pool);
+    }
 
   make_simple_xml_tag(&buf, "S:src-path", report->source, scratch_pool);
 
@@ -3215,11 +3219,13 @@ make_update_reporter(svn_ra_session_t *r
   /* When in 'send-all' mode, mod_dav_svn will assume that it should
      calculate and transmit real text-deltas (instead of empty windows
      that merely indicate "text is changed") unless it finds this
-     element.  When not in 'send-all' mode, mod_dav_svn will never
-     send text-deltas at all.
+     element.
 
      NOTE: Do NOT count on servers actually obeying this, as some exist
-     which obey send-all, but do not check for this directive at all! */
+     which obey send-all, but do not check for this directive at all!
+
+     NOTE 2: When not in 'send-all' mode, mod_dav_svn can still be configured 
to
+     override our request and send text-deltas. */
   if (! text_deltas)
     {
       make_simple_xml_tag(&buf, "S:text-deltas", "no", scratch_pool);

Modified: subversion/trunk/subversion/libsvn_subr/config_file.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/config_file.c?rev=1417642&r1=1417641&r2=1417642&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/config_file.c (original)
+++ subversion/trunk/subversion/libsvn_subr/config_file.c Wed Dec  5 20:54:03 
2012
@@ -807,6 +807,10 @@ svn_config_ensure(const char *config_dir
         "###   http-library               Which library to use for http/https"
                                                                              NL
         "###                              connections."                      NL
+        "###   bulk_updates               Whether to request bulk update" NL
+        "###                              responses, or fetch each file in "
+                                                                             NL
+        "###                              an individual request. "           NL
         "###   store-passwords            Specifies whether passwords used"  NL
         "###                              to authenticate against a"         NL
         "###                              Subversion server may be cached"   NL


Reply via email to