Author: gstein
Date: Tue Apr 27 03:16:35 2010
New Revision: 938307

URL: http://svn.apache.org/viewvc?rev=938307&view=rev
Log:
Follow the directions of a comment in svn_wc_add_repos_file4, and use the
workqueue operation to set up revert files. This removes a bunch of
duplicate code for the same semantic.

* subversion/libsvn_wc/update_editor.c:
  (svn_wc_add_repos_file4): switch to svn_wc__wq_prepare_revert_files
    rather than a sequence that preserves the text-base and props

* subversion/libsvn_wc/log.h:
* subversion/libsvn_wc/props.c:
  (svn_wc__loggy_revert_props_create): removed. no longer used.

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

Modified: subversion/trunk/subversion/libsvn_wc/log.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/log.h?rev=938307&r1=938306&r2=938307&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/log.h (original)
+++ subversion/trunk/subversion/libsvn_wc/log.h Tue Apr 27 03:16:35 2010
@@ -174,17 +174,6 @@ svn_wc__loggy_add_tree_conflict(svn_wc__
                                 apr_pool_t *scratch_pool);
 
 
-/* Queue work items to save the current baseprops of
-   LOCAL_ABSPATH as revert props.
-
-   Makes sure the baseprops are destroyed.
-*/
-svn_error_t *
-svn_wc__loggy_revert_props_create(svn_wc__db_t *db,
-                                  const char *local_abspath,
-                                  apr_pool_t *scratch_pool);
-
-
 /* TODO ###
 
    Use SCRATCH_POOL for temporary allocations.

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=938307&r1=938306&r2=938307&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Tue Apr 27 03:16:35 2010
@@ -97,7 +97,6 @@ message_from_skel(const svn_skel_t *skel
        sync'ing to disk and clearing appropriate caches.
      install_props_file(): Used with loggy.
      svn_wc__install_props(): Used with loggy.
-     svn_wc__loggy_revert_props_create(): Used with loggy.
  */
 
 /* The real functionality here is part of libsvn_subr, in hashdump.c.
@@ -473,72 +472,6 @@ svn_wc__props_delete(svn_wc__db_t *db,
   return svn_error_return(svn_io_remove_file2(props_file, TRUE, pool));
 }
 
-svn_error_t *
-svn_wc__loggy_revert_props_create(svn_wc__db_t *db,
-                                  const char *local_abspath,
-                                  apr_pool_t *scratch_pool)
-{
-  svn_wc__db_kind_t kind;
-  const char *adm_abspath;
-  const char *revert_prop_abspath;
-  const char *base_prop_abspath;
-  svn_node_kind_t on_disk;
-
-  SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, FALSE, scratch_pool));
-
-  if (kind == svn_wc__db_kind_dir)
-    adm_abspath = local_abspath;
-  else
-    adm_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
-
-  /* TODO(#2843) The current caller ensures that PATH will not be an excluded
-     item. But do we really need show_hidden = TRUE here? */
-
-  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,
-                            svn_wc__props_base, scratch_pool));
-
-  /* If prop base exist, move it to revert base. */
-  SVN_ERR(svn_io_check_path(base_prop_abspath, &on_disk, scratch_pool));
-  if (on_disk == svn_node_file)
-    {
-      SVN_ERR(svn_wc__loggy_move(db, adm_abspath,
-                                 base_prop_abspath, revert_prop_abspath,
-                                 scratch_pool));
-    }
-  else if (on_disk == svn_node_none)
-    {
-      const char *prop_tmp_abspath;
-      svn_stream_t *stream;
-
-      /* If there wasn't any prop base we still need an empty revert
-         propfile, otherwise a revert won't know that a change to the
-         props needs to be made (it'll just see no file, and do nothing).
-         So (loggily) write out an empty revert propfile.  */
-
-      /* Create an empty file.  */
-      SVN_ERR(svn_stream_open_unique(&stream, &prop_tmp_abspath,
-                                     svn_dirent_dirname(revert_prop_abspath,
-                                                        scratch_pool),
-                                     svn_io_file_del_none,
-                                     scratch_pool, scratch_pool));
-      SVN_ERR(svn_stream_close(stream));
-
-      /* Write a log entry to move tmp file to the destination.  */
-      SVN_ERR(svn_wc__loggy_move(db, adm_abspath,
-                                 prop_tmp_abspath, revert_prop_abspath,
-                                 scratch_pool));
-
-      /* And make the destination read-only.  */
-      SVN_ERR(svn_wc__loggy_set_readonly(db, adm_abspath,
-                                         revert_prop_abspath,
-                                         scratch_pool));
-    }
-
-  return SVN_NO_ERROR;
-}
-
 
 /*---------------------------------------------------------------------*/
 

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=938307&r1=938306&r2=938307&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Tue Apr 27 03:16:35 
2010
@@ -5844,19 +5844,9 @@ svn_wc_add_repos_file4(svn_wc_context_t 
             && status != svn_wc__db_status_added
             && status != svn_wc__db_status_obstructed_add)
           {
-            const char *dst_rtext;
-
-            /* ### replace this with: svn_wc__wq_prepare_revert_files()  */
-
-            SVN_ERR(svn_wc__text_revert_path(&dst_rtext, db, local_abspath,
-                                             pool));
-
-            SVN_ERR(svn_wc__loggy_move(db, dir_abspath,
-                                       text_base_abspath, dst_rtext,
-                                       pool));
-
-            SVN_ERR(svn_wc__loggy_revert_props_create(db, local_abspath,
-                                                      pool));
+            /* Move around some files to keep them safe for a possible
+               future revert operation.  */
+            SVN_ERR(svn_wc__wq_prepare_revert_files(db, local_abspath, pool));
           }
       }
   }


Reply via email to