Author: danielsh
Date: Fri Jul 30 14:08:39 2010
New Revision: 980801

URL: http://svn.apache.org/viewvc?rev=980801&view=rev
Log:
On the 'atomic-revprop' branch:

Teach ra_neon, ra_serf, and mod_dav_svn to perform a capabilities exchange.

* subversion/include/svn_dav.h
  (SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS):  New macro.

* subversion/mod_dav_svn/version.c
  (get_vsn_options): Advertise SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS.

* subversion/libsvn_ra_serf/options.c
  (capabilities_headers_iterator_callback, options_response_handler),
* subversion/libsvn_ra_neon/options.c
  (parse_capabilities):
    Map SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS to SVN_RA_CAPABILITY_ATOMIC_REVPROPS.

* subversion/libsvn_ra_serf/commit.c
  (svn_ra_serf__change_rev_prop),
* subversion/libsvn_ra_neon/fetch.c
  (svn_ra_neon__change_rev_prop):
    Exchange the ATOMIC_REVPROPS capability.

Modified:
    subversion/branches/atomic-revprop/subversion/include/svn_dav.h
    subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/fetch.c
    subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/options.c
    subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/commit.c
    subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/options.c
    subversion/branches/atomic-revprop/subversion/mod_dav_svn/version.c

Modified: subversion/branches/atomic-revprop/subversion/include/svn_dav.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/include/svn_dav.h?rev=980801&r1=980800&r2=980801&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/include/svn_dav.h (original)
+++ subversion/branches/atomic-revprop/subversion/include/svn_dav.h Fri Jul 30 
14:08:39 2010
@@ -237,6 +237,12 @@ extern "C" {
 #define SVN_DAV_NS_DAV_SVN_LOG_REVPROPS SVN_DAV_PROP_NS_DAV "svn/log-revprops"
 
 /** Presence of this in a DAV header in an OPTIONS response indicates
+ * that the transmitter (in this case, the server) knows how to enforce
+ * old-value atomicity in PROPPATCH (for editing revprops). */
+#define SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS\
+            SVN_DAV_PROP_NS_DAV "svn/atomic-revprops"
+
+/** Presence of this in a DAV header in an OPTIONS response indicates
  * that the transmitter (in this case, the server) knows how to handle
  * a replay of a directory in the repository (not root). */
 #define SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY\

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/fetch.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/fetch.c?rev=980801&r1=980800&r2=980801&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/fetch.c 
(original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/fetch.c Fri 
Jul 30 14:08:39 2010
@@ -1138,7 +1138,18 @@ svn_error_t *svn_ra_neon__change_rev_pro
     };
 
   if (old_value_p)
-    SVN__NOT_IMPLEMENTED();
+    {
+      svn_boolean_t capable;
+      SVN_ERR(svn_ra_neon__has_capability(session, &capable,
+                                          SVN_RA_CAPABILITY_ATOMIC_REVPROPS,
+                                          pool));
+
+      /* How did you get past the same check in svn_ra_change_rev_prop2()? */
+      SVN_ERR_ASSERT(capable);
+
+      /* ### server-side support hasn't been implemented yet */
+      SVN__NOT_IMPLEMENTED();
+    }
 
   /* Main objective: do a PROPPATCH (allprops) on a baseline object */
 

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/options.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/options.c?rev=980801&r1=980800&r2=980801&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/options.c 
(original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/options.c Fri 
Jul 30 14:08:39 2010
@@ -150,6 +150,8 @@ parse_capabilities(ne_request *req,
                APR_HASH_KEY_STRING, capability_no);
   apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_LOG_REVPROPS,
                APR_HASH_KEY_STRING, capability_no);
+  apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_ATOMIC_REVPROPS,
+               APR_HASH_KEY_STRING, capability_no);
 
   /* Then find out which ones are supported. */
   val = ne_get_response_header(req, "dav");
@@ -197,6 +199,10 @@ parse_capabilities(ne_request *req,
         apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_LOG_REVPROPS,
                      APR_HASH_KEY_STRING, capability_yes);
 
+      if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS, 
vals))
+        apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_ATOMIC_REVPROPS,
+                     APR_HASH_KEY_STRING, capability_yes);
+
       if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY,
                                       vals))
         apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_PARTIAL_REPLAY,

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/commit.c?rev=980801&r1=980800&r2=980801&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/commit.c 
(original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/commit.c Fri 
Jul 30 14:08:39 2010
@@ -2159,7 +2159,18 @@ svn_ra_serf__change_rev_prop(svn_ra_sess
   svn_error_t *err;
 
   if (old_value_p)
-    SVN__NOT_IMPLEMENTED();
+    {
+      svn_boolean_t capable;
+      SVN_ERR(svn_ra_serf__has_capability(ra_session, &capable,
+                                          SVN_RA_CAPABILITY_ATOMIC_REVPROPS,
+                                          pool));
+
+      /* How did you get past the same check in svn_ra_change_rev_prop2()? */
+      SVN_ERR_ASSERT(capable);
+
+      /* ### server-side support hasn't been implemented yet */
+      SVN__NOT_IMPLEMENTED();
+    }
 
   commit = apr_pcalloc(pool, sizeof(*commit));
 

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/options.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/options.c?rev=980801&r1=980800&r2=980801&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/options.c 
(original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/options.c Fri 
Jul 30 14:08:39 2010
@@ -311,6 +311,13 @@ capabilities_headers_iterator_callback(v
                        SVN_RA_CAPABILITY_LOG_REVPROPS,
                        APR_HASH_KEY_STRING, capability_yes);
         }
+      if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS,
+                                      vals))
+        {
+          apr_hash_set(orc->session->capabilities,
+                       SVN_RA_CAPABILITY_ATOMIC_REVPROPS,
+                       APR_HASH_KEY_STRING, capability_yes);
+        }
       if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY, vals))
         {
           apr_hash_set(orc->session->capabilities,
@@ -400,6 +407,8 @@ options_response_handler(serf_request_t 
                APR_HASH_KEY_STRING, capability_no);
   apr_hash_set(orc->session->capabilities, SVN_RA_CAPABILITY_LOG_REVPROPS,
                APR_HASH_KEY_STRING, capability_no);
+  apr_hash_set(orc->session->capabilities, SVN_RA_CAPABILITY_ATOMIC_REVPROPS,
+               APR_HASH_KEY_STRING, capability_no);
 
   /* Then see which ones we can discover. */
   serf_bucket_headers_do(hdrs, capabilities_headers_iterator_callback, orc);

Modified: subversion/branches/atomic-revprop/subversion/mod_dav_svn/version.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/mod_dav_svn/version.c?rev=980801&r1=980800&r2=980801&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/mod_dav_svn/version.c 
(original)
+++ subversion/branches/atomic-revprop/subversion/mod_dav_svn/version.c Fri Jul 
30 14:08:39 2010
@@ -142,6 +142,7 @@ get_vsn_options(apr_pool_t *p, apr_text_
   /* Send SVN_RA_CAPABILITY_* capabilities. */
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_DEPTH);
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_LOG_REVPROPS);
+  apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS);
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY);
   /* Mergeinfo is a special case: here we merely say that the server
    * knows how to handle mergeinfo -- whether the repository does too


Reply via email to