You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2012/12/12 17:44:53 UTC

svn commit: r1420819 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_wc/deprecated.c libsvn_wc/props.c libsvn_wc/props.h libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c libsvn_wc/wc_db.h

Author: julianfoad
Date: Wed Dec 12 16:44:48 2012
New Revision: 1420819

URL: http://svn.apache.org/viewvc?rev=1420819&view=rev
Log:
Remove the ifdef'd-out support for a 'base merge' option in the function
svn_wc__perform_props_merge(). This functionality was deprecated in 1.7 as
documented in 'notes/api-errata/1.7/wc006.txt' and we have found no need to
restore it.

* subversion/include/svn_wc.h
  (svn_wc_merge_props2, svn_wc_merge_props, svn_wc_merge_prop_diffs):
    Tweak doc strings to clarify the status of the base_merge functionality.

* subversion/libsvn_wc/deprecated.c
  (svn_wc_merge_props2): No longer pass the base_merge parameter to
    svn_wc__perform_props_merge(), and return an error here (rather than
    there) if base_merge is requested. Mention the API errara file in the
    error message.

* subversion/libsvn_wc/props.c
  (svn_wc__perform_props_merge, svn_wc_merge_props3): Remove the
    'base_merge' parameter and supporting code.

* subversion/libsvn_wc/props.h
  (SVN__SUPPORT_BASE_MERGE): Remove this '#undef' and its documentation.
  (svn_wc__perform_props_merge): Remove the
    'base_merge' parameter and documentation.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_temp_base_set_props, svn_wc__db_temp_working_set_props):
    Remove.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_temp_base_set_props, svn_wc__db_temp_working_set_props,
   set_properties): Remove.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_UPDATE_NODE_BASE_PROPS, STMT_UPDATE_NODE_WORKING_PROPS): Remove.

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_wc/deprecated.c
    subversion/trunk/subversion/libsvn_wc/props.c
    subversion/trunk/subversion/libsvn_wc/props.h
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db.h

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1420819&r1=1420818&r2=1420819&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Wed Dec 12 16:44:48 2012
@@ -6891,8 +6891,9 @@ svn_wc_merge_props3(svn_wc_notify_state_
  *
  * This function has the @a base_merge parameter which (when TRUE) will
  * apply @a propchanges to this node's pristine set of properties. This
- * functionality is not supported on newer APIs -- pristine information
- * should only be changed through an update editor drive.
+ * functionality is not supported since API version 1.7 and will give an
+ * error if requested (unless @a dry_run is TRUE). For details see
+ * 'notes/api-errata/1.7/wc006.txt'.
  *
  * Uses a svn_wc_conflict_resolver_func_t conflict resolver instead of a
  * svn_wc_conflict_resolver_func2_t.
@@ -6901,7 +6902,7 @@ svn_wc_merge_props3(svn_wc_notify_state_
  * #SVN_ERR_UNVERSIONED_RESOURCE, when svn_wc_merge_props3 would return either
  * #SVN_ERR_WC_PATH_NOT_FOUND or #SVN_ERR_WC_PATH_UNEXPECTED_STATUS.
  *
- * @since New in 1.5.
+ * @since New in 1.5. The base_merge option is not supported since 1.7.
  * @deprecated Provided for backward compatibility with the 1.6 API.
  */
 SVN_DEPRECATED
@@ -6922,6 +6923,7 @@ svn_wc_merge_props2(svn_wc_notify_state_
  * Same as svn_wc_merge_props2(), but with a @a conflict_func (and
  * baton) of NULL.
  *
+ * @since New in 1.3. The base_merge option is not supported since 1.7.
  * @deprecated Provided for backward compatibility with the 1.4 API.
  */
 SVN_DEPRECATED
@@ -6943,7 +6945,9 @@ svn_wc_merge_props(svn_wc_notify_state_t
  * correct for 'svn update', it's incorrect for 'svn merge', and can
  * cause flawed behavior.  (See issue #2035.)
  *
+ * @since The base_merge option is not supported since 1.7.
  * @deprecated Provided for backward compatibility with the 1.2 API.
+ * Replaced by svn_wc_merge_props().
  */
 SVN_DEPRECATED
 svn_error_t *

Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=1420819&r1=1420818&r2=1420819&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Wed Dec 12 16:44:48 2012
@@ -2473,6 +2473,11 @@ svn_wc_merge_props2(svn_wc_notify_state_
   svn_error_t *err;
   struct conflict_func_1to2_baton conflict_wrapper;
 
+  if (base_merge && !dry_run)
+    return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                            U_("base_merge=TRUE is no longer supported; "
+                               "see notes/api-errata/1.7/wc006.txt"));
+
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
 
   conflict_wrapper.inner_func = conflict_func;
@@ -2485,7 +2490,6 @@ svn_wc_merge_props2(svn_wc_notify_state_
                                     NULL /* right_version */,
                                     baseprops,
                                     propchanges,
-                                    base_merge,
                                     dry_run,
                                     conflict_func ? conflict_func_1to2_wrapper
                                                   : NULL,

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=1420819&r1=1420818&r2=1420819&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Wed Dec 12 16:44:48 2012
@@ -188,7 +188,6 @@ svn_wc__perform_props_merge(svn_wc_notif
                             const svn_wc_conflict_version_t *right_version,
                             apr_hash_t *baseprops,
                             const apr_array_header_t *propchanges,
-                            svn_boolean_t base_merge,
                             svn_boolean_t dry_run,
                             svn_wc_conflict_resolver_func2_t conflict_func,
                             void *conflict_baton,
@@ -201,7 +200,6 @@ svn_wc__perform_props_merge(svn_wc_notif
   svn_kind_t kind;
   apr_hash_t *pristine_props = NULL;
   apr_hash_t *actual_props;
-  apr_hash_t *new_pristine_props;
   apr_hash_t *new_actual_props;
   svn_boolean_t had_props, props_mod;
   svn_boolean_t have_base;
@@ -294,8 +292,7 @@ svn_wc__perform_props_merge(svn_wc_notif
   /* Note that while this routine does the "real" work, it's only
      prepping tempfiles and writing log commands.  */
   SVN_ERR(svn_wc__merge_props(&conflict_skel, state,
-                              base_merge ? &new_pristine_props : NULL,
-                              &new_actual_props,
+                              NULL, &new_actual_props,
                               db, local_abspath,
                               baseprops /* server_baseprops */,
                               pristine_props,
@@ -339,24 +336,6 @@ svn_wc__perform_props_merge(svn_wc_notif
     /* After a (not-dry-run) merge, we ALWAYS have props to save.  */
     SVN_ERR_ASSERT(new_actual_props != NULL);
 
-/* See props.h  */
-#ifdef SVN__SUPPORT_BASE_MERGE
-    if (base_merge)
-      {
-        SVN_ERR_ASSERT(new_pristine_props != NULL);
-        if (status == svn_wc__db_status_added)
-          SVN_ERR(svn_wc__db_temp_working_set_props(
-                    db, local_abspath, new_pristine_props, scratch_pool));
-        else
-          SVN_ERR(svn_wc__db_temp_base_set_props(
-                    db, local_abspath, new_pristine_props, scratch_pool));
-      }
-#else
-    if (base_merge)
-      return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
-                              U_("base_merge=TRUE is no longer supported"));
-#endif
-
     SVN_ERR(svn_wc__db_op_set_props(db, local_abspath, new_actual_props,
                                     svn_wc__has_magic_property(propchanges),
                                     conflict_skel,
@@ -400,7 +379,6 @@ svn_wc_merge_props3(svn_wc_notify_state_
                            left_version, right_version,
                            baseprops,
                            propchanges,
-                           FALSE /* base_merge */,
                            dry_run,
                            conflict_func, conflict_baton,
                            cancel_func, cancel_baton,

Modified: subversion/trunk/subversion/libsvn_wc/props.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.h?rev=1420819&r1=1420818&r2=1420819&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.h (original)
+++ subversion/trunk/subversion/libsvn_wc/props.h Wed Dec 12 16:44:48 2012
@@ -37,18 +37,6 @@
 extern "C" {
 #endif /* __cplusplus */
 
-/* BASE_MERGE is a pre-1.7 concept on property merging. It allowed callers
-   to alter the pristine properties *outside* of an editor drive. That is
-   very dangerous: the pristines should always correspond to something from
-   the repository, and that should only arrive through the update editor.
-
-   For 1.7, we're removing this support. Some old code is being left around
-   in case we decide to change this.
-
-   For more information, see ^/notes/api-errata/1.7/wc006.txt
-*/
-#undef SVN__SUPPORT_BASE_MERGE
-
 /* Internal function for diffing props. See svn_wc_get_prop_diffs2(). */
 svn_error_t *
 svn_wc__internal_propdiff(apr_array_header_t **propchanges,
@@ -135,13 +123,7 @@ svn_wc__create_prejfile(const char **tmp
                         apr_pool_t *scratch_pool);
 
 
-/* Just like svn_wc_merge_props3(), but WITH a BASE_MERGE parameter.
-
-   If SVN__SUPPORT_BASE_MERGE is defined and BASE_MERGE is true, then
-   also use PROPCHANGES to modify the node's pristine properties.  (That
-   cannot generate conficts.)  If SVN__SUPPORT_BASE_MERGE is not defined
-   and BASE_MERGE is true, throw an error.
- */
+/* Just like svn_wc_merge_props3(). */
 svn_error_t *
 svn_wc__perform_props_merge(svn_wc_notify_state_t *state,
                             svn_wc__db_t *db,
@@ -150,7 +132,6 @@ svn_wc__perform_props_merge(svn_wc_notif
                             const svn_wc_conflict_version_t *right_version,
                             apr_hash_t *baseprops,
                             const apr_array_header_t *propchanges,
-                            svn_boolean_t base_merge,
                             svn_boolean_t dry_run,
                             svn_wc_conflict_resolver_func2_t conflict_func,
                             void *conflict_baton,

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1420819&r1=1420818&r2=1420819&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Wed Dec 12 16:44:48 2012
@@ -313,17 +313,6 @@ ORDER BY op_depth DESC
 SELECT properties FROM actual_node
 WHERE wc_id = ?1 AND local_relpath = ?2
 
--- STMT_UPDATE_NODE_BASE_PROPS
-UPDATE nodes SET properties = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
-
--- STMT_UPDATE_NODE_WORKING_PROPS
-UPDATE nodes SET properties = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2
-  AND op_depth =
-   (SELECT MAX(op_depth) FROM nodes
-    WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0)
-
 -- STMT_UPDATE_ACTUAL_PROPS
 UPDATE actual_node SET properties = ?3
 WHERE wc_id = ?1 AND local_relpath = ?2

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1420819&r1=1420818&r2=1420819&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Dec 12 16:44:48 2012
@@ -5232,67 +5232,6 @@ svn_wc__db_op_set_props(svn_wc__db_t *db
 }
 
 
-#ifdef SVN__SUPPORT_BASE_MERGE
-
-/* Set properties in a given table. The row must exist.  */
-static svn_error_t *
-set_properties(svn_wc__db_t *db,
-               const char *local_abspath,
-               const apr_hash_t *props,
-               int stmt_idx,
-               const char *table_name,
-               apr_pool_t *scratch_pool)
-{
-  svn_sqlite__stmt_t *stmt;
-  int affected_rows;
-
-  SVN_ERR_ASSERT(props != NULL);
-
-  SVN_ERR(get_statement_for_path(&stmt, db, local_abspath, stmt_idx,
-                                 scratch_pool));
-
-  SVN_ERR(svn_sqlite__bind_properties(stmt, 3, props, scratch_pool));
-  SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
-
-  if (affected_rows != 1)
-    return svn_error_createf(SVN_ERR_WC_DB_ERROR, NULL,
-                             _("Can't store properties for '%s' in '%s'."),
-                             svn_dirent_local_style(local_abspath,
-                                                    scratch_pool),
-                             table_name);
-
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_wc__db_temp_base_set_props(svn_wc__db_t *db,
-                               const char *local_abspath,
-                               const apr_hash_t *props,
-                               apr_pool_t *scratch_pool)
-{
-  SVN_ERR(set_properties(db, local_abspath, props,
-                         STMT_UPDATE_NODE_BASE_PROPS,
-                         "base node", scratch_pool));
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_wc__db_temp_working_set_props(svn_wc__db_t *db,
-                                  const char *local_abspath,
-                                  const apr_hash_t *props,
-                                  apr_pool_t *scratch_pool)
-{
-  SVN_ERR(set_properties(db, local_abspath, props,
-                         STMT_UPDATE_NODE_WORKING_PROPS,
-                         "working node", scratch_pool));
-  return SVN_NO_ERROR;
-}
-
-#endif /* SVN__SUPPORT_BASE_MERGE  */
-
-
 svn_error_t *
 svn_wc__db_op_modified(svn_wc__db_t *db,
                        const char *local_abspath,

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1420819&r1=1420818&r2=1420819&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Wed Dec 12 16:44:48 2012
@@ -1445,42 +1445,6 @@ svn_wc__db_op_set_props(svn_wc__db_t *db
                         const svn_skel_t *work_items,
                         apr_pool_t *scratch_pool);
 
-/* See props.h  */
-#ifdef SVN__SUPPORT_BASE_MERGE
-/* ### Set the properties of the node LOCAL_ABSPATH in the BASE tree to PROPS.
-   ###
-   ### This function should not exist because properties should be stored
-   ### onto the BASE node at construction time, in a single atomic operation.
-   ###
-   ### PROPS maps "const char *" names to "const svn_string_t *" values.
-   ### To specify no properties, PROPS must be an empty hash, not NULL.
-   ### If the node is not present, SVN_ERR_WC_PATH_NOT_FOUND is returned.
-*/
-svn_error_t *
-svn_wc__db_temp_base_set_props(svn_wc__db_t *db,
-                               const char *local_abspath,
-                               const apr_hash_t *props,
-                               apr_pool_t *scratch_pool);
-
-
-/* ### Set the properties of the node LOCAL_ABSPATH in the WORKING tree
-   ### to PROPS.
-   ###
-   ### This function should not exist because properties should be stored
-   ### onto the WORKING node at construction time, in a single atomic
-   ### operation.
-   ###
-   ### PROPS maps "const char *" names to "const svn_string_t *" values.
-   ### To specify no properties, PROPS must be an empty hash, not NULL.
-   ### If the node is not present, SVN_ERR_WC_PATH_NOT_FOUND is returned.
-*/
-svn_error_t *
-svn_wc__db_temp_working_set_props(svn_wc__db_t *db,
-                                  const char *local_abspath,
-                                  const apr_hash_t *props,
-                                  apr_pool_t *scratch_pool);
-#endif
-
 /* Mark LOCAL_ABSPATH, and all children, for deletion.
  *
  * This function removes the file externals (and if DELETE_DIR_EXTERNALS is