You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2013/10/22 06:02:23 UTC
svn commit: r1534485 - in /subversion/branches/1.8.x: ./ STATUS
subversion/libsvn_fs_fs/fs_fs.c
Author: svn-role
Date: Tue Oct 22 04:02:23 2013
New Revision: 1534485
URL: http://svn.apache.org/r1534485
Log:
Merge r1534158 from trunk:
* r1534158
Correct error message when FSFS detects unsupported future formats.
Justification:
The admin should see a "format number error" instead of "unknown
format option error" for format bumps that also add new options.
Votes:
+1: stefan2, breser, rhuijben
Modified:
subversion/branches/1.8.x/ (props changed)
subversion/branches/1.8.x/STATUS
subversion/branches/1.8.x/subversion/libsvn_fs_fs/fs_fs.c
Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1534158
Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1534485&r1=1534484&r2=1534485&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Tue Oct 22 04:02:23 2013
@@ -117,11 +117,3 @@ Veto-blocked changes:
Approved changes:
=================
-
- * r1534158
- Correct error message when FSFS detects unsupported future formats.
- Justification:
- The admin should see a "format number error" instead of "unknown
- format option error" for format bumps that also add new options.
- Votes:
- +1: stefan2, breser, rhuijben
Modified: subversion/branches/1.8.x/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_fs_fs/fs_fs.c?rev=1534485&r1=1534484&r2=1534485&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_fs_fs/fs_fs.c Tue Oct 22 04:02:23 2013
@@ -982,6 +982,31 @@ check_format_file_buffer_numeric(const c
return check_file_buffer_numeric(buf, offset, path, "Format", pool);
}
+/* Return the error SVN_ERR_FS_UNSUPPORTED_FORMAT if FS's format
+ number is not the same as a format number supported by this
+ Subversion. */
+static svn_error_t *
+check_format(int format)
+{
+ /* Blacklist. These formats may be either younger or older than
+ SVN_FS_FS__FORMAT_NUMBER, but we don't support them. */
+ if (format == SVN_FS_FS__PACKED_REVPROP_SQLITE_DEV_FORMAT)
+ return svn_error_createf(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL,
+ _("Found format '%d', only created by "
+ "unreleased dev builds; see "
+ "http://subversion.apache.org"
+ "/docs/release-notes/1.7#revprop-packing"),
+ format);
+
+ /* We support all formats from 1-current simultaneously */
+ if (1 <= format && format <= SVN_FS_FS__FORMAT_NUMBER)
+ return SVN_NO_ERROR;
+
+ return svn_error_createf(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL,
+ _("Expected FS format between '1' and '%d'; found format '%d'"),
+ SVN_FS_FS__FORMAT_NUMBER, format);
+}
+
/* Read the format number and maximum number of files per directory
from PATH and return them in *PFORMAT and *MAX_FILES_PER_DIR
respectively.
@@ -1032,6 +1057,9 @@ read_format(int *pformat, int *max_files
SVN_ERR(check_format_file_buffer_numeric(buf->data, 0, path, pool));
SVN_ERR(svn_cstring_atoi(pformat, buf->data));
+ /* Check that we support this format at all */
+ SVN_ERR(check_format(*pformat));
+
/* Set the default values for anything that can be set via an option. */
*max_files_per_dir = 0;
@@ -1117,31 +1145,6 @@ write_format(const char *path, int forma
return svn_io_set_file_read_only(path, FALSE, pool);
}
-/* Return the error SVN_ERR_FS_UNSUPPORTED_FORMAT if FS's format
- number is not the same as a format number supported by this
- Subversion. */
-static svn_error_t *
-check_format(int format)
-{
- /* Blacklist. These formats may be either younger or older than
- SVN_FS_FS__FORMAT_NUMBER, but we don't support them. */
- if (format == SVN_FS_FS__PACKED_REVPROP_SQLITE_DEV_FORMAT)
- return svn_error_createf(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL,
- _("Found format '%d', only created by "
- "unreleased dev builds; see "
- "http://subversion.apache.org"
- "/docs/release-notes/1.7#revprop-packing"),
- format);
-
- /* We support all formats from 1-current simultaneously */
- if (1 <= format && format <= SVN_FS_FS__FORMAT_NUMBER)
- return SVN_NO_ERROR;
-
- return svn_error_createf(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL,
- _("Expected FS format between '1' and '%d'; found format '%d'"),
- SVN_FS_FS__FORMAT_NUMBER, format);
-}
-
svn_boolean_t
svn_fs_fs__fs_supports_mergeinfo(svn_fs_t *fs)
{
@@ -1404,7 +1407,6 @@ svn_fs_fs__open(svn_fs_t *fs, const char
/* Read the FS format number. */
SVN_ERR(read_format(&format, &max_files_per_dir,
path_format(fs, pool), pool));
- SVN_ERR(check_format(format));
/* Now we've got a format number no matter what. */
ffd->format = format;
@@ -1564,7 +1566,6 @@ upgrade_body(void *baton, apr_pool_t *po
/* Read the FS format number and max-files-per-dir setting. */
SVN_ERR(read_format(&format, &max_files_per_dir, format_path, pool));
- SVN_ERR(check_format(format));
/* If the config file does not exist, create one. */
SVN_ERR(svn_io_check_path(svn_dirent_join(fs->path, PATH_CONFIG, pool),