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

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

From: Daniel Shahaf <danielsh_at_elego.de>
Date: Mon, 1 Jul 2013 14:33:06 +0300

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));

For clarity, I'd be fine with adding FSX to the blacklist here.
Received on 2013-07-01 13:33:58 CEST

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