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/05/17 06:44:28 UTC

svn commit: r944967 - in /subversion/trunk/subversion/libsvn_wc: adm_ops.c props.c props.h workqueue.c

Author: gstein
Date: Mon May 17 04:44:28 2010
New Revision: 944967

URL: http://svn.apache.org/viewvc?rev=944967&view=rev
Log:
A couple additional tweaks for running with in-database properties, and
scatter some more uses of USE_DB_PROPS around for that testing.

Note: the test suite passes using in-database props, except for two
upgrade tests which result from a lack of props-upgrading code. The
upgrade code is the last piece before we do a format bump.

* subversion/libsvn_wc/props.h:
  (USE_DB_PROPS): undef'd for now, but an experimental control flag for
    using in-database properties.

* subversion/libsvn_wc/props.c:
  (load_props): do not define when USE_DB_PROPS is defined
  (svn_wc__get_revert_props): swap blocks for how fetching revert props is
    done, based on USE_DB_PROPS (the logic was reversed).
  (svn_wc__working_props_committed, svn_wc__props_delete): no-op when
    USE_DB_PROPS is defined.
  (svn_wc__props_modified): use load_actual_props and load_pristine_props
    instead of variations of load_props. be wary of NULL pristines.

* subversion/libsvn_wc/adm_ops.c:
  (process_committed_leaf): don't worry about revert props when
    USE_DB_PROPS is defined.
  (svn_wc_add4): don't worry about cleaning nubbins when USE_DB_PROPS is
    defined.
  (svn_wc__internal_remove_from_revision_control): no need to delete props
    when USE_DB_PROPS is defined.

* subversion/libsvn_wc/workqueue.c:
  (run_revert): ignore the prop files when USE_DB_PROPS is defined
  (run_prepare_revert_files): no need to prepare revert prop files when
    USE_DB_PROPS is defined.
  (run_delete): no need to delete prop files when USE_DB_PROPS
  (svn_wc__wq_build_write_old_props): return NULL for the work item when
    USE_DB_PROPS is defined... just skip the work.

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_ops.c
    subversion/trunk/subversion/libsvn_wc/props.c
    subversion/trunk/subversion/libsvn_wc/props.h
    subversion/trunk/subversion/libsvn_wc/workqueue.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=944967&r1=944966&r2=944967&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Mon May 17 04:44:28 2010
@@ -378,6 +378,7 @@ process_committed_leaf(svn_wc__db_t *db,
                                 scratch_pool));
     }
 
+#ifndef USE_DB_PROPS
   /* Queue a removal of any "revert" properties now. These correspond to
      the BASE properties, but hidden by new pristine props in WORKING.
      Regardless, the commit will be installing new BASE props.  */
@@ -399,6 +400,7 @@ process_committed_leaf(svn_wc__db_t *db,
                                          scratch_pool, scratch_pool));
     SVN_ERR(svn_wc__db_wq_add(db, adm_abspath, work_item, scratch_pool));
   }
+#endif
 
   /* ### this picks up file and symlink  */
   if (kind != svn_wc__db_kind_dir)
@@ -1557,6 +1559,7 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
                                      &tmp_entry, modify_flags, pool));
     }
 
+#ifndef USE_DB_PROPS
   /* If this is a replacement without history, we need to reset the
      properties for PATH. */
   /* ### this is totally bogus. we clear these cuz turds might have been
@@ -1566,6 +1569,7 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
       && copyfrom_url == NULL)
     SVN_ERR(svn_wc__props_delete(db, local_abspath, svn_wc__props_working,
                                  pool));
+#endif
 
   if (is_replace)
     {
@@ -2458,11 +2462,13 @@ svn_wc__internal_remove_from_revision_co
       SVN_ERR(svn_wc__text_base_path(&text_base_file, db, local_abspath,
                                      scratch_pool));
 
+#ifndef USE_DB_PROPS
       /* Remove prop/NAME, prop-base/NAME.svn-base. */
       SVN_ERR(svn_wc__props_delete(db, local_abspath, svn_wc__props_working,
                                    scratch_pool));
       SVN_ERR(svn_wc__props_delete(db, local_abspath, svn_wc__props_base,
                                    scratch_pool));
