diff options
Diffstat (limited to 'subversion/libsvn_fs_fs')
-rw-r--r-- | subversion/libsvn_fs_fs/fs_fs.c | 10 | ||||
-rw-r--r-- | subversion/libsvn_fs_fs/rep-cache-db.h | 2 | ||||
-rw-r--r-- | subversion/libsvn_fs_fs/rep-cache.c | 27 |
3 files changed, 33 insertions, 6 deletions
diff --git a/subversion/libsvn_fs_fs/fs_fs.c b/subversion/libsvn_fs_fs/fs_fs.c index 101e417eb28f..372455d2d735 100644 --- a/subversion/libsvn_fs_fs/fs_fs.c +++ b/subversion/libsvn_fs_fs/fs_fs.c @@ -5380,11 +5380,13 @@ svn_fs_fs__get_file_delta_stream(svn_txdelta_stream_t **stream_p, /* Read target's base rep if any. */ SVN_ERR(create_rep_state(&rep_state, &rep_args, NULL, NULL, target->data_rep, fs, pool)); - /* If that matches source, then use this delta as is. */ + + /* If that matches source, then use this delta as is. + Note that we want an actual delta here. E.g. a self-delta would + not be good enough. */ if (rep_args->is_delta - && (rep_args->is_delta_vs_empty - || (rep_args->base_revision == source->data_rep->revision - && rep_args->base_offset == source->data_rep->offset))) + && rep_args->base_revision == source->data_rep->revision + && rep_args->base_offset == source->data_rep->offset) { /* Create the delta read baton. */ struct delta_read_baton *drb = apr_pcalloc(pool, sizeof(*drb)); diff --git a/subversion/libsvn_fs_fs/rep-cache-db.h b/subversion/libsvn_fs_fs/rep-cache-db.h index f74138f8032b..b02b052c5624 100644 --- a/subversion/libsvn_fs_fs/rep-cache-db.h +++ b/subversion/libsvn_fs_fs/rep-cache-db.h @@ -1,4 +1,4 @@ -/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.8.5/subversion/libsvn_fs_fs/token-map.h. +/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.8.8/subversion/libsvn_fs_fs/token-map.h. * Do not edit this file -- edit the source and rerun gen-make.py */ #define STMT_CREATE_SCHEMA 0 diff --git a/subversion/libsvn_fs_fs/rep-cache.c b/subversion/libsvn_fs_fs/rep-cache.c index 3a9469036187..008226688f27 100644 --- a/subversion/libsvn_fs_fs/rep-cache.c +++ b/subversion/libsvn_fs_fs/rep-cache.c @@ -81,8 +81,33 @@ open_rep_cache(void *baton, int version; /* Open (or create) the sqlite database. It will be automatically - closed when fs->pool is destoyed. */ + closed when fs->pool is destoyed. */ db_path = path_rep_cache_db(fs->path, pool); +#ifndef WIN32 + { + /* We want to extend the permissions that apply to the repository + as a whole when creating a new rep cache and not simply default + to umask. */ + svn_boolean_t exists; + + SVN_ERR(svn_fs_fs__exists_rep_cache(&exists, fs, pool)); + if (!exists) + { + const char *current = svn_fs_fs__path_current(fs, pool); + svn_error_t *err = svn_io_file_create(db_path, "", pool); + + if (err && !APR_STATUS_IS_EEXIST(err->apr_err)) + /* A real error. */ + return svn_error_trace(err); + else if (err) + /* Some other thread/process created the file. */ + svn_error_clear(err); + else + /* We created the file. */ + SVN_ERR(svn_io_copy_perms(current, db_path, pool)); + } + } +#endif SVN_ERR(svn_sqlite__open(&sdb, db_path, svn_sqlite__mode_rwcreate, statements, 0, NULL, |