subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1565080 - in /subversion/branches/1.8.x: ./ STATUS subversion/libsvn_client/prop_commands.c
Date Thu, 06 Feb 2014 05:23:52 GMT
Author: breser
Date: Thu Feb  6 05:23:52 2014
New Revision: 1565080

URL: http://svn.apache.org/r1565080
Log:
Merge the r1549858 group from trunk:

 * r1549858, r1549874
   Make svn_client_proplist4() behave as documented when reporting inherited
   properties.
   Justification:
     The current implementation with multiple callbacks for the same path
     just makes things hard on api users that want to use inherited properties
     as intended.
   Votes:
     +1: rhuijben, philip, breser

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/libsvn_client/prop_commands.c

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1549858,1549874

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1565080&r1=1565079&r2=1565080&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Thu Feb  6 05:23:52 2014
@@ -205,13 +205,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1549858, r1549874
-   Make svn_client_proplist4() behave as documented when reporting inherited
-   properties.
-   Justification:
-     The current implementation with multiple callbacks for the same path
-     just makes things hard on api users that want to use inherited properties
-     as intended.
-   Votes:
-     +1: rhuijben, philip, breser

Modified: subversion/branches/1.8.x/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_client/prop_commands.c?rev=1565080&r1=1565079&r2=1565080&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_client/prop_commands.c Thu Feb  6 05:23:52
2014
@@ -1201,6 +1201,7 @@ struct recursive_proplist_receiver_baton
   svn_wc_context_t *wc_ctx;  /* Working copy context. */
   svn_proplist_receiver2_t wrapped_receiver;  /* Proplist receiver to call. */
   void *wrapped_receiver_baton;    /* Baton for the proplist receiver. */
+  apr_array_header_t *iprops;
 
   /* Anchor, anchor_abspath pair for converting to relative paths */
   const char *anchor;
@@ -1216,6 +1217,27 @@ recursive_proplist_receiver(void *baton,
 {
   struct recursive_proplist_receiver_baton *b = baton;
   const char *path;
+  apr_array_header_t *iprops = NULL;
+
+  if (b->iprops
+      && ! strcmp(local_abspath, b->anchor_abspath))
+    {
+      /* Report iprops with the properties for the anchor */
+      iprops = b->iprops;
+      b->iprops = NULL;
+    }
+  else if (b->iprops)
+    {
+      /* No report for the root?
+         Report iprops anyway */
+
+      SVN_ERR(b->wrapped_receiver(b->wrapped_receiver_baton,
+                                  b->anchor ? b->anchor : local_abspath,
+                                  NULL /* prop_hash */,
+                                  b->iprops,
+                                  scratch_pool));
+      b->iprops = NULL;
+    }
 
   /* Attempt to convert absolute paths to relative paths for
    * presentation purposes, if needed. */
@@ -1230,7 +1252,7 @@ recursive_proplist_receiver(void *baton,
     path = local_abspath;
 
   return svn_error_trace(b->wrapped_receiver(b->wrapped_receiver_baton,
-                                             path, props, NULL,
+                                             path, props, iprops,
                                              scratch_pool));
 }
 
@@ -1370,6 +1392,7 @@ get_local_props(const char *path_or_url,
   svn_node_kind_t kind;
   apr_hash_t *changelist_hash = NULL;
   const char *local_abspath;
+  apr_array_header_t *iprops = NULL;
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path_or_url,
                                   scratch_pool));
@@ -1392,7 +1415,6 @@ get_local_props(const char *path_or_url,
 
   if (get_target_inherited_props)
     {
-      apr_array_header_t *iprops;
       const char *repos_root_url;
 
       SVN_ERR(svn_wc__get_iprops(&iprops, ctx->wc_ctx, local_abspath,
@@ -1402,8 +1424,6 @@ get_local_props(const char *path_or_url,
       SVN_ERR(svn_client__iprop_relpaths_to_urls(iprops, repos_root_url,
                                                  scratch_pool,
                                                  scratch_pool));
-      SVN_ERR(call_receiver(path_or_url, NULL, iprops, receiver,
-                            receiver_baton, scratch_pool));
     }
 
   if (changelists && changelists->nelts)
@@ -1418,16 +1438,16 @@ get_local_props(const char *path_or_url,
       rb.wc_ctx = ctx->wc_ctx;
       rb.wrapped_receiver = receiver;
       rb.wrapped_receiver_baton = receiver_baton;
+      rb.iprops = iprops;
+      rb.anchor_abspath = local_abspath;
 
       if (strcmp(path_or_url, local_abspath) != 0)
         {
           rb.anchor = path_or_url;
-          rb.anchor_abspath = local_abspath;
         }
       else
         {
           rb.anchor = NULL;
-          rb.anchor_abspath = NULL;
         }
 
       SVN_ERR(svn_wc__prop_list_recursive(ctx->wc_ctx, local_abspath, NULL,
@@ -1435,6 +1455,13 @@ get_local_props(const char *path_or_url,
                                           recursive_proplist_receiver, &rb,
                                           ctx->cancel_func, ctx->cancel_baton,
                                           scratch_pool));
+
+      if (rb.iprops)
+        {
+          /* We didn't report for the root. Report iprops anyway */
+          SVN_ERR(call_receiver(path_or_url, NULL /* props */, rb.iprops,
+                                receiver, receiver_baton, scratch_pool));
+        }
     }
   else if (svn_wc__changelist_match(ctx->wc_ctx, local_abspath,
                                     changelist_hash, scratch_pool))
@@ -1464,7 +1491,7 @@ get_local_props(const char *path_or_url,
               }
           }
 
-      SVN_ERR(call_receiver(path_or_url, props, NULL,
+      SVN_ERR(call_receiver(path_or_url, props, iprops,
                             receiver, receiver_baton, scratch_pool));
 
     }



Mime
View raw message