FreeBSD/contrib/subversion/subversion/libsvn_repos/replay.c
/* Initialize COPYFROM_ROOT, COPYFROM_PATH, and COPYFROM_REV with the
   revision root, fspath, and revnum of the copyfrom of CHANGE, which
   corresponds to PATH under ROOT.  If the copyfrom info is valid
   (i.e., is not (NULL, SVN_INVALID_REVNUM)), then initialize SRC_READABLE
   too, consulting AUTHZ_READ_FUNC and AUTHZ_READ_BATON if provided.

   NOTE: If the copyfrom information in CHANGE is marked as unknown
   (meaning, its ->copyfrom_rev and ->copyfrom_path cannot be
   trusted), this function will also update those members of the
   CHANGE structure to carry accurate copyfrom information.  */
Initialize COPYFROM_ROOT, COPYFROM_PATH, and COPYFROM_REV with the
revision root, fspath, and revnum of the copyfrom of CHANGE, which
corresponds to PATH under ROOT.  If the copyfrom info is valid
), then initialize SRC_READABLE
too, consulting AUTHZ_READ_FUNC and AUTHZ_READ_BATON if provided.

If the copyfrom information in CHANGE is marked as unknown
(meaning, its ->copyfrom_rev and ->copyfrom_path cannot be
trusted), this function will also update those members of the
CHANGE structure to carry accurate copyfrom information.
Initialize COPYFROM_ROOT COPYFROM_PATH and COPYFROM_REV with the revision root fspath and revnum of the copyfrom of CHANGE which corresponds to PATH under ROOT . If the copyfrom info is valid ) then initialize SRC_READABLE too consulting AUTHZ_READ_FUNC and AUTHZ_READ_BATON if provided . If the copyfrom information in CHANGE is marked as unknown ( meaning its - > copyfrom_rev and - > copyfrom_path cannot be trusted ) this function will also update those members of the CHANGE structure to carry accurate copyfrom information .
static svn_error_t *
fill_copyfrom(svn_fs_root_t **copyfrom_root,
              const char **copyfrom_path,
              svn_revnum_t *copyfrom_rev,
              svn_boolean_t *src_readable,
              svn_fs_root_t *root,
              svn_fs_path_change2_t *change,
              svn_repos_authz_func_t authz_read_func,
              void *authz_read_baton,
              const char *path,
              apr_pool_t *result_pool,
              apr_pool_t *scratch_pool)
{
  if (! change->copyfrom_known)
    {
      SVN_ERR(svn_fs_copied_from(&(change->copyfrom_rev),
                                 &(change->copyfrom_path),
                                 root, path, result_pool));
      change->copyfrom_known = TRUE;
    }
  *copyfrom_rev = change->copyfrom_rev;
  *copyfrom_path = change->copyfrom_path;
  if (*copyfrom_path && SVN_IS_VALID_REVNUM(*copyfrom_rev))
    {
      SVN_ERR(svn_fs_revision_root(copyfrom_root,
                                   svn_fs_root_fs(root),
                                   *copyfrom_rev, result_pool));
      if (authz_read_func)
        {
          SVN_ERR(authz_read_func(src_readable, *copyfrom_root,
                                  *copyfrom_path,
                                  authz_read_baton, result_pool));
        }
      else
        *src_readable = TRUE;
    }
  else
    {
      *copyfrom_root = NULL;
    }
  return SVN_NO_ERROR;
}
static svn_error_t * fill_copyfrom ( svn_fs_root_t * * copyfrom_root , const char * * copyfrom_path , svn_revnum_t * copyfrom_rev , svn_boolean_t * src_readable , svn_fs_root_t * root , svn_fs_path_change2_t * change , svn_repos_authz_func_t authz_read_func , void * authz_read_baton , const char * path , apr_pool_t * result_pool , apr_pool_t * scratch_pool ) { if ( ! change -> copyfrom_known ) { SVN_ERR ( svn_fs_copied_from ( & ( change -> copyfrom_rev ) , & ( change -> copyfrom_path ) , root , path , result_pool ) ) ; change -> copyfrom_known = TRUE ; } * copyfrom_rev = change -> copyfrom_rev ; * copyfrom_path = change -> copyfrom_path ; if ( * copyfrom_path && SVN_IS_VALID_REVNUM ( * copyfrom_rev ) ) { SVN_ERR ( svn_fs_revision_root ( copyfrom_root , svn_fs_root_fs ( root ) , * copyfrom_rev , result_pool ) ) ; if ( authz_read_func ) { SVN_ERR ( authz_read_func ( src_readable , * copyfrom_root , * copyfrom_path , authz_read_baton , result_pool ) ) ; } else * src_readable = TRUE ; } else { * copyfrom_root = NULL ; } return SVN_NO_ERROR ; }
Initialize COPYFROM_ROOT, COPYFROM_PATH, and COPYFROM_REV with the
revision root, fspath, and revnum of the copyfrom of CHANGE, which
corresponds to PATH under ROOT.
Initialize COPYFROM_ROOT COPYFROM_PATH and COPYFROM_REV with the revision root fspath and revnum of the copyfrom of CHANGE which corresponds to PATH under ROOT .
/* SRC_READABLE left uninitialized */