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

Re: svn commit: r23370 - in trunk/subversion: include libsvn_client libsvn_fs_base libsvn_fs_fs libsvn_repos libsvn_subr libsvn_wc tests tests/cmdline tests/cmdline/svntest

From: Malcolm Rowe <malcolm-svn-dev_at_farside.org.uk>
Date: 2007-02-08 11:17:23 CET

On Thu, Feb 08, 2007 at 01:13:40AM -0800, lundblad@tigris.org wrote:
> Make 'svn cleanup' not fail on a missing .svn/tmp directory. It is
> removed and rebuilt anyway so failing if it does not exist is
> counterproductive.
>
> Patch by: Henner Zeller <h.zeller@acm.org>
>
> * subversion/include/svn_io.h
> (svn_io_remove_dir2): New function. Add ignore_enoent flag.
> (svn_io_remove_dir): Deprecate. All callers updated to use
> svn_io_remove_dir2.
>
> * subversion/libsvn_subr/io.c
> (svn_io_remove_dir2): Copy from svn_io_remove_dir, adding ignore_enoent
> parameter.
> (svn_io_remove_dir): Wrap svn_io_remove_dir2.
>
> [...]
>
> Modified:
> trunk/subversion/include/svn_io.h
> trunk/subversion/libsvn_client/add.c
> trunk/subversion/libsvn_fs_base/fs.c
> trunk/subversion/libsvn_fs_fs/fs.c
> trunk/subversion/libsvn_fs_fs/fs_fs.c
> trunk/subversion/libsvn_repos/repos.c
> trunk/subversion/libsvn_subr/io.c
> trunk/subversion/libsvn_wc/adm_files.c
> trunk/subversion/libsvn_wc/adm_ops.c
> trunk/subversion/libsvn_wc/lock.c
> trunk/subversion/tests/cmdline/basic_tests.py
> trunk/subversion/tests/cmdline/svntest/actions.py
> trunk/subversion/tests/svn_test_main.c

The log message seems to be missing most of the changes to libsvn_*/.
While most of them are just 'update callers', I would have thought you'd
mention the change in libsvn_wc/adm_files.c where the key part of this
change was made.

More importantly, though, I'm not sure that the API change to
svn_io_remove_dir() is appropriate. Is there any reason that the single
caller who wishes to ignore ENOENT can't simply ignore that error?

In other words, can we avoid the addition of what (to me) appears to be
a very specific feature in the API and just do something like this
(untested, and we should probably also document svn_io_remove_dir()'s
return in its doc-comments).

[[[
* subversion/libsvn_wc/adm_files.c
  (svn_wc__adm_cleanup_tmp_area): Don't raise an error if the directory
    is already missing.
]]]

Index: subversion/libsvn_wc/adm_files.c
===================================================================
--- subversion/libsvn_wc/adm_files.c (revision 23341)
+++ subversion/libsvn_wc/adm_files.c (working copy)
@@ -1216,13 +1216,18 @@ svn_wc__adm_cleanup_tmp_area(svn_wc_adm_
                              apr_pool_t *pool)
 {
   const char *tmp_path;
+ svn_error_t *err;
 
   SVN_ERR(svn_wc__adm_write_check(adm_access));
 
   /* Get the path to the tmp area, and blow it away. */
   tmp_path = extend_with_adm_name(svn_wc_adm_access_path(adm_access),
                                   NULL, 0, pool, SVN_WC__ADM_TMP, NULL);
- SVN_ERR(svn_io_remove_dir(tmp_path, pool));
+ err = svn_io_remove_dir(tmp_path, pool);
+ if (err && APR_STATUS_IS_ENOENT(err->apr_err))
+ svn_error_clear(err);
+ else
+ SVN_ERR(err);
 
   /* Now, rebuild the tmp area. */
   SVN_ERR(init_adm_tmp_area(adm_access, pool));

Regards,
Malcolm

  • application/pgp-signature attachment: stored
Received on Thu Feb 8 11:39:38 2007

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