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

Re: svn commit: r29127 - in trunk/subversion: bindings/swig include libsvn_subr libsvn_wc svn tests/cmdline

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: Fri, 01 Feb 2008 09:06:33 -0600

kfogel_at_tigris.org wrote:
> Author: kfogel
> Date: Thu Jan 31 20:15:40 2008
> New Revision: 29127
>
> Log:
> Fix issue #3026: _svn and .svn are silently ignored as file arguments.
>
> Patch by: Augie Fackler: <durin42_at_gmail.com>
> (Test by me.)
>
> First, create some new infrastructure:
>
> * subversion/include/svn_error_codes.h
> (SVN_ERR_RESERVED_FILENAME_SPECIFIED): New error code for when reserved file
> arguments are encountered.
>
> * subversion/libsvn_wc/adm_files.c:
> (svn_wc_set_adm_dir): Updated comment to reflect the change of location for
> the other code block.
>
> * subversion/include/svn_opt.h:
> (svn_opt_args_to_target_array3): New function prototype.
>
> * subversion/libsvn_subr/opt.c:
> (svn_opt_args_to_target_array3): New function. Behaves like
> svn_opt_args_to_target_array2 except this one returns errors instead of
> silently ignoring reserved file names.
>
> (svn_opt_args_to_target_array2): Reimplemented to wrap
> svn_opt_args_to_target_array2 but filter out any error about reserved
> filenames.
>
> * subversion/svn/cl.h:
> (svn_cl__args_to_target_array_print_reserved): New function prototype.
>
> * subversion/svn/util.c:
> (svn_cl_args_to_target_array_print_reserved): New function. Convenience
> function to wrap svn_opt_args_to_target_array_3 and print any errors about
> reserved filenames to stderr before returning.
>
> * subversion/bindings/swig/core.i:
> (svn_opt_args_to_target_array3): Ignore this function as well.
>
> Then update all the relevant callers:
>
> * subversion/svn/update-cmd.c:
> (svn_cl__propdel): Use svn_opt_args_to_target_array3 instead of
> svn_opt_args_to_target_array2 so that reserved filenames exit with error.
>
> * subversion/svn/merge-cmd.c:
> (svn_cl__merge): Use svn_cl__args_to_target_array_print_reserved instead of
> svn_opt_args_to_target_array2 so that reserved filenames aren't silently
> ignored.
>
> * subversion/svn/propdel-cmd.c:
> (svn_cl__propdel): Same.
>
> * subversion/svn/checkout-cmd.c:
> (svn_cl__checkout): Same.
>
> * subversion/svn/move-cmd.c:
> (svn_cl__move): Same.
>
> * subversion/svn/mkdir-cmd.c:
> (svn_cl__mkdir): Same.
>
> * subversion/svn/cat-cmd.c:
> (svn_cl__cat): Same.
>
> * subversion/svn/revert-cmd.c:
> (svn_cl__revert): Same.
>
> * subversion/svn/diff-cmd.c:
> (svn_cl__diff): Same.
>
> * subversion/svn/copy-cmd.c:
> (svn_cl__copy): Same.
>
> * subversion/svn/mergeinfo-cmd.c:
> (svn_cl__mergeinfo): Same.
>
> * subversion/svn/list-cmd.c:
> (svn_cl__list): Same.
>
> * subversion/svn/blame-cmd.c:
> (svn_cl__blame): Same.
>
> * subversion/svn/propget-cmd.c:
> (svn_cl__propget): Same.
>
> * subversion/svn/changelist-cmd.c:
> (svn_cl__changelist): Same.
>
> * subversion/svn/propdel-cmd.c:
> (svn_cl__propdel): Same.
>
> * subversion/svn/log-cmd.c:
> (svn_cl__log): Same.
>
> * subversion/svn/resolved-cmd.c:
> (svn_cl__resloved): Same.
>
> * subversion/svn/cleanup-cmd.c:
> (svn_cl__cleanup): Same.
>
> * subversion/svn/commit-cmd.c:
> (svn_cl__commit): Same.
>
> * subversion/svn/add-cmd.c:
> (svn_cl__add): Same.
>
> * subversion/svn/propset-cmd.c:
> (svn_cl__propset): Same.
>
> * subversion/svn/switch-cmd.c:
> (svn_cl__switch): Same.
>
> * subversion/svn/delete-cmd.c:
> (svn_cl__delete): Same.
>
> * subversion/svn/import-cmd.c:
> (svn_cl__import): Same.
>
> * subversion/svn/proplist-cmd.c:
> (svn_cl__proplist): Same.
>
> * subversion/svn/export-cmd.c:
> (svn_cl__export): Same.
>
> * subversion/svn/propdel-cmd.c:
> (svn_cl__propdel): Same.
>
> * subversion/svn/status-cmd.c:
> (svn_cl__status): Same.
>
> * subversion/svn/propedit-cmd.c:
> (svn_cl__propdel): Same.
>
> * subversion/svn/lock-cmd.c:
> (svn_cl__lock): Same.
>
> * subversion/svn/info-cmd.c:
> (svn_cl__info): Same.
>
> * subversion/svn/unlock-cmd.c:
> (svn_cl__unlock): Same.
>
> Finally, add a test:
>
> * subversion/tests/cmdline/special_tests.py
> (warn_on_reserved_name): New test.
> (test_list): Run it.
...
> Modified: trunk/subversion/include/svn_opt.h
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_opt.h?pathrev=29127&r1=29126&r2=29127
> ==============================================================================
> --- trunk/subversion/include/svn_opt.h (original)
> +++ trunk/subversion/include/svn_opt.h Thu Jan 31 20:15:40 2008
> @@ -490,6 +490,18 @@
> apr_array_header_t *known_targets,
> apr_pool_t *pool);
>
> +/**
> + * This is the same as svn_opt_args_to_target_array2() except that it returns
> + * errors when a path has the same name as a working copy directory.
> + *
> + * @since New in 1.5.

Are you planning on merging this to 1.5.x? If not, we should probably
fix the doc string.

> + */
> +svn_error_t *
> +svn_opt_args_to_target_array3(apr_array_header_t **targets_p,
> + apr_getopt_t *os,
> + apr_array_header_t *known_targets,
> + apr_pool_t *pool);
> +
>
> /**
> * The same as svn_opt_args_to_target_array2() except that, in
>

Received on 2008-02-01 16:06:51 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.