You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2010/04/23 13:46:09 UTC

svn commit: r937261 - in /subversion/trunk/subversion/libsvn_wc: props.c update_editor.c

Author: gstein
Date: Fri Apr 23 11:46:08 2010
New Revision: 937261

URL: http://svn.apache.org/viewvc?rev=937261&view=rev
Log:
Some nodes (eg. local-add) have no "pristine" properties. For these,
provide an empty set of properties to svn_wc__merge_props.

* subversion/libsvn_wc/props.c:
  (svn_wc_merge_props3): if BASE_PROPS is NULL, then create an empty hash
    of properties

* subversion/libsvn_wc/update_editor.c:
  (close_file): rearrange the logic a bit to ensure that we always have
    an empty set of properties, if no props are defined for the node state

Modified:
    subversion/trunk/subversion/libsvn_wc/props.c
    subversion/trunk/subversion/libsvn_wc/update_editor.c

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=937261&r1=937260&r2=937261&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Fri Apr 23 11:46:08 2010
@@ -665,6 +665,8 @@ svn_wc_merge_props3(svn_wc_notify_state_
 
   SVN_ERR(svn_wc__get_pristine_props(&base_props, wc_ctx->db, local_abspath,
                                      pool, pool));
+  if (base_props == NULL)
+    base_props = apr_hash_make(pool);  /* some nodes have no pristines  */
   SVN_ERR(svn_wc__get_actual_props(&actual_props, wc_ctx->db, local_abspath,
                                    pool, pool));
 

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=937261&r1=937260&r2=937261&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Fri Apr 23 11:46:08 2010
@@ -4797,12 +4797,9 @@ close_file(void *file_baton,
 
   if (fb->adding_file)
     {
-      current_base_props = (fb->copied_base_props
-                            ? fb->copied_base_props
-                            : apr_hash_make(pool));
-      current_actual_props = (fb->copied_working_props
-                              ? fb->copied_working_props
-                              : apr_hash_make(pool));
+      /* Adding with history? (aka copy-here)  */
+      current_base_props = fb->copied_base_props;
+      current_actual_props = fb->copied_working_props;
     }
   else
     {
@@ -4814,6 +4811,15 @@ close_file(void *file_baton,
                                        pool, pool));
     }
 
+  /* Note: even if the node existed before, it may not have
+     pristine props (e.g a local-add)  */
+  if (current_base_props == NULL)
+    current_base_props = apr_hash_make(pool);
+
+  /* And new nodes need an empty set of ACTUAL props.  */
+  if (current_actual_props == NULL)
+    current_actual_props = apr_hash_make(pool);
+
   prop_state = svn_wc_notify_state_unknown;
 
   /* Merge the 'regular' props into the existing working proplist. */