in subversion/libsvn_repos/delta.c [84:196]
static svn_revnum_t get_path_revision(svn_fs_root_t *root,
const char *path,
apr_pool_t *pool);
/* proplist_change_fn_t property changing functions. */
static svn_error_t *change_dir_prop(struct context *c,
void *object,
const char *path,
const svn_string_t *value,
apr_pool_t *pool);
static svn_error_t *change_file_prop(struct context *c,
void *object,
const char *path,
const svn_string_t *value,
apr_pool_t *pool);
/* Constructing deltas for properties of files and directories. */
static svn_error_t *delta_proplists(struct context *c,
const char *source_path,
const char *target_path,
proplist_change_fn_t *change_fn,
void *object,
apr_pool_t *pool);
/* Constructing deltas for file constents. */
static svn_error_t *send_text_delta(struct context *c,
void *file_baton,
const char *base_checksum,
svn_txdelta_stream_t *delta_stream,
apr_pool_t *pool);
static svn_error_t *delta_files(struct context *c,
void *file_baton,
const char *source_path,
const char *target_path,
apr_pool_t *pool);
/* Generic directory deltafication routines. */
static svn_error_t *delete(struct context *c,
void *dir_baton,
const char *edit_path,
apr_pool_t *pool);
static svn_error_t *add_file_or_dir(struct context *c,
void *dir_baton,
svn_depth_t depth,
const char *target_path,
const char *edit_path,
svn_node_kind_t tgt_kind,
apr_pool_t *pool);
static svn_error_t *replace_file_or_dir(struct context *c,
void *dir_baton,
svn_depth_t depth,
const char *source_path,
const char *target_path,
const char *edit_path,
svn_node_kind_t tgt_kind,
apr_pool_t *pool);
static svn_error_t *absent_file_or_dir(struct context *c,
void *dir_baton,
const char *edit_path,
svn_node_kind_t tgt_kind,
apr_pool_t *pool);
static svn_error_t *delta_dirs(struct context *c,
void *dir_baton,
svn_depth_t depth,
const char *source_path,
const char *target_path,
const char *edit_path,
apr_pool_t *pool);
#define MAYBE_DEMOTE_DEPTH(depth) \
(((depth) == svn_depth_immediates || (depth) == svn_depth_files) \
? svn_depth_empty \
: (depth))
/* Return the error 'SVN_ERR_AUTHZ_ROOT_UNREADABLE' if PATH in ROOT is
* unreadable according to AUTHZ_READ_FUNC with AUTHZ_READ_BATON.
*
* PATH should be the implicit root path of an editor drive, that is,
* the path used by editor->open_root().
*/
static svn_error_t *
authz_root_check(svn_fs_root_t *root,
const char *path,
svn_repos_authz_func_t authz_read_func,
void *authz_read_baton,
apr_pool_t *pool)
{
svn_boolean_t allowed;
if (authz_read_func)
{
SVN_ERR(authz_read_func(&allowed, root, path, authz_read_baton, pool));
if (! allowed)
return svn_error_create(SVN_ERR_AUTHZ_ROOT_UNREADABLE, 0,
_("Unable to open root of edit"));
}
return SVN_NO_ERROR;
}