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

Re: [PATCH] possible fix for #714, finally ;-)

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-09-22 17:28:19 CEST

Benjamin Pflugmann <benjamin-svn-dev@pflugmann.de> writes:

> 2002-09-21 Benjamin Pflugmann <benjamin-svn-cvs@pflugmann.de>
>
> * libsvn_wc/adm_ops.c:
> (revert_admin_things): Fix for issue #714: svn revert on deleted
> directories fails silently. Now it still fails, but returns an
> error and suggests the needed svn update command line. Also fixed
> a small doc typo.
>
>
> Index: subversion/libsvn_wc/adm_ops.c
> ===================================================================
> --- subversion/libsvn_wc/adm_ops.c
> +++ subversion/libsvn_wc/adm_ops.c 2002-09-21 22:07:43.000000000 +0200
> @@ -998,6 +998,20 @@
> if (name && (strcmp (name, SVN_WC_ENTRY_THIS_DIR) != 0))
> fullpath = svn_path_join (fullpath, name, pool);
>
> + if (entry->kind == svn_node_dir)
> + {
> + SVN_ERR (svn_io_check_path (fullpath, &kind, pool));
> + if (kind != svn_node_dir)
> + {
> + /* When the directory itself is missing in the WC, the WC
> + cannot be reverted, because the base files were part of
> + the missing directory. */
> + err = svn_error_createf (SVN_ERR_UNSUPPORTED_FEATURE, 0, NULL, pool,

I don't think this is the correct error. I think UNSUPPORTED_FEATURE
is for things we would like to do, but but which have not yet been
implemented. In this case the behaviour is something we think is
correct. Perhaps SVN_ERR_WC_NOT_DIRECTORY would be better? Or
perhaps a new error?

> + "try instead: svn update '%s'", fullpath);
> + return revert_error (err, fullpath, "using subcommand", pool);

The libsvn_wc library cannot refer to the command line client. The
library should simply report something like "directory missing '%s'".
The command line client itself can regonise the particular error and
it can add the "try update" message if required.

> + }
> + }
> +
> /* Check for prop changes. */
> SVN_ERR (svn_wc_props_modified_p (&modified_p, fullpath, pool));
> if (modified_p)
> @@ -1012,7 +1026,7 @@
> file with no props. */
> SVN_ERR (svn_io_check_path (thing, &working_props_kind, pool));
>
> - /* If there is a pristing property file, copy it out as the
> + /* If there is a pristine property file, copy it out as the
> working property file, else just remove the working property
> file. */
> SVN_ERR (svn_io_check_path (base_thing, &kind, pool));

You also asked about regression tests. Take a look at basic_revert in
basic_tests.py and and update_missing in update_tests.py. Yes, it's
Python, but it's not that hard (speaking as a non-Python programmer!).

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Sep 22 17:28:54 2002

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.