Today I got an error trying to commit to a local FSFS repository which had a
format number of 3 but not transaction-current file. Glancing through
libsvn_fs_fs/, I noticed that svn_fs_fs__create() will make the
transaction-current file for new repositories, but svn_fs_fs__open() will
not make it for existing repositories, even if the repository format number
is at a suitable level.
The patch below fixed this for me, but I'm not sure if it fits into the
overall big picture design of this new transaction-current file thing.
Log:
* subversion/libsvn_fs_fs/fs_fs.c
(svn_fs_fs__open): Create the transaction-current file in existing
repositories that are of suitable format number but lack the
file.
Index: subversion/libsvn_fs_fs/fs_fs.c
===================================================================
--- subversion/libsvn_fs_fs/fs_fs.c (revision 26462)
+++ subversion/libsvn_fs_fs/fs_fs.c (working copy)
@@ -824,6 +824,23 @@
ffd->max_files_per_dir = max_files_per_dir;
SVN_ERR(check_format(format));
+ /* Soft upgrade: create the transaction-current file if the
+ repository supports the transaction sequence file but is
+ currently lacking such a file. */
+ if (format >= SVN_FS_FS__MIN_TXN_CURRENT_FORMAT)
+ {
+ svn_error_t *err;
+ err = svn_io_file_create(svn_path_join(path, PATH_TXN_CURRENT, pool),
+ "0\n", pool);
+ if (err)
+ {
+ if (APR_STATUS_IS_EEXIST(err->apr_err))
+ svn_error_clear(err);
+ else
+ return err;
+ }
+ }
+
/* Read in and cache the repository uuid. */
SVN_ERR(svn_io_file_open(&uuid_file, path_uuid(fs, pool),
APR_READ | APR_BUFFERED, APR_OS_DEFAULT, pool));
https://par.extranet.collab.net/
--
C. Michael Pilato <cmpilato@collab.net>
CollabNet <> www.collab.net <> Distributed Development On Demand
Received on Wed Sep 5 18:56:51 2007