[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r26476 - trunk/subversion/libsvn_wc

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2007-09-06 08:58:03 CEST

Ok. This commit breaks an update and switch test over HTTP. The cause
is my overenthousiastic removal of svn_wc__remove_wcprops(). It's
something I'll have to fix tonight.

If someone wants to revert in the mean time to make buildbots usefull
again, be my guest.

bye,

Erik.

On 9/6/07, dionisos@tigris.org <dionisos@tigris.org> wrote:
> Author: dionisos
> Date: Wed Sep 5 15:52:02 2007
> New Revision: 26476
>
> Log:
> Push propfile handling back into libsvn_wc/props.c.
>
> Note: This change centralizes all prop file access and thereby
> allows for 'easy' change of storage method for props.
>
> * subversion/libsvn_wc/adm_files.h
> * subversion/libsvn_wc/adm_files.c
> (svn_wc__prop_revert_path,
> svn_wc__prop_base_path,
> svn_wc__props_wcprop_path,
> prop_path_internal): Removed. Absorbed into ...
> (svn_wc__prop_path): ... here. Add a prop_kind parameter to signal
> which prop path is requested.
>
> * subversion/libsvn_wc/props.h
> * subversion/libsvn_wc/props.c
> (svn_wc__props_kind_t): New enum to specify prop classes.
> (load_prop_file,
> save_prop_file): Renamed from ...
> (svn_wc__load_prop_file,
> svn_wc__save_prop_file): ... these, since they have become
> (and should stay) implementation details of the props module.
> (svn_wc__remove_wcprops): Obsolete. Removed and absorbed into ...
> (svn_wc__props_delete,
> svn_wc__loggy_props_delete): ... here.
> New functions to delete specified props.
> (svn_wc__loggy_revert_props_create,
> svn_wc__loggy_revert_props_restore): New. Functions to save/restore
> base props into/from revert props.
> (svn_wc__props_last_modified): New. Function to check for last
> modification of specified props.
> (svn_wc__load_props): Add revert_props_p parameter to be able to load
> revert props.
>
> * subversion/libsvn_wc/questions.c
> * subversion/libsvn_wc/lock.c
> * subversion/libsvn_wc/copy.c
> * subversion/libsvn_wc/relocate.c
> * subversion/libsvn_wc/log.c
> Adjust callers and clean up.
>
> * subversion/libsvn_wc/adm_ops.c
> Adjust callers and clean up.
> (mark_tree): Clear wcprops while walking the tree. This way,
> we don't need to walk the tree again afterwards. (Allows removal of
> svn_wc__remove_wcprops().)
>
>
> Modified:
> trunk/subversion/libsvn_wc/adm_files.c
> trunk/subversion/libsvn_wc/adm_files.h
> trunk/subversion/libsvn_wc/adm_ops.c
> trunk/subversion/libsvn_wc/copy.c
> trunk/subversion/libsvn_wc/lock.c
> trunk/subversion/libsvn_wc/log.c
> trunk/subversion/libsvn_wc/props.c
> trunk/subversion/libsvn_wc/props.h
> trunk/subversion/libsvn_wc/questions.c
> trunk/subversion/libsvn_wc/relocate.c
> trunk/subversion/libsvn_wc/update_editor.c
>
> Modified: trunk/subversion/libsvn_wc/adm_files.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/adm_files.c?pathrev=26476&r1=26475&r2=26476
> ==============================================================================
> --- trunk/subversion/libsvn_wc/adm_files.c (original)
> +++ trunk/subversion/libsvn_wc/adm_files.c Wed Sep 5 15:52:02 2007
> @@ -399,24 +399,15 @@
> NULL);
> }
>
> -/* Kind for prop_path_internal. */
> -typedef enum prop_path_kind_t
> -{
> - prop_path_kind_base = 0,
> - prop_path_kind_revert,
> - prop_path_kind_wcprop,
> - prop_path_kind_working
> -} prop_path_kind_t;
> -
> -static svn_error_t *
> -prop_path_internal(const char **prop_path,
> - const char *path,
> - svn_node_kind_t kind,
> - prop_path_kind_t path_kind,
> - svn_boolean_t tmp,
> - apr_pool_t *pool)
> +svn_error_t *
> +svn_wc__prop_path(const char **prop_path,
> + const char *path,
> + svn_node_kind_t node_kind,
> + svn_wc__props_kind_t props_kind,
> + svn_boolean_t tmp,
> + apr_pool_t *pool)
> {
> - if (kind == svn_node_dir) /* It's a working copy dir */
> + if (node_kind == svn_node_dir) /* It's a working copy dir */
> {
> static const char * names[] = {
> SVN_WC__ADM_DIR_PROP_BASE, /* prop_path_kind_base */
> @@ -430,7 +421,7 @@
> NULL,
> tmp,
> pool,
> - names[path_kind],
> + names[props_kind],
> NULL);
> }
> else /* It's a file */
> @@ -454,10 +445,10 @@
> svn_path_split(path, prop_path, &base_name, pool);
> *prop_path = extend_with_adm_name
> (*prop_path,
> - extensions[path_kind],
> + extensions[props_kind],
> tmp,
> pool,
> - dirs[path_kind],
> + dirs[props_kind],
> base_name,
> NULL);
> }
> @@ -465,58 +456,6 @@
> return SVN_NO_ERROR;
> }
>
> -
> -
> -/* Return a path to the 'wcprop' file for PATH, possibly in TMP area. */
> -svn_error_t *
> -svn_wc__wcprop_path(const char **wcprop_path,
> - const char *path,
> - svn_node_kind_t kind,
> - svn_boolean_t tmp,
> - apr_pool_t *pool)
> -{
> - return prop_path_internal(wcprop_path, path, kind,
> - prop_path_kind_wcprop, tmp, pool);
> -}
> -
> -
> -
> -
> -svn_error_t *
> -svn_wc__prop_path(const char **prop_path,
> - const char *path,
> - svn_node_kind_t kind,
> - svn_boolean_t tmp,
> - apr_pool_t *pool)
> -{
> - return prop_path_internal(prop_path, path, kind,
> - prop_path_kind_working, tmp, pool);
> -}
> -
> -
> -svn_error_t *
> -svn_wc__prop_base_path(const char **prop_path,
> - const char *path,
> - svn_node_kind_t kind,
> - svn_boolean_t tmp,
> - apr_pool_t *pool)
> -{
> - return prop_path_internal(prop_path, path, kind,
> - prop_path_kind_base, tmp, pool);
> -}
> -
> -
> -svn_error_t *
> -svn_wc__prop_revert_path(const char **prop_path,
> - const char *path,
> - svn_node_kind_t kind,
> - svn_boolean_t tmp,
> - apr_pool_t *pool)
> -{
> - return prop_path_internal(prop_path, path, kind,
> - prop_path_kind_revert, tmp, pool);
> -}
> -
>
> /*** Opening and closing files in the adm area. ***/
>
>
> Modified: trunk/subversion/libsvn_wc/adm_files.h
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/adm_files.h?pathrev=26476&r1=26475&r2=26476
> ==============================================================================
> --- trunk/subversion/libsvn_wc/adm_files.h (original)
> +++ trunk/subversion/libsvn_wc/adm_files.h Wed Sep 5 15:52:02 2007
> @@ -26,6 +26,8 @@
> #include <apr_pools.h>
> #include "svn_types.h"
>
> +#include "props.h"
> +
> #ifdef __cplusplus
> extern "C" {
> #endif /* __cplusplus */
> @@ -98,50 +100,19 @@
> apr_pool_t *pool);
>
>
> -/* Return a path to the 'wcprop' file for PATH, possibly in TMP area.
> - Valid values for KIND are svn_node_dir and svn_node_file. */
> -svn_error_t *svn_wc__wcprop_path(const char **wcprop_path,
> - const char *path,
> - svn_node_kind_t kind,
> - svn_boolean_t tmp,
> - apr_pool_t *pool);
> -
> -
> -/* Set *PROP_PATH to PATH's working properties file.
> +/* Set *PROP_PATH to PATH's PROPS_KIND properties file.
> If TMP is set, return a path to the tmp working property file.
> PATH can be a directory or file, and even have changed w.r.t. the
> - working copy's adm knowledge. Valid values for KIND are svn_node_dir
> + working copy's adm knowledge. Valid values for NODE_KIND are svn_node_dir
> and svn_node_file. */
> svn_error_t *svn_wc__prop_path(const char **prop_path,
> const char *path,
> - svn_node_kind_t kind,
> + svn_node_kind_t node_kind,
> + svn_wc__props_kind_t props_kind,
> svn_boolean_t tmp,
> apr_pool_t *pool);
>
>
> -/* Set *PROP_PATH to PATH's `pristine' properties file.
> - If TMP is set, return a path to the tmp working property file.
> - PATH can be a directory or file, and even have changed w.r.t. the
> - working copy's adm knowledge. Valid values for KIND are svn_node_dir
> - and svn_node_file. */
> -svn_error_t *svn_wc__prop_base_path(const char **prop_path,
> - const char *path,
> - svn_node_kind_t kind,
> - svn_boolean_t tmp,
> - apr_pool_t *pool);
> -
> -
> -/* Set *PROP_PATH to PATH's revert properties file.
> - If TMP is set, return a path to the tmp working property file.
> - PATH can be a directory or file, and even have changed w.r.t. the
> - working copy's adm knowledge. Valid values for KIND are svn_node_dir
> - and svn_node_file. */
> -svn_error_t *svn_wc__prop_revert_path(const char **prop_path,
> - const char *path,
> - svn_node_kind_t kind,
> - svn_boolean_t tmp,
> - apr_pool_t *pool);
> -
>
> /*** Opening all kinds of adm files ***/
>
>
> Modified: trunk/subversion/libsvn_wc/adm_ops.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/adm_ops.c?pathrev=26476&r1=26475&r2=26476
> ==============================================================================
> --- trunk/subversion/libsvn_wc/adm_ops.c (original)
> +++ trunk/subversion/libsvn_wc/adm_ops.c Wed Sep 5 15:52:02 2007
> @@ -205,15 +205,17 @@
> svn_node_kind_t kind;
>
> if (is_prop)
> - SVN_ERR(svn_wc__prop_revert_path(&revert_file, path, svn_node_file,
> - FALSE, pool));
> + SVN_ERR(svn_wc__loggy_props_delete(logtags, path, svn_wc__props_revert,
> + adm_access, pool));
> else
> - revert_file = svn_wc__text_revert_path(path, FALSE, pool);
> + {
> + revert_file = svn_wc__text_revert_path(path, FALSE, pool);
>
> - SVN_ERR(svn_io_check_path(revert_file, &kind, pool));
> + SVN_ERR(svn_io_check_path(revert_file, &kind, pool));
>
> - if (kind == svn_node_file)
> - SVN_ERR(svn_wc__loggy_remove(logtags, adm_access, revert_file, pool));
> + if (kind == svn_node_file)
> + SVN_ERR(svn_wc__loggy_remove(logtags, adm_access, revert_file, pool));
> + }
>
> return SVN_NO_ERROR;
> }
> @@ -937,6 +939,11 @@
> | SVN_WC__ENTRY_MODIFY_COPIED),
> TRUE, subpool));
>
> + if (copied)
> + /* Remove now obsolete wcprops */
> + SVN_ERR(svn_wc__props_delete(fullpath, svn_wc__props_wcprop,
> + adm_access, subpool));
> +
> /* Tell someone what we've done. */
> if (schedule == svn_wc_schedule_delete && notify_func != NULL)
> (*notify_func)(notify_baton,
> @@ -1259,12 +1266,6 @@
> svn_wc__text_base_path(path, FALSE, pool);
> const char *text_revert =
> svn_wc__text_revert_path(path, FALSE, pool);
> - const char *prop_base, *prop_revert;
> -
> - SVN_ERR(svn_wc__prop_base_path(&prop_base, path,
> - was_kind, FALSE, pool));
> - SVN_ERR(svn_wc__prop_revert_path(&prop_revert, path,
> - was_kind, FALSE, pool));
>
> if (was_kind != svn_node_dir) /* Dirs don't have text-bases */
> /* Restore the original text-base */
> @@ -1272,20 +1273,13 @@
> text_revert, text_base,
> FALSE, pool));
>
> - SVN_ERR(svn_wc__loggy_move(&log_accum, NULL,
> - adm_access, prop_revert, prop_base,
> - TRUE, pool));
> + SVN_ERR(svn_wc__loggy_revert_props_restore(&log_accum,
> + path, adm_access, pool));
> }
> if (was_schedule == svn_wc_schedule_add)
> - {
> - /* remove the properties file */
> - const char *svn_prop_file_path;
> - SVN_ERR(svn_wc__prop_path(&svn_prop_file_path, path,
> - was_kind, FALSE, pool));
> - SVN_ERR(svn_wc__loggy_remove(&log_accum, adm_access,
> - svn_prop_file_path, pool));
> - }
> -
> + SVN_ERR(svn_wc__loggy_props_delete(&log_accum, path,
> + svn_wc__props_base,
> + adm_access, pool));
>
> SVN_ERR(svn_wc__write_log(adm_access, 0, log_accum, pool));
>
> @@ -1511,12 +1505,8 @@
> /* If this is a replacement without history, we need to reset the
> properties for PATH. */
> if (orig_entry && (! copyfrom_url))
> - {
> - const char *prop_path;
> - SVN_ERR(svn_wc__prop_path(&prop_path, path,
> - orig_entry->kind, FALSE, pool));
> - SVN_ERR(remove_file_if_present(prop_path, pool));
> - }
> + SVN_ERR(svn_wc__props_delete(path, svn_wc__props_working,
> + adm_access, pool));
>
> if (kind == svn_node_dir) /* scheduling a directory for addition */
> {
> @@ -1613,7 +1603,8 @@
> pool));
>
> /* Clean out the now-obsolete wcprops. */
> - SVN_ERR(svn_wc__remove_wcprops(adm_access, NULL, TRUE, pool));
> + SVN_ERR(svn_wc__props_delete(path, svn_wc__props_wcprop,
> + adm_access, pool));
> }
> }
>
> @@ -1731,32 +1722,21 @@
> /* Deal with properties. */
> if (entry->schedule == svn_wc_schedule_replace)
> {
> - const char *rprop;
> - svn_node_kind_t kind;
> -
> - revert_base = TRUE;
> + revert_base = entry->copied;
> /* Use the revertpath as the new propsbase if it exists. */
> - SVN_ERR(svn_wc__prop_revert_path(&rprop, fullpath, entry->kind, FALSE,
> - pool));
> - SVN_ERR(svn_io_check_path(rprop, &kind, pool));
>
> - /* If the revert-base doesn't exist, check for a normal propsbase */
> - if (kind != svn_node_file)
> - {
> - SVN_ERR(svn_wc__prop_base_path(&rprop, fullpath, entry->kind, FALSE,
> - pool));
> - SVN_ERR(svn_io_check_path(rprop, &kind, pool));
> - revert_base = FALSE;
> - }
> - if (kind == svn_node_file)
> - {
> - baseprops = apr_hash_make(pool);
> - SVN_ERR(svn_wc__load_prop_file(rprop, baseprops, pool));
> - /* Ensure the revert propfile gets removed. */
> - if (revert_base)
> - SVN_ERR(svn_wc__loggy_remove(&log_accum, adm_access, rprop, pool));
> - *reverted = TRUE;
> - }
> + baseprops = apr_hash_make(pool);
> + SVN_ERR(svn_wc__load_props((! revert_base) ? &baseprops : NULL,
> + NULL,
> + revert_base ? &baseprops : NULL,
> + adm_access, fullpath, pool));
> +
> + /* Ensure the revert propfile gets removed. */
> + if (revert_base)
> + SVN_ERR(svn_wc__loggy_props_delete(&log_accum,
> + fullpath, svn_wc__props_revert,
> + adm_access, pool));
> + *reverted = TRUE;
> }
>
> /* If not schedule replace, or no revert props, use the normal
> @@ -2276,35 +2256,22 @@
> }
>
> /* Remove the wcprops. */
> - SVN_ERR(svn_wc__remove_wcprops(adm_access, name, FALSE, pool));
> + SVN_ERR(svn_wc__props_delete(full_path, svn_wc__props_wcprop,
> + adm_access, pool));
> + /* Remove prop/NAME, prop-base/NAME.svn-base. */
> + SVN_ERR(svn_wc__props_delete(full_path, svn_wc__props_working,
> + adm_access, pool));
> + SVN_ERR(svn_wc__props_delete(full_path, svn_wc__props_base,
> + adm_access, pool));
>
> /* Remove NAME from PATH's entries file: */
> SVN_ERR(svn_wc_entries_read(&entries, adm_access, TRUE, pool));
> svn_wc__entry_remove(entries, name);
> SVN_ERR(svn_wc__entries_write(entries, adm_access, pool));
>
> - /* Remove text-base/NAME.svn-base, prop/NAME, prop-base/NAME.svn-base. */
> - {
> - const char *svn_thang;
> -
> - /* Text base. */
> - svn_thang = svn_wc__text_base_path(full_path, 0, pool);
> - SVN_ERR(remove_file_if_present(svn_thang, pool));
> -
> - /* Working prop file. */
> - SVN_ERR(svn_wc__prop_path(&svn_thang, full_path,
> - is_file ? svn_node_file : svn_node_dir,
> - FALSE, pool));
> - SVN_ERR(remove_file_if_present(svn_thang, pool));
> -
> - /* Prop base file. */
> - SVN_ERR(svn_wc__prop_base_path(&svn_thang, full_path,
> - is_file ? svn_node_file
> - : svn_node_dir,
> - FALSE, pool));
> - SVN_ERR(remove_file_if_present(svn_thang, pool));
> -
> - }
> + /* Remove text-base/NAME.svn-base */
> + SVN_ERR(remove_file_if_present(svn_wc__text_base_path(full_path, 0, pool),
> + pool));
>
> /* If we were asked to destroy the working file, do so unless
> it has local mods. */
> @@ -2342,7 +2309,8 @@
> /* Get rid of all the wcprops in this directory. This avoids rewriting
> the wcprops file over and over (meaning O(n^2) complexity)
> below. */
> - SVN_ERR(svn_wc__remove_wcprops(adm_access, NULL, FALSE, pool));
> + SVN_ERR(svn_wc__props_delete(full_path, svn_wc__props_wcprop,
> + adm_access, pool));
>
> /* Walk over every entry. */
> SVN_ERR(svn_wc_entries_read(&entries, adm_access, FALSE, pool));
>
> Modified: trunk/subversion/libsvn_wc/copy.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/copy.c?pathrev=26476&r1=26475&r2=26476
> ==============================================================================
> --- trunk/subversion/libsvn_wc/copy.c (original)
> +++ trunk/subversion/libsvn_wc/copy.c Wed Sep 5 15:52:02 2007
> @@ -459,7 +459,7 @@
> }
>
> /* Load source base and working props. */
> - SVN_ERR(svn_wc__load_props(&base_props, &props, src_access,
> + SVN_ERR(svn_wc__load_props(&base_props, &props, NULL, src_access,
> src_path, pool));
>
> /* Copy pristine text-base to temporary location. */
> @@ -521,7 +521,7 @@
> const char *path = svn_wc_adm_access_path(adm_access);
>
> /* Remove wcprops. */
> - SVN_ERR(svn_wc__remove_wcprops(adm_access, NULL, FALSE, pool));
> + SVN_ERR(svn_wc__props_delete(path, svn_wc__props_wcprop, adm_access, pool));
>
> /* Read this directory's entries file. */
> SVN_ERR(svn_wc_entries_read(&entries, adm_access, FALSE, pool));
>
> Modified: trunk/subversion/libsvn_wc/lock.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/lock.c?pathrev=26476&r1=26475&r2=26476
> ==============================================================================
> --- trunk/subversion/libsvn_wc/lock.c (original)
> +++ trunk/subversion/libsvn_wc/lock.c Wed Sep 5 15:52:02 2007
> @@ -143,7 +143,7 @@
> svn_pool_clear(subpool);
>
> entrypath = svn_path_join(adm_path, entry->name, subpool);
> - SVN_ERR(svn_wc__load_props(&base_props, &props, adm_access,
> + SVN_ERR(svn_wc__load_props(&base_props, &props, NULL, adm_access,
> entrypath, subpool));
> SVN_ERR(svn_wc__install_props(&log_accum, adm_access, entrypath,
> base_props, props, TRUE, subpool));
>
> Modified: trunk/subversion/libsvn_wc/log.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/log.c?pathrev=26476&r1=26475&r2=26476
> ==============================================================================
> --- trunk/subversion/libsvn_wc/log.c (original)
> +++ trunk/subversion/libsvn_wc/log.c Wed Sep 5 15:52:02 2007
> @@ -805,36 +805,11 @@
> if ((modify_flags & SVN_WC__ENTRY_MODIFY_PROP_TIME)
> && (! strcmp(valuestr, SVN_WC__TIMESTAMP_WC)))
> {
> - const char *pfile;
> apr_time_t prop_time;
> - const svn_wc_entry_t *tfile_entry;
> -
> - err = svn_wc_entry(&tfile_entry, tfile, loggy->adm_access,
> - FALSE, loggy->pool);
> -
> - if (err)
> - SIGNAL_ERROR(loggy, err);
> -
> - if (! tfile_entry)
> - return SVN_NO_ERROR;
> -
> - err = svn_wc__prop_path(&pfile, tfile, tfile_entry->kind, FALSE,
> - loggy->pool);
> - if (err)
> - SIGNAL_ERROR(loggy, err);
> -
> - err = svn_io_file_affected_time(&prop_time, pfile, loggy->pool);
> - if (err && APR_STATUS_IS_ENOENT(err->apr_err))
> - {
> - svn_error_clear(err);
> - prop_time = 0;
> - }
> - else if (err)
> - return svn_error_createf
> - (pick_error_code(loggy), NULL,
> - _("Error getting 'affected time' on '%s'"),
> - svn_path_local_style(pfile, loggy->pool));
>
> + SVN_ERR(svn_wc__props_last_modified(&prop_time,
> + tfile, svn_wc__props_working,
> + loggy->adm_access, loggy->pool));
> entry->prop_time = prop_time;
> }
>
>
> Modified: trunk/subversion/libsvn_wc/props.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/props.c?pathrev=26476&r1=26475&r2=26476
> ==============================================================================
> --- trunk/subversion/libsvn_wc/props.c (original)
> +++ trunk/subversion/libsvn_wc/props.c Wed Sep 5 15:52:02 2007
> @@ -65,15 +65,29 @@
> /* The real functionality here is part of libsvn_subr, in hashdump.c.
> But these are convenience routines for use in libsvn_wc. */
>
> +static svn_error_t *
> +get_prop_path(const char **ppath,
> + const char *path,
> + svn_wc__props_kind_t props_kind,
> + svn_wc_adm_access_t *adm_access,
> + apr_pool_t *pool)
> +{
> + const svn_wc_entry_t *entry;
>
> + SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, TRUE, pool));
> + SVN_ERR(svn_wc__prop_path(ppath, path, entry->kind,
> + props_kind, FALSE, pool));
> +
> + return SVN_NO_ERROR;
> +}
>
> /* If PROPFILE_PATH exists (and is a file), assume it's full of
> properties and load this file into HASH. Otherwise, leave HASH
> untouched. */
> -svn_error_t *
> -svn_wc__load_prop_file(const char *propfile_path,
> - apr_hash_t *hash,
> - apr_pool_t *pool)
> +static svn_error_t *
> +load_prop_file(const char *propfile_path,
> + apr_hash_t *hash,
> + apr_pool_t *pool)
> {
> svn_error_t *err;
>
> @@ -108,11 +122,11 @@
> an emtpy property hash will result in an actual empty property
> file on disk, otherwise an empty hash will result in no file
> being written at all. */
> -svn_error_t *
> -svn_wc__save_prop_file(const char *propfile_path,
> - apr_hash_t *hash,
> - svn_boolean_t write_empty,
> - apr_pool_t *pool)
> +static svn_error_t *
> +save_prop_file(const char *propfile_path,
> + apr_hash_t *hash,
> + svn_boolean_t write_empty,
> + apr_pool_t *pool)
> {
> apr_file_t *prop_tmp;
>
> @@ -149,7 +163,7 @@
> /* Get path to /temporary/ local prop file */
> SVN_ERR(svn_wc__prop_path(&tmp_path, full_path,
> is_dir ? svn_node_dir : svn_node_file,
> - TRUE, pool));
> + svn_wc__props_working, TRUE, pool));
>
> /* Reserve a .prej file based on it. */
> SVN_ERR(svn_io_open_unique_file2(fp, reject_tmp_path, tmp_path,
> @@ -240,6 +254,7 @@
> svn_error_t *
> svn_wc__load_props(apr_hash_t **base_props_p,
> apr_hash_t **props_p,
> + apr_hash_t **revert_props_p,
> svn_wc_adm_access_t *adm_access,
> const char *path,
> apr_pool_t *pool)
> @@ -259,6 +274,8 @@
> *base_props_p = apr_hash_make(pool);
> if (props_p)
> *props_p = apr_hash_make(pool);
> + if (revert_props_p)
> + *revert_props_p = apr_hash_make(pool);
> return SVN_NO_ERROR;
> }
>
> @@ -271,10 +288,10 @@
> {
> const char *prop_base_path;
>
> - SVN_ERR(svn_wc__prop_base_path(&prop_base_path, path,
> - kind, FALSE, pool));
> + SVN_ERR(svn_wc__prop_path(&prop_base_path,
> + path, kind, svn_wc__props_base, FALSE, pool));
> base_props = apr_hash_make(pool);
> - SVN_ERR(svn_wc__load_prop_file(prop_base_path, base_props, pool));
> + SVN_ERR(load_prop_file(prop_base_path, base_props, pool));
>
> if (base_props_p)
> *base_props_p = base_props;
> @@ -288,14 +305,30 @@
> {
> const char *prop_path;
>
> - SVN_ERR(svn_wc__prop_path(&prop_path, path, kind, FALSE, pool));
> + SVN_ERR(svn_wc__prop_path(&prop_path, path, kind,
> + svn_wc__props_working, FALSE, pool));
> *props_p = apr_hash_make(pool);
> - SVN_ERR(svn_wc__load_prop_file(prop_path, *props_p, pool));
> + SVN_ERR(load_prop_file(prop_path, *props_p, pool));
> }
> else
> *props_p = apr_hash_make(pool);
> }
>
> + if (revert_props_p)
> + {
> + *revert_props_p = apr_hash_make(pool);
> +
> + if (entry->schedule == svn_wc_schedule_replace
> + && entry->copied)
> + {
> + const char *revert_prop_path;
> +
> + SVN_ERR(svn_wc__prop_path(&revert_prop_path, path, kind,
> + svn_wc__props_revert, FALSE, pool));
> + SVN_ERR(load_prop_file(revert_prop_path, *revert_props_p, pool));
> + }
> + }
> +
> return SVN_NO_ERROR;
> }
>
> @@ -349,16 +382,16 @@
> paths computed are ABSOLUTE pathnames, which is what our disk
> routines require. */
> SVN_ERR(svn_wc__prop_path(&working_propfile_path, path,
> - kind, FALSE, pool));
> + kind, svn_wc__props_working, FALSE, pool));
> if (tmp_entry.has_prop_mods)
> {
> SVN_ERR(svn_wc__prop_path(&working_prop_tmp_path, path,
> - kind, TRUE, pool));
> + kind, svn_wc__props_working, TRUE, pool));
>
> /* Write the working prop hash to path/.svn/tmp/props/name or
> path/.svn/tmp/dir-props */
> - SVN_ERR(svn_wc__save_prop_file(working_prop_tmp_path, working_props,
> - FALSE, pool));
> + SVN_ERR(save_prop_file(working_prop_tmp_path, working_props,
> + FALSE, pool));
>
> /* Write log entry to move working tmp copy to real working area. */
> SVN_ERR(svn_wc__loggy_move(log_accum, NULL,
> @@ -384,16 +417,15 @@
> {
> const char *base_propfile_path, *base_prop_tmp_path;
>
> - SVN_ERR(svn_wc__prop_base_path(&base_propfile_path, path,
> - kind, FALSE, pool));
> + SVN_ERR(svn_wc__prop_path(&base_propfile_path, path,
> + kind, svn_wc__props_base, FALSE, pool));
>
> if (apr_hash_count(base_props) > 0)
> {
> - SVN_ERR(svn_wc__prop_base_path(&base_prop_tmp_path, path,
> - kind, TRUE, pool));
> + SVN_ERR(svn_wc__prop_path(&base_prop_tmp_path, path,
> + kind, svn_wc__props_base, TRUE, pool));
>
> - SVN_ERR(svn_wc__save_prop_file(base_prop_tmp_path, base_props,
> - FALSE, pool));
> + SVN_ERR(save_prop_file(base_prop_tmp_path, base_props, FALSE, pool));
>
> SVN_ERR(svn_wc__loggy_move(log_accum, NULL, adm_access,
> base_prop_tmp_path,
> @@ -422,19 +454,23 @@
> svn_boolean_t sync_entries,
> apr_pool_t *pool)
> {
> - const char *working_path;
> - const char *base_path;
> + const char *working;
> + const char *base;
> const svn_wc_entry_t *entry;
> svn_wc_entry_t mod_entry;
> svn_wc_adm_access_t *mod_access;
>
> +
> SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, TRUE, pool));
> - SVN_ERR(svn_wc__prop_path(&working_path, path, entry->kind, FALSE, pool));
> - SVN_ERR(svn_wc__prop_base_path(&base_path, path, entry->kind, FALSE, pool));
> +
> + SVN_ERR(svn_wc__prop_path(&working, path, entry->kind,
> + svn_wc__props_working, FALSE, pool));
> + SVN_ERR(svn_wc__prop_path(&base, path, entry->kind,
> + svn_wc__props_base, FALSE, pool));
>
> /* svn_io_file_rename() retains a read-only bit, so there's no
> need to explicitly set it. */
> - SVN_ERR(svn_io_file_rename(working_path, base_path, pool));
> + SVN_ERR(svn_io_file_rename(working, base, pool));
>
> SVN_ERR(svn_wc_adm_probe_retrieve(&mod_access, adm_access, path, pool));
> mod_entry.has_prop_mods = FALSE;
> @@ -445,6 +481,242 @@
> return SVN_NO_ERROR;
> }
>
> +
> +svn_error_t *
> +svn_wc__props_last_modified(apr_time_t *mod_time,
> + const char *path,
> + svn_wc__props_kind_t props_kind,
> + svn_wc_adm_access_t *adm_access,
> + apr_pool_t *pool)
> +{
> + svn_error_t *err;
> + const char *props_file;
> +
> + SVN_ERR(get_prop_path(&props_file, path, props_kind, adm_access, pool));
> +
> + err = svn_io_file_affected_time(mod_time, props_file, pool);
> + if (err && APR_STATUS_IS_ENOENT(err->apr_err))
> + {
> + svn_error_clear(err);
> + *mod_time = 0;
> + }
> + else
> + SVN_ERR_W(err,
> + apr_psprintf(pool,
> + _("Error getting 'affected time' on '%s'"),
> + svn_path_local_style(props_file, pool)));
> +
> + return SVN_NO_ERROR;
> +}
> +
> +static svn_error_t *
> +remove_file_if_present(const char *file, apr_pool_t *pool)
> +{
> + svn_error_t *err;
> +
> + /* Try to remove the file. */
> + err = svn_io_remove_file(file, pool);
> +
> + /* Ignore file not found error. */
> + if (err && APR_STATUS_IS_ENOENT(err->apr_err))
> + {
> + svn_error_clear(err);
> + err = SVN_NO_ERROR;
> + }
> +
> + return err;
> +}
> +
> +svn_error_t *
> +svn_wc__loggy_props_delete(svn_stringbuf_t **log_accum,
> + const char *path,
> + svn_wc__props_kind_t props_kind,
> + svn_wc_adm_access_t *adm_access,
> + apr_pool_t *pool)
> +{
> + const char *props_file;
> +
> + SVN_ERR(get_prop_path(&props_file, path, props_kind, adm_access, pool));
> + SVN_ERR(svn_wc__loggy_remove(log_accum, adm_access, props_file, pool));
> +
> + return SVN_NO_ERROR;
> +}
> +
> +
> +svn_error_t *
> +svn_wc__props_delete(const char *path,
> + svn_wc__props_kind_t props_kind,
> + svn_wc_adm_access_t *adm_access,
> + apr_pool_t *pool)
> +{
> + const char *props_file;
> +
> + SVN_ERR(get_prop_path(&props_file, path, props_kind, adm_access, pool));
> + SVN_ERR(remove_file_if_present(props_file, pool));
> +
> + return SVN_NO_ERROR;
> +}
> +
> +svn_error_t *
> +svn_wc__loggy_revert_props_create(svn_stringbuf_t **log_accum,
> + const char *path,
> + svn_wc_adm_access_t *adm_access,
> + svn_boolean_t destroy_baseprops,
> + apr_pool_t *pool)
> +{
> + const svn_wc_entry_t *entry;
> + const char *dst_rprop;
> + const char *dst_bprop;
> + const char *tmp_rprop;
> + svn_node_kind_t kind;
> +
> + SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, TRUE, pool));
> +
> + SVN_ERR(svn_wc__prop_path(&dst_rprop, path,
> + entry->kind, svn_wc__props_revert, FALSE, pool));
> + SVN_ERR(svn_wc__prop_path(&tmp_rprop, path,
> + entry->kind, svn_wc__props_revert, TRUE, pool));
> + SVN_ERR(svn_wc__prop_path(&dst_bprop, path,
> + entry->kind, svn_wc__props_base, FALSE, pool));
> +
> + /* If prop base exist, copy it to revert base. */
> + SVN_ERR(svn_io_check_path(dst_bprop, &kind, pool));
> + if (kind == svn_node_file)
> + {
> + if (destroy_baseprops)
> + SVN_ERR(svn_wc__loggy_move(log_accum, NULL,
> + adm_access, dst_bprop, dst_rprop,
> + FALSE, pool));
> + else
> + {
> + SVN_ERR(svn_io_copy_file(dst_bprop, tmp_rprop, TRUE, pool));
> + SVN_ERR(svn_wc__loggy_move(log_accum, NULL, adm_access,
> + tmp_rprop, dst_rprop, FALSE, pool));
> + }
> + }
> + else if (kind == svn_node_none)
> + {
> + /* 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 manufacture an empty propfile and force it to be written out. */
> +
> + SVN_ERR(svn_wc__prop_path(&dst_bprop, path,
> + entry->kind, svn_wc__props_revert, TRUE, pool));
> +
> + SVN_ERR(save_prop_file(dst_bprop, apr_hash_make(pool), TRUE, pool));
> +
> + SVN_ERR(svn_wc__loggy_move(log_accum, NULL,
> + adm_access, dst_bprop, dst_rprop,
> + FALSE, pool));
> + }
> +
> + return SVN_NO_ERROR;
> +}
> +
> +#if 0
> +/*### Some day, when we get better log primitives,
> + we probably want to stat() less, which can be done coding
> + 'calls' to functions like the one below into as a log command.*/
> +svn_error_t *
> +svn_wc__revert_props_create(const char *path,
> + svn_wc_adm_access_t *adm_access,
> + svn_boolean_t destroy_baseprops,
> + svn_boolean_t maybe_rerun,
> + apr_pool_t *pool)
> +{
> + const svn_wc_entry_t *entry;
> + const char *revert_file, *base_file;
> + const char *tmp_revert_file;
> + svn_error_t *err;
> +
> + SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, TRUE, pool));
> +
> + SVN_ERR(svn_wc__prop_path(&base_file, path, entry->kind, svn_wc__props_base,
> + FALSE, pool));
> + SVN_ERR(svn_wc__prop_path(&revert_file, path, entry->kind,
> + svn_wc__props_revert, FALSE, pool));
> + SVN_ERR(svn_wc__prop_path(&tmp_revert_file, path, entry->kind,
> + svn_wc__props_revert, TRUE, pool));
> +
> +
> + if (destroy_baseprops)
> + err = svn_io_file_rename(base_file, revert_file, pool);
> + else
> + {
> + err = svn_io_copy_file(base_file, tmp_revert_file, TRUE, pool);
> + if (! err)
> + SVN_ERR(svn_io_file_rename(tmp_revert_file, revert_file, pool));
> + }
> +
> + if (err && APR_STATUS_IS_ENOENT(err->apr_err))
> + /* If there's no file to move or copy, create one. */
> + {
> + svn_node_kind_t kind = svn_node_none;
> +
> + svn_error_clear(err);
> +
> + if (maybe_rerun)
> + SVN_ERR(svn_io_check_path(revert_file, &kind, pool));
> +
> + if (kind == svn_node_none)
> + {
> + SVN_ERR(save_prop_file(tmp_revert_file,
> + apr_hash_make(pool), TRUE, pool));
> + SVN_ERR(svn_io_file_rename(base_file, revert_file, pool));
> + }
> + }
> +
> + return SVN_NO_ERROR;
> +}
> +#endif
> +
> +svn_error_t *
> +svn_wc__loggy_revert_props_restore(svn_stringbuf_t **log_accum,
> + const char *path,
> + svn_wc_adm_access_t *adm_access,
> + apr_pool_t *pool)
> +{
> + const svn_wc_entry_t *entry;
> + const char *revert_file, *base_file;
> +
> + SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, TRUE, pool));
> +
> + SVN_ERR(svn_wc__prop_path(&base_file, path, entry->kind, svn_wc__props_base,
> + FALSE, pool));
> + SVN_ERR(svn_wc__prop_path(&revert_file, path, entry->kind,
> + svn_wc__props_revert, FALSE, pool));
> +
> + SVN_ERR(svn_wc__loggy_move(log_accum, NULL, adm_access,
> + revert_file, base_file, FALSE, pool));
> + return SVN_NO_ERROR;
> +}
> +
> +
> +#if 0
> +/*### Some day, when we get better log primitives,
> + we probably want to stat() less, which can be done coding
> + 'calls' to functions like the one below into as a log command.*/
> +svn_error_t *
> +svn_wc__revert_props_restore(const char *path,
> + svn_wc_adm_access_t *adm_access,
> + apr_pool_t *pool)
> +{
> + const svn_wc_entry_t *entry;
> + const char *revert_file, *base_file;
> +
> + SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, TRUE, pool));
> +
> + SVN_ERR(svn_wc__prop_path(&base_file, path, entry->kind, svn_wc__props_base,
> + FALSE, pool));
> + SVN_ERR(svn_wc__prop_path(&revert_file, path, entry->kind,
> + svn_wc__props_revert, FALSE, pool));
> +
> + SVN_ERR(svn_io_file_rename(revert_file, base_file, pool));
> + return SVN_NO_ERROR;
> +}
> +#endif
> +
> /*---------------------------------------------------------------------*/
>
> /*** Merging propchanges into the working copy ***/
> @@ -937,7 +1209,7 @@
> is_dir = FALSE;
>
> /* Load the base & working property files into hashes */
> - SVN_ERR(svn_wc__load_props(&base_props, &working_props,
> + SVN_ERR(svn_wc__load_props(&base_props, &working_props, NULL,
> adm_access, path, pool));
> if (!server_baseprops)
> server_baseprops = base_props;
> @@ -1312,9 +1584,10 @@
> /* Fall back on individual files for backwards compatibility. */
>
> /* Construct a path to the relevant property file */
> - SVN_ERR(svn_wc__wcprop_path(&prop_path, path, entry->kind, FALSE, pool));
> + SVN_ERR(svn_wc__prop_path(&prop_path, path, entry->kind,
> + svn_wc__props_wcprop, FALSE, pool));
> *wcprops = apr_hash_make(pool);
> - SVN_ERR(svn_wc__load_prop_file(prop_path, *wcprops, pool));
> + SVN_ERR(load_prop_file(prop_path, *wcprops, pool));
>
> return SVN_NO_ERROR;
> }
> @@ -1413,96 +1686,9 @@
> return SVN_NO_ERROR;
> }
>
> -svn_error_t *
> -svn_wc__remove_wcprops(svn_wc_adm_access_t *adm_access,
> - const char *name,
> - svn_boolean_t recurse,
> - apr_pool_t *pool)
> -{
> - apr_hash_t *all_wcprops = svn_wc__adm_access_wcprops(adm_access);
> - svn_boolean_t write_needed = FALSE;
> -
> - if (! name)
> - {
> - /* There is no point in reading the props just to determine if we
> - need to rewrite them:-), so assume a write is needed if the props
> - aren't already cached. */
> - if (! all_wcprops || apr_hash_count(all_wcprops) > 0)
> - {
> - svn_wc__adm_access_set_wcprops
> - (adm_access, apr_hash_make(svn_wc_adm_access_pool(adm_access)));
> - write_needed = TRUE;
> - }
> - }
> - else
> - {
> - apr_hash_t *wcprops;
> - if (! all_wcprops)
> - {
> - SVN_ERR(read_wcprops(adm_access, pool));
> - all_wcprops = svn_wc__adm_access_wcprops(adm_access);
> - }
> - if (all_wcprops)
> - wcprops = apr_hash_get(all_wcprops, name, APR_HASH_KEY_STRING);
> - else
> - wcprops = NULL;
> - if (wcprops && apr_hash_count(wcprops) > 0)
> - {
> - apr_hash_set(all_wcprops, name, APR_HASH_KEY_STRING, NULL);
> - write_needed = TRUE;
> - }
> - }
> - if (write_needed)
> - SVN_ERR(svn_wc__wcprops_write(adm_access, pool));
> -
> - if (recurse)
> - {
> - apr_hash_t *entries;
> - apr_hash_index_t *hi;
> - apr_pool_t *subpool = svn_pool_create(pool);
> -
> - /* Read PATH's entries. */
> - SVN_ERR(svn_wc_entries_read(&entries, adm_access, FALSE, subpool));
> -
> - /* Recursively loop over all children. */
> - for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
> - {
> - const void *key;
> - void *val;
> - const char *entryname;
> - const svn_wc_entry_t *current_entry;
> - const char *child_path;
> - svn_wc_adm_access_t *child_access;
> -
> - apr_hash_this(hi, &key, NULL, &val);
> - entryname = key;
> - current_entry = val;
> -
> - /* Ignore files and the "this dir" entry. */
> - if (current_entry->kind != svn_node_dir
> - || ! strcmp(entryname, SVN_WC_ENTRY_THIS_DIR))
> - continue;
> -
> - svn_pool_clear(subpool);
> -
> - child_path = svn_path_join(svn_wc_adm_access_path(adm_access),
> - entryname, subpool);
> -
> - SVN_ERR(svn_wc_adm_retrieve(&child_access, adm_access, child_path,
> - subpool));
> - SVN_ERR(svn_wc__remove_wcprops(child_access, NULL, TRUE, subpool));
> - }
> -
> - /* Cleanup */
> - svn_pool_destroy(subpool);
> - }
> -
> - return SVN_NO_ERROR;
> -}
> -
> -
> /*------------------------------------------------------------------*/
>
> +
> /*** Public Functions ***/
>
>
> @@ -1530,7 +1716,7 @@
> SVN_ERR(svn_wc_adm_retrieve(&adm_access, adm_access,
> svn_path_dirname(path, pool), pool));
>
> - return svn_wc__load_props(NULL, props, adm_access, path, pool);
> + return svn_wc__load_props(NULL, props, NULL, adm_access, path, pool);
> }
>
> /* Determine if PROPNAME is contained in the list of space separated
> @@ -1818,7 +2004,7 @@
> /* If not, we'll set the file to read-only at commit time. */
> }
>
> - SVN_ERR_W(svn_wc__load_props(&base_prophash, &prophash,
> + SVN_ERR_W(svn_wc__load_props(&base_prophash, &prophash, NULL,
> adm_access, path, pool),
> _("Failed to load properties from disk"));
>
> @@ -2066,7 +2252,8 @@
>
> /* The rest is for compatibility with WCs that don't have propcaching. */
>
> - SVN_ERR(svn_wc__prop_path(&prop_path, path, entry->kind, FALSE, pool));
> + SVN_ERR(svn_wc__prop_path(&prop_path, path, entry->kind,
> + svn_wc__props_working, FALSE, pool));
> SVN_ERR(empty_props_p(&is_empty, prop_path, pool));
>
> if (is_empty)
> @@ -2130,9 +2317,10 @@
> have some work to do... */
>
> /* First, get the paths of the working and 'base' prop files. */
> - SVN_ERR(svn_wc__prop_path(&prop_path, path, entry->kind, FALSE, subpool));
> - SVN_ERR(svn_wc__prop_base_path(&prop_base_path, path, entry->kind, FALSE,
> - subpool));
> + SVN_ERR(svn_wc__prop_path(&prop_path, path, entry->kind,
> + svn_wc__props_working, FALSE, subpool));
> + SVN_ERR(svn_wc__prop_path(&prop_base_path, path, entry->kind,
> + svn_wc__props_base, FALSE, subpool));
>
> /* Check for numerous easy outs on older WC formats before we
> resort to svn_prop_diffs(). */
> @@ -2257,10 +2445,8 @@
> apr_hash_t *baseprops = apr_hash_make(subpool);
>
> /* ### Amazingly, this stats the files again! */
> - SVN_ERR(svn_wc__load_prop_file(prop_path, localprops, subpool));
> - SVN_ERR(svn_wc__load_prop_file(prop_base_path,
> - baseprops,
> - subpool));
> + SVN_ERR(load_prop_file(prop_path, localprops, subpool));
> + SVN_ERR(load_prop_file(prop_base_path, baseprops, subpool));
>
> /* Don't use the subpool is we are hanging on to the changed props. */
> SVN_ERR(svn_prop_diffs(&local_propchanges, localprops,
> @@ -2339,7 +2525,7 @@
> apr_hash_t *baseprops = apr_hash_make(pool);
>
> /* Load all properties into hashes */
> - SVN_ERR(svn_wc__load_props(&baseprops, &localprops,
> + SVN_ERR(svn_wc__load_props(&baseprops, &localprops, NULL,
> adm_access, path, pool));
>
> /* Get an array of local changes by comparing the hashes. */
> @@ -2390,7 +2576,7 @@
> SVN_ERR(svn_wc_adm_retrieve(&adm_access, adm_access, dirname, pool));
> }
>
> - SVN_ERR(svn_wc__load_props(&baseprops, propchanges ? &props : NULL,
> + SVN_ERR(svn_wc__load_props(&baseprops, propchanges ? &props : NULL, NULL,
> adm_access, path, pool));
>
> if (original_props != NULL)
>
> Modified: trunk/subversion/libsvn_wc/props.h
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/props.h?pathrev=26476&r1=26475&r2=26476
> ==============================================================================
> --- trunk/subversion/libsvn_wc/props.h (original)
> +++ trunk/subversion/libsvn_wc/props.h Wed Sep 5 15:52:02 2007
> @@ -30,6 +30,14 @@
> extern "C" {
> #endif /* __cplusplus */
>
> +typedef enum svn_wc__props_kind_t
> +{
> + svn_wc__props_base = 0,
> + svn_wc__props_revert,
> + svn_wc__props_wcprop,
> + svn_wc__props_working
> +} svn_wc__props_kind_t;
> +
>
> /* If the working item at PATH has properties attached, set HAS_PROPS.
> ADM_ACCESS is an access baton set that contains PATH. */
> @@ -37,26 +45,6 @@
> const char *path,
> svn_wc_adm_access_t *adm_access,
> apr_pool_t *pool);
> -
> -
> -/* If PROPFILE_PATH exists (and is a file), assume it's full of
> - properties and load this file into HASH. Otherwise, leave HASH
> - untouched. */
> -svn_error_t *svn_wc__load_prop_file(const char *propfile_path,
> - apr_hash_t *hash,
> - apr_pool_t *pool);
> -
> -
> -
> -/* Given a HASH full of property name/values, write them to a file
> - located at PROPFILE_PATH. If WRITE_EMPTY is true, the file will
> - be written out even if HASH is empty. */
> -svn_error_t *svn_wc__save_prop_file(const char *propfile_path,
> - apr_hash_t *hash,
> - svn_boolean_t write_empty,
> - apr_pool_t *pool);
> -
> -
> /* Given ADM_ACCESS/PATH and an array of PROPCHANGES based on
> SERVER_BASEPROPS, merge the changes into the working copy.
> Necessary log entries will be appended to ENTRY_ACCUM.
> @@ -113,14 +101,6 @@
> svn_boolean_t force_write,
> apr_pool_t *pool);
>
> -/* Remove wcprops for entry NAME under ADM_ACCESS, or for all files
> - and this_dir if NAME is null. Recurse into subdirectories if
> - RECURSE is true. Use POOL for temporary allocations. */
> -svn_error_t *svn_wc__remove_wcprops(svn_wc_adm_access_t *adm_access,
> - const char *name,
> - svn_boolean_t recurse,
> - apr_pool_t *pool);
> -
> /* Write the wcprops cached in ADM_ACCESS, if any, to disk using POOL for
> temporary allocations. */
> svn_error_t *
> @@ -146,6 +126,43 @@
> svn_boolean_t write_base_props,
> apr_pool_t *pool);
>
> +/* Extend LOG_ACCUM with log entries to save the current baseprops of PATH
> + as revert props.
> +
> + Makes sure the baseprops are destroyed if DESTROY_BASEPROPS is TRUE,
> + the baseprops are preserved otherwise.
> +*/
> +svn_error_t *
> +svn_wc__loggy_revert_props_create(svn_stringbuf_t **log_accum,
> + const char *path,
> + svn_wc_adm_access_t *adm_access,
> + svn_boolean_t destroy_baseprops,
> + apr_pool_t *pool);
> +
> +/* Extends LOG_ACCUM to make the revert props back into base props,
> + deleting the revert props. */
> +svn_error_t *
> +svn_wc__loggy_revert_props_restore(svn_stringbuf_t **log_accum,
> + const char *path,
> + svn_wc_adm_access_t *adm_access,
> + apr_pool_t *pool);
> +
> +/* Extends LOG_ACCUM to delete PROPS_KIND props installed for PATH. */
> +svn_error_t *
> +svn_wc__loggy_props_delete(svn_stringbuf_t **log_accum,
> + const char *path,
> + svn_wc__props_kind_t props_kind,
> + svn_wc_adm_access_t *adm_access,
> + apr_pool_t *pool);
> +
> +/* Delete PROPS_KIND props for PATH */
> +svn_error_t *
> +svn_wc__props_delete(const char *path,
> + svn_wc__props_kind_t props_kind,
> + svn_wc_adm_access_t *adm_access,
> + apr_pool_t *pool);
> +
> +
> /* Install PATHs working props as base props, clearing the
> has_prop_mods cache value in the entries file.
>
> @@ -156,6 +173,15 @@
> svn_boolean_t sync_entries,
> apr_pool_t *pool);
>
> +/* Return in *MOD_TIME the time at which PROPS_KIND props of PATH
> + were last modified, or 0 (zero) if unknown. */
> +svn_error_t *
> +svn_wc__props_last_modified(apr_time_t *mod_time,
> + const char *path,
> + svn_wc__props_kind_t props_kind,
> + svn_wc_adm_access_t *adm_access,
> + apr_pool_t *pool);
> +
> /* Check PATH for prop mods, returning the result in *PROP_MODS.
>
> This function takes into account that some working copy versions
> @@ -167,12 +193,14 @@
> apr_pool_t *pool);
>
>
> -/* Load the base and working props for PATH in ADM_ACCESS returning them
> - in *BASE_PROPS_P and *PROPS_P, respectively. BASE_PROPS or PROPS may be null.
> +/* Load the base, working and revert props for PATH in ADM_ACCESS returning
> + them in *BASE_PROPS_P, *PROPS_P and *REVERT_PROPS_P respectively.
> + Any of BASE_PROPS, PROPS and REVERT_PROPS may be null.
> Do all allocations in POOL. */
> svn_error_t *
> svn_wc__load_props(apr_hash_t **base_props_p,
> apr_hash_t **props_p,
> + apr_hash_t **revert_props_p,
> svn_wc_adm_access_t *adm_access,
> const char *path,
> apr_pool_t *pool);
> @@ -182,3 +210,4 @@
> #endif /* __cplusplus */
>
> #endif /* SVN_LIBSVN_WC_PROPS_H */
> +
>
> Modified: trunk/subversion/libsvn_wc/questions.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/questions.c?pathrev=26476&r1=26475&r2=26476
> ==============================================================================
> --- trunk/subversion/libsvn_wc/questions.c (original)
> +++ trunk/subversion/libsvn_wc/questions.c Wed Sep 5 15:52:02 2007
> @@ -36,6 +36,7 @@
> #include "adm_files.h"
> #include "questions.h"
> #include "entries.h"
> +#include "props.h"
> #include "translate.h"
>
> #include "svn_md5.h"
> @@ -190,10 +191,9 @@
>
> else if (timestamp_kind == svn_wc__prop_time)
> {
> - const char *prop_path;
> -
> - SVN_ERR(svn_wc__prop_path(&prop_path, path, entry->kind, FALSE, pool));
> - SVN_ERR(svn_io_file_affected_time(&wfile_time, prop_path, pool));
> + SVN_ERR(svn_wc__props_last_modified(&wfile_time,
> + path, svn_wc__props_working,
> + adm_access, pool));
> entrytime = entry->prop_time;
> }
>
>
> Modified: trunk/subversion/libsvn_wc/relocate.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/relocate.c?pathrev=26476&r1=26475&r2=26476
> ==============================================================================
> --- trunk/subversion/libsvn_wc/relocate.c (original)
> +++ trunk/subversion/libsvn_wc/relocate.c Wed Sep 5 15:52:02 2007
> @@ -181,7 +181,7 @@
>
> svn_pool_destroy(subpool);
>
> - SVN_ERR(svn_wc__remove_wcprops(adm_access, NULL, FALSE, pool));
> + SVN_ERR(svn_wc__props_delete(path, svn_wc__props_wcprop, adm_access, pool));
> SVN_ERR(svn_wc__entries_write(entries, adm_access, pool));
> return SVN_NO_ERROR;
> }
>
> Modified: trunk/subversion/libsvn_wc/update_editor.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/update_editor.c?pathrev=26476&r1=26475&r2=26476
> ==============================================================================
> --- trunk/subversion/libsvn_wc/update_editor.c (original)
> +++ trunk/subversion/libsvn_wc/update_editor.c Wed Sep 5 15:52:02 2007
> @@ -3364,53 +3364,16 @@
> SVN_ERR(svn_wc_entry(&dst_entry, dst_path, adm_access, FALSE, pool));
> if (dst_entry && dst_entry->schedule == svn_wc_schedule_delete)
> {
> - const char *full_path = svn_wc_adm_access_path(adm_access);
> const char *dst_rtext = svn_wc__text_revert_path(dst_path, FALSE,
> pool);
> const char *dst_txtb = svn_wc__text_base_path(dst_path, FALSE, pool);
> - const char *dst_rprop;
> - const char *dst_bprop;
> - svn_node_kind_t kind;
> -
> - SVN_ERR(svn_wc__prop_revert_path(&dst_rprop, dst_path,
> - svn_node_file, FALSE, pool));
> -
> - SVN_ERR(svn_wc__prop_base_path(&dst_bprop, dst_path,
> - svn_node_file, FALSE, pool));
>
> SVN_ERR(svn_wc__loggy_move(&log_accum, NULL,
> adm_access, dst_txtb, dst_rtext,
> FALSE, pool));
> -
> - /* If prop base exist, copy it to revert base. */
> - SVN_ERR(svn_io_check_path(dst_bprop, &kind, pool));
> - if (kind == svn_node_file)
> - SVN_ERR(svn_wc__loggy_move(&log_accum, NULL,
> - adm_access, dst_bprop, dst_rprop,
> - FALSE, pool));
> - else if (kind == svn_node_none)
> - {
> - /* 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 manufacture an empty propfile and force it to be written out. */
> -
> - apr_hash_t *empty_hash = apr_hash_make(pool);
> - const char *propfile_path;
> -
> - SVN_ERR(svn_wc_create_tmp_file2(NULL,
> - &propfile_path,
> - full_path,
> - svn_io_file_del_none,
> - pool));
> -
> - SVN_ERR(svn_wc__save_prop_file(propfile_path,
> - empty_hash, TRUE, pool));
> -
> - SVN_ERR(svn_wc__loggy_move(&log_accum, NULL,
> - adm_access, propfile_path, dst_rprop,
> - FALSE, pool));
> - }
> + SVN_ERR(svn_wc__loggy_revert_props_create(&log_accum,
> + dst_path, adm_access,
> + TRUE, pool));
> }
>
> /* Schedule this for addition first, before the entry exists.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Sep 6 08:55:05 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.