FreeBSD/contrib/subversion/subversion/libsvn_fs_x/revprops.c
/* Read the revprops for revision REV in FS and return them in *PROPERTIES_P.
 *
 * Allocations will be done in POOL.
 */
Read the revprops for revision REV in FS and return them in *PROPERTIES_P.
Allocations will be done in POOL.
Read the revprops for revision REV in FS and return them in * PROPERTIES_P . Allocations will be done in POOL .
svn_error_t *
svn_fs_x__get_revision_proplist(apr_hash_t **proplist_p,
                                svn_fs_t *fs,
                                svn_revnum_t rev,
                                svn_boolean_t bypass_cache,
                                apr_pool_t *result_pool,
                                apr_pool_t *scratch_pool)
{
  svn_fs_x__data_t *ffd = fs->fsap_data;
  apr_int64_t generation = 0;
  *proplist_p = NULL;
  SVN_ERR(svn_fs_x__ensure_revision_exists(rev, fs, scratch_pool));
  if (!bypass_cache && has_revprop_cache(fs, scratch_pool))
    {
      svn_boolean_t is_cached;
      svn_fs_x__pair_cache_key_t key = { 0 };
      SVN_ERR(read_revprop_generation(&generation, fs, scratch_pool));
      key.revision = rev;
      key.second = generation;
      SVN_ERR(svn_cache__get((void **) proplist_p, &is_cached,
                             ffd->revprop_cache, &key, result_pool));
      if (is_cached)
        return SVN_NO_ERROR;
    }
  if (!svn_fs_x__is_packed_revprop(fs, rev))
    {
      svn_error_t *err = read_non_packed_revprop(proplist_p, fs, rev,
                                                 generation, result_pool,
                                                 scratch_pool);
      if (err)
        {
          if (!APR_STATUS_IS_ENOENT(err->apr_err))
            return svn_error_trace(err);
          svn_error_clear(err);
          *proplist_p = NULL; 
        }
    }
  if (!*proplist_p)
    {
      packed_revprops_t *revprops;
      SVN_ERR(read_pack_revprop(&revprops, fs, rev, generation, FALSE,
                                result_pool, scratch_pool));
      *proplist_p = revprops->properties;
    }
  if (!*proplist_p)
    return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
                             _("Could not read revprops for revision %ld"),
                             rev);
  return SVN_NO_ERROR;
}
svn_error_t * svn_fs_x__get_revision_proplist ( apr_hash_t * * proplist_p , svn_fs_t * fs , svn_revnum_t rev , svn_boolean_t bypass_cache , apr_pool_t * result_pool , apr_pool_t * scratch_pool ) { svn_fs_x__data_t * ffd = fs -> fsap_data ; apr_int64_t generation = 0 ; * proplist_p = NULL ; SVN_ERR ( svn_fs_x__ensure_revision_exists ( rev , fs , scratch_pool ) ) ; if ( ! bypass_cache && has_revprop_cache ( fs , scratch_pool ) ) { svn_boolean_t is_cached ; svn_fs_x__pair_cache_key_t key = { 0 } ; SVN_ERR ( read_revprop_generation ( & generation , fs , scratch_pool ) ) ; key . revision = rev ; key . second = generation ; SVN_ERR ( svn_cache__get ( ( void * * ) proplist_p , & is_cached , ffd -> revprop_cache , & key , result_pool ) ) ; if ( is_cached ) return SVN_NO_ERROR ; } if ( ! svn_fs_x__is_packed_revprop ( fs , rev ) ) { svn_error_t * err = read_non_packed_revprop ( proplist_p , fs , rev , generation , result_pool , scratch_pool ) ; if ( err ) { if ( ! APR_STATUS_IS_ENOENT ( err -> apr_err ) ) return svn_error_trace ( err ) ; svn_error_clear ( err ) ; * proplist_p = NULL ; } } if ( ! * proplist_p ) { packed_revprops_t * revprops ; SVN_ERR ( read_pack_revprop ( & revprops , fs , rev , generation , FALSE , result_pool , scratch_pool ) ) ; * proplist_p = revprops -> properties ; } if ( ! * proplist_p ) return svn_error_createf ( SVN_ERR_FS_NO_SUCH_REVISION , NULL , _ ( " " ) , rev ) ; return SVN_NO_ERROR ; }
Read the revprops for revision REV in FS and return them in *PROPERTIES_P.
Read the revprops for revision REV in FS and return them in * PROPERTIES_P .
/* not found, yet */ /* should they be available at all? */ /* Try cache lookup first. */ /* if REV had not been packed when we began, try reading it from the
   * non-packed shard.  If that fails, we will fall through to packed
   * shard reads. */ /* in case read_non_packed_revprop changed it */ /* if revprop packing is available and we have not read the revprops, yet,
   * try reading them from a packed shard.  If that fails, REV is most
   * likely invalid (or its revprops highly contested). */ /* The revprops should have been there. Did we get them? */