You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/04/26 19:15:26 UTC

svn commit: r1096811 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_wc/props.c

Author: hwright
Date: Tue Apr 26 17:15:26 2011
New Revision: 1096811

URL: http://svn.apache.org/viewvc?rev=1096811&view=rev
Log:
Add and enforce a restriction that wcprops can only be set with depth = empty
in the working copy API.  This is how we are currently using the API, and it
allows us to remove the prop_kind check from each individual node.

(Besides wcprops are going away at some point, anyway.)

* subversion/include/svn_wc.h
  (svn_wc_prop_set4): Update docs.

* subversion/libsvn_wc/props.c
  (do_propset): Remove wcprop check from here...
  (svn_wc_prop_set4): ...and put it hear.  Assert we got depth = empty in
    the wcprops case.

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_wc/props.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1096811&r1=1096810&r2=1096811&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Tue Apr 26 17:15:26 2011
@@ -5772,8 +5772,8 @@ svn_wc_prop_get(const svn_string_t **val
  * #SVN_ERR_BAD_MIME_TYPE (if @a name is "svn:mime-type", but @a value
  * is not a valid mime-type).
  *
- * @a depth follows the usual semeatic for depth.
- * @note Currently only #svn_depth_empty is supported.
+ * @a depth follows the usual semeatic for depth.  If the property is a
+ * wc property, @a depth must be #svn_depth_empty.
  *
  * @a name may be a wc property or a regular property; but if it is an
  * entry property, return the error #SVN_ERR_BAD_PROP_KIND, even if

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=1096811&r1=1096810&r2=1096811&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Tue Apr 26 17:15:26 2011
@@ -2014,7 +2014,6 @@ do_propset(svn_wc__db_t *db,
            apr_pool_t *scratch_pool)
 {
   apr_hash_t *prophash;
-  enum svn_prop_kind prop_kind = svn_property_kind(NULL, name);
   svn_wc_notify_action_t notify_action;
   svn_wc__db_kind_t kind;
   svn_wc__db_status_t status;
@@ -2034,10 +2033,6 @@ do_propset(svn_wc__db_t *db,
                                db, local_abspath,
                                scratch_pool, scratch_pool));
 
-  if (prop_kind == svn_prop_wc_kind)
-    return svn_error_return(wcprop_set(db, local_abspath, name, value,
-                                       scratch_pool));
-
   if (status != svn_wc__db_status_normal
       && status != svn_wc__db_status_added
       && status != svn_wc__db_status_incomplete)
@@ -2246,6 +2241,14 @@ svn_wc_prop_set4(svn_wc_context_t *wc_ct
     return svn_error_createf(SVN_ERR_BAD_PROP_KIND, NULL,
                              _("Property '%s' is an entry property"), name);
 
+  /* Check to see if we're setting the dav cache. */
+  if (prop_kind == svn_prop_wc_kind)
+    {
+      SVN_ERR_ASSERT(depth == svn_depth_empty);
+      return svn_error_return(wcprop_set(wc_ctx->db, local_abspath,
+                                         name, value, scratch_pool));
+    }
+
   /* We have to do this little DIR_ABSPATH dance for backwards compat.
      But from 1.7 onwards, all locks are of infinite depth, and from 1.6
      backward we never call this API with depth > empty, so we only need