+#endif
 
       /* Remove NAME from PATH's entries file: */
       SVN_ERR(svn_wc__db_temp_op_remove_entry(db, local_abspath,

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=944967&r1=944966&r2=944967&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Mon May 17 04:44:28 2010
@@ -64,7 +64,6 @@
 #include "svn_private_config.h"
 
 /* #define TEST_DB_PROPS */
-/* #define USE_DB_PROPS */
 
 
 /* Forward declaration.  */
@@ -74,6 +73,8 @@ message_from_skel(const svn_skel_t *skel
                   apr_pool_t *scratch_pool);
 
 
+#ifndef USE_DB_PROPS
+
 /* Get PATH's properies of PROPS_KIND, and put them into *HASH.
    PATH should be of kind NODE_KIND. */
 static svn_error_t *
@@ -131,6 +132,8 @@ load_props(apr_hash_t **hash,
   return svn_stream_close(stream);
 }
 
+#endif /* USE_DB_PROPS  */
+
 
 static svn_error_t *
 load_pristine_props(apr_hash_t **props,
@@ -337,11 +340,11 @@ svn_wc__get_revert_props(apr_hash_t **re
   if (replaced)
     {
 #ifdef USE_DB_PROPS
-      SVN_ERR(load_props(revert_props_p, db, local_abspath,
-                         svn_wc__props_revert, result_pool));
-#else
       SVN_ERR(svn_wc__db_base_get_props(revert_props_p, db, local_abspath,
                                         result_pool, scratch_pool));
+#else
+      SVN_ERR(load_props(revert_props_p, db, local_abspath,
+                         svn_wc__props_revert, result_pool));
 #endif
     }
   else
@@ -503,6 +506,9 @@ svn_wc__working_props_committed(svn_wc__
                                 const char *local_abspath,
                                 apr_pool_t *scratch_pool)
 {
+#ifdef USE_DB_PROPS
+  return SVN_NO_ERROR;
+#else
   svn_wc__db_kind_t kind;
   const char *working;
   const char *base;
@@ -522,6 +528,7 @@ svn_wc__working_props_committed(svn_wc__
   /* svn_io_file_rename() retains a read-only bit, so there's no
      need to explicitly set it. */
   return svn_error_return(svn_io_file_rename(working, base, scratch_pool));
+#endif
 }
 
 
@@ -531,6 +538,9 @@ svn_wc__props_delete(svn_wc__db_t *db,
                      svn_wc__props_kind_t props_kind,
                      apr_pool_t *pool)
 {
+#ifdef USE_DB_PROPS
+  return SVN_NO_ERROR;
+#else
   const char *props_file;
   svn_wc__db_kind_t kind;
 
@@ -540,6 +550,7 @@ svn_wc__props_delete(svn_wc__db_t *db,
   SVN_ERR(svn_wc__prop_path(&props_file, local_abspath, kind, props_kind,
                             pool));
   return svn_error_return(svn_io_remove_file2(props_file, TRUE, pool));
+#endif
 }
 
 
@@ -2704,8 +2715,8 @@ svn_wc__props_modified(svn_boolean_t *mo
   else if (err)
     return err;
 
-  SVN_ERR(load_props(&localprops, db, local_abspath, svn_wc__props_working,
-                     scratch_pool));
+  SVN_ERR(load_actual_props(&localprops, db, local_abspath,
+                            scratch_pool, scratch_pool));
 
   /* If the WORKING props are not present, then no modifications have
      occurred. */
@@ -2733,8 +2744,15 @@ svn_wc__props_modified(svn_boolean_t *mo
   /* The WORKING props are present, so let's dig in and see what the
      differences are. On really old WCs, they might be the same. On
      newer WCs, the file would have been removed if there was no delta. */
-  SVN_ERR(load_props(&baseprops, db, local_abspath, svn_wc__props_base,
-                     scratch_pool));
+  SVN_ERR(load_pristine_props(&baseprops, db, local_abspath,
+                              scratch_pool, scratch_pool));
+  if (baseprops == NULL)
+    {
+      /* No pristines are defined. Let's say mods exist if there are any
+         ACTUAL props on this node.  */
+      *modified_p = apr_hash_count(localprops) > 0;
+      return SVN_NO_ERROR;
+    }
 
   SVN_ERR(svn_prop_diffs(&local_propchanges, localprops, baseprops,
                          scratch_pool));

Modified: subversion/trunk/subversion/libsvn_wc/props.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.h?rev=944967&r1=944966&r2=944967&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.h (original)
+++ subversion/trunk/subversion/libsvn_wc/props.h Mon May 17 04:44:28 2010
@@ -50,6 +50,10 @@ extern "C" {
 #undef SVN__SUPPORT_BASE_MERGE
 
 
+/* EXPERIMENTAL: use in-database props  */
+#undef USE_DB_PROPS
+
+
 typedef enum svn_wc__props_kind_t
 {
   svn_wc__props_base = 0,

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=944967&r1=944966&r2=944967&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Mon May 17 04:44:28 2010
@@ -236,6 +236,7 @@ run_revert(svn_wc__db_t *db,
             db, local_abspath,
             scratch_pool, scratch_pool));
 
+#ifndef USE_DB_PROPS
   /* Move the "revert" props over/on the "base" props.  */
   if (replaced)
     {
@@ -259,11 +260,14 @@ run_revert(svn_wc__db_t *db,
                                                 scratch_pool));
 #endif
     }
+#endif
 
   /* The "working" props contain changes. Nuke 'em from orbit.  */
+#ifndef USE_DB_PROPS
   SVN_ERR(svn_wc__prop_path(&working_props_path, local_abspath,
                             kind, svn_wc__props_working, scratch_pool));
   SVN_ERR(svn_io_remove_file2(working_props_path, TRUE, scratch_pool));
+#endif
 
   SVN_ERR(svn_wc__db_op_set_props(db, local_abspath, NULL, NULL, NULL,
                                   scratch_pool));
@@ -668,6 +672,7 @@ run_prepare_revert_files(svn_wc__db_t *d
 
   /* Set up the revert props.  */
 
+#ifndef USE_DB_PROPS
   SVN_ERR(svn_wc__prop_path(&revert_prop_abspath, local_abspath, kind,
                             svn_wc__props_revert, scratch_pool));
   SVN_ERR(svn_wc__prop_path(&base_prop_abspath, local_abspath, kind,
@@ -691,6 +696,7 @@ run_prepare_revert_files(svn_wc__db_t *d
       SVN_ERR(svn_io_set_file_read_only(revert_prop_abspath, FALSE,
                                         scratch_pool));
     }
+#endif
 
   /* Put some blank properties into the WORKING node.  */
   /* ### this seems bogus. something else should come along and put the
@@ -1755,6 +1761,7 @@ run_delete(svn_wc__db_t *db,
 
   if (was_replaced && was_copied)
     {
+#ifndef USE_DB_PROPS
       const char *props_base, *props_revert;
 
       SVN_ERR(svn_wc__prop_path(&props_base, local_abspath, kind,
@@ -1762,6 +1769,7 @@ run_delete(svn_wc__db_t *db,
       SVN_ERR(svn_wc__prop_path(&props_revert, local_abspath, kind,
                                 svn_wc__props_revert, scratch_pool));
       SVN_ERR(move_if_present(props_revert, props_base, scratch_pool));
+#endif
 
       if (kind != svn_wc__db_kind_dir)
         {
@@ -1774,6 +1782,7 @@ run_delete(svn_wc__db_t *db,
           SVN_ERR(move_if_present(text_revert, text_base, scratch_pool));
         }
     }
+#ifndef USE_DB_PROPS
   if (was_added)
     {
       const char *props_base, *props_working;
@@ -1786,6 +1795,7 @@ run_delete(svn_wc__db_t *db,
       SVN_ERR(svn_io_remove_file2(props_base, TRUE, scratch_pool));
       SVN_ERR(svn_io_remove_file2(props_working, TRUE, scratch_pool));
     }
+#endif
 
   return SVN_NO_ERROR;
 }
@@ -2197,6 +2207,9 @@ svn_wc__wq_build_write_old_props(svn_ske
                                  apr_hash_t *props,
                                  apr_pool_t *result_pool)
 {
+#ifdef USE_DB_PROPS
+  *work_item = NULL;
+#else
   *work_item = svn_skel__make_empty_list(result_pool);
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(props_abspath));
@@ -2211,6 +2224,7 @@ svn_wc__wq_build_write_old_props(svn_ske
   svn_skel__prepend_str(apr_pstrdup(result_pool, props_abspath),
                         *work_item, result_pool);
   svn_skel__prepend_str(OP_WRITE_OLD_PROPS, *work_item, result_pool);
+#endif
 
   return SVN_NO_ERROR;
 }