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

Re: svn commit: r1075942 - in /subversion/trunk: notes/wc-ng/pristine-store subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_pristine.c subversion/tests/libsvn_wc/pristine-store-test.c

From: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Tue, 1 Mar 2011 22:07:58 +0300

On Tue, Mar 1, 2011 at 20:47, <julianfoad_at_apache.org> wrote:
> Author: julianfoad
> Date: Tue Mar  1 17:47:04 2011
> New Revision: 1075942
>
> URL: http://svn.apache.org/viewvc?rev=1075942&view=rev
> Log:
> Make the pristine text store guarantee that a pristine text stream being
> read will remain readable even if the text is deleted from the store.  To
> ensure that a recently deleted pristine file can be reinstated, on Windows
> we rename it to a new unique name before deleting it.  This is probably not
> the most efficient way to work on Windows.
>
[...]

> + * On Windows, the file will not disappear immediately from the directory if
> + * it is still being read so the best thing to do is first rename it to a
> + * unique name. */
> +static svn_error_t *
> +remove_file(const char *file_abspath,
> +            svn_wc__db_wcroot_t *wcroot,
> +            svn_boolean_t ignore_enoent,
> +            apr_pool_t *scratch_pool)
> +{
> +#if 1 /*def WIN32*/
I think it should be "#ifdef WIN32". Isn't it?

> +  svn_error_t *err;
> +  const char *temp_abspath;
> +  const char *temp_dir_abspath
> +    = pristine_get_tempdir(wcroot, scratch_pool, scratch_pool);
> +
> +  /* To rename the file to a unique name in the temp dir, first create a
> +   * uniquely named file in the temp dir and then overwrite it. */
> +  SVN_ERR(svn_io_open_unique_file3(NULL, &temp_abspath, temp_dir_abspath,
> +                                   svn_io_file_del_none,
> +                                   scratch_pool, scratch_pool));
> +  err = svn_io_file_rename(file_abspath, temp_abspath, scratch_pool);
> +  if (err && ignore_enoent && APR_STATUS_IS_ENOENT(err->apr_err))
> +    svn_error_clear(err);
> +  else
> +    SVN_ERR(err);
> +  file_abspath = temp_abspath;
> +#endif
> +
> +  SVN_ERR(svn_io_remove_file2(file_abspath, ignore_enoent, scratch_pool));
> +
> +  return SVN_NO_ERROR;
> +}
> +
[...]

-- 
Ivan Zhakov
VisualSVN Team
Received on 2011-03-01 20:08:55 CET

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.