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

Re: svn commit: r16481 - in branches/wc-replacements/subversion: include

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2005-10-07 10:32:57 CEST

> +
> + /* Copy pristine text-base to temporary location. */
> + SVN_ERR (svn_io_copy_file (src_txtb, tmp_txtb, TRUE, pool));
> +
> + /* Load source base props. */
> + base_props = apr_hash_make (pool);
> + SVN_ERR (svn_wc__load_prop_file (src_bprop, base_props, pool));
> +
> + /* Load source working props. */
> + props = apr_hash_make (pool);
> + SVN_ERR (svn_wc__load_prop_file (src_wprop, props, pool));
> +
> + SVN_ERR (svn_wc_add_repos_file2 (dst_path, dst_parent,
> + tmp_txtb, src_path,
> + base_props, props,
> + copyfrom_url, copyfrom_rev, pool));

There's a bug here: svn_wc_add_repos_file2() will take ownership of
'src_path', which probably means it needs to be copied to a temporary
file before it can be passed to ..._add_repos_file2().

> --- branches/wc-replacements/subversion/libsvn_wc/update_editor.c (original)
> +++ branches/wc-replacements/subversion/libsvn_wc/update_editor.c Wed Oct 5 11:39:24 2005
> @@ -2925,13 +2925,15 @@
> }
>
> svn_error_t *
> -svn_wc_add_repos_file (const char *dst_path,
> - svn_wc_adm_access_t *adm_access,
> - const char *new_text_path,
> - apr_hash_t *new_props,
> - const char *copyfrom_url,
> - svn_revnum_t copyfrom_rev,
> - apr_pool_t *pool)
> +svn_wc_add_repos_file2 (const char *dst_path,
> + svn_wc_adm_access_t *adm_access,
> + const char *new_text_base_path,
> + const char *new_text_path,
> + apr_hash_t *new_base_props,
> + apr_hash_t *new_props,
> + const char *copyfrom_url,
> + svn_revnum_t copyfrom_rev,
> + apr_pool_t *pool)
> {
> const char *new_URL;
> apr_array_header_t *propchanges;
> @@ -3002,7 +3004,7 @@
> /* Construct the new properties. Passing an empty hash for the
> source props will result in the right kind of prop array for
> install_file(). Ooh, magic. */
> - SVN_ERR (svn_prop_diffs (&propchanges, new_props,
> + SVN_ERR (svn_prop_diffs (&propchanges, new_base_props,
> apr_hash_make (pool), pool));
>
> SVN_ERR (install_file (log_accum,
> @@ -3012,7 +3014,7 @@
> adm_access,
> dst_path,
> ent->revision,
> - new_text_path,
> + new_text_base_path,
> propchanges,
> TRUE, /* a full proplist */
> new_URL,
> @@ -3023,10 +3025,78 @@
> NULL,
> pool));
>
> + if (new_props)
> + {
> + const char *tmp_prop_path, *prop_path;
> + apr_file_t *file;
> + const char *adm_path = svn_wc_adm_access_path (adm_access);
> + apr_size_t adm_path_len = strlen (adm_path) + 1;
> +
> + /* Save new props to temporary file. Don't use svn_wc__prop_path()
> + because install_file() will overwrite it! */
> + SVN_ERR (svn_wc_create_tmp_file (&file, adm_path, FALSE, pool));
> + apr_file_name_get (&tmp_prop_path, file);
> + SVN_ERR (svn_io_file_close (file, pool));
> + SVN_ERR (svn_wc__save_prop_file (tmp_prop_path, new_props, pool));
> +
> + /* Rename temporary props file to working props. */
> + SVN_ERR (svn_wc__prop_path (&prop_path, base_name, adm_access,
> + FALSE, pool));
> + svn_xml_make_open_tag (&log_accum, pool,
> + svn_xml_self_closing,
> + SVN_WC__LOG_MV,
> + SVN_WC__LOG_ATTR_NAME,
> + tmp_prop_path + adm_path_len,
> + SVN_WC__LOG_ATTR_DEST,
> + prop_path,
> + NULL);
> + }
> +
> + if (new_text_path)
> + {
> + const char *tmp_text_path;
> + apr_file_t *file;
> + const char *adm_path = svn_wc_adm_access_path (adm_access);
> + apr_size_t adm_path_len = strlen (adm_path) + 1;
> +
> + /* Copy new text to temporary file in adm_access. */
> + SVN_ERR (svn_wc_create_tmp_file (&file, adm_path, FALSE, pool));
> + apr_file_name_get (&tmp_text_path, file);
> + SVN_ERR (svn_io_file_close (file, pool));
> + SVN_ERR (svn_io_copy_file (new_text_path, tmp_text_path, FALSE, pool));

Here's a bug w.r.t. symlinks *and* the bug which makes the test suite
copy_tests 11 fail:
- we need to copy-and-translate special files
- we need to copy props too (pass TRUE where svn_io_copy_file is now
passed FALSE)

btw: I can't test this now, because I'm at work and don't have a
working copy available. I'll check this as soon as I get home.

bye,

Erik.

PS: I know I wrote all of the code I'm commenting on. I'm writing the
mail to save anybody reviewing these commits and so that I know where
the problem is when I come home.
Received on Fri Oct 7 10:33:44 2005

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.