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

Re: [PATCH] fix for issue #2867: svn cleanup dies on obstructed subdirs

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Sun, 20 Jan 2008 22:22:25 -0500

"Miller, Eric" <Eric.Miller_at_amd.com> writes:
> [[[
> Fix issue #2867: svn cleanup dies on obstructed subdirs
>
> * subversion/libsvn_wc/log.c
> (svn_wc_cleanup2): Display a warning for obstructed subdirs and clear
> the error
> ]]]
>
> I'm sure there is a better way to handle the info message (no message?)
> but I left it in anyways.
>
> Could someone review this?

Sure...

> Index: subversion/libsvn_wc/log.c
> ===================================================================
> --- subversion/libsvn_wc/log.c (revision 28235)
> +++ subversion/libsvn_wc/log.c (working copy)
> @@ -2475,6 +2475,7 @@
> int wc_format_version;
> apr_pool_t *subpool;
> svn_boolean_t killme, kill_adm_only;
> + svn_error_t *err;
>
> /* Check cancellation; note that this catches recursive calls too. */
> if (cancel_func)
> @@ -2513,8 +2514,24 @@
> /* Sub-directories */
> SVN_ERR(svn_io_check_path(entry_path, &kind, subpool));
> if (kind == svn_node_dir)
> - SVN_ERR(svn_wc_cleanup2(entry_path, diff3_cmd,
> - cancel_func, cancel_baton, subpool));
> + {
> + err = svn_wc_cleanup2(entry_path, diff3_cmd,
> + cancel_func, cancel_baton, subpool);
> +
> + /* Make an exception for obstructed subdirs */
> + if(err)
> + {
> + if(err->apr_err == SVN_ERR_WC_NOT_DIRECTORY)
> + {
> + printf("Ignoring obstruction on %s\n", entry_path);
> + svn_error_clear(err);
> + }
> + else
> + {
> + SVN_ERR(err);
> + }
> + }
> + }
> }
> else
> {

One rule is that we can't printf() from within a library. We can only
return errors (we can chain errors together, delay their return till
after the work is done, whatever, but simply printing is a no-no in a
library).

The other thing that worries me is, are you sure that this is the only
circumstance in which SVN_ERR_WC_NOT_DIRECTORY can be returned?

Third: a reproduction case would greatly help. (If there was a thread
preceding your message, my apologies, I don't have it at hand.)

Best,
-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-01-21 04:22:35 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.