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

Re: [PATCH] default to expecting new FS backends to support \n in filenames

From: Stefan Fuhrmann <stefan.fuhrmann_at_wandisco.com>
Date: Mon, 1 Jul 2013 13:39:03 +0200

On Mon, Jul 1, 2013 at 1:33 PM, Daniel Shahaf <danielsh_at_elego.de> wrote:

> I don't remember whether I pointed this out when Stefan originally wrote
> that code:
>
> [[[
> * subversion/tests/libsvn_fs/fs-test.c
> (filename_trailing_newline): Switch from a blacklist approach to
> to a whitelist approach, for defining backends that don't implement
> the API correctly.
> ]]]
>
> Index: subversion/tests/libsvn_fs/fs-test.c
> ===================================================================
> --- subversion/tests/libsvn_fs/fs-test.c (revision 1498385)
> +++ subversion/tests/libsvn_fs/fs-test.c (working copy)
> @@ -4959,10 +4959,11 @@ filename_trailing_newline(const svn_test_opts_t *o
> svn_error_t *err;
> svn_boolean_t allow_newlines;
>
> - /* Some filesystem implementations can handle newlines in filenames
> - * and can be white-listed here.
> - * Currently, only BDB supports \n in filenames. */
> - allow_newlines = (strcmp(opts->fs_type, "bdb") == 0);
> + /* The FS API wants \n to be permitted, but FSFS never implemented that,
> + * so for FSFS we expect errors rather than successes in some of the
> commits.
> + * Use a blacklist approach so that new FSes default to implementing
> the API
> + * as originally defined. */
> + allow_newlines = (!!strcmp(opts->fs_type, SVN_FS_TYPE_FSFS));
>
> SVN_ERR(svn_test__create_fs(&fs, "test-repo-filename-trailing-newline",
> opts, pool));
>

Looks good.

> For clarity, I'd be fine with adding FSX to the blacklist here.
>

FSX is supposed to eventually handle arbitrary filenames -
it's on the TODO list. So, don't blacklist it and simply let
the tests fail as a friendly reminder to the coder ...

-- Stefan^2
Received on 2013-07-01 13:39:35 CEST

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