FreeBSD/contrib/subversion/subversion/libsvn_repos/config_pool.c
/* Given the URL, search the CONFIG_POOL for an entry that maps it URL to
 * a content checksum and is still up-to-date.  If this could be found,
 * return the object's *KEY.  Use POOL for allocations.
 *
 * Requires external serialization on CONFIG_POOL.
 *
 * Note that this is only the URL(+rev) -> Checksum lookup and does not
 * guarantee that there is actually a config object available for *KEY.
 */
Given the URL, search the CONFIG_POOL for an entry that maps it URL to
a content checksum and is still up-to-date.  If this could be found,
return the object's *KEY.  Use POOL for allocations.

Requires external serialization on CONFIG_POOL.

Note that this is only the URL(+rev) -> Checksum lookup and does not
guarantee that there is actually a config object available for *KEY.
Given the URL search the CONFIG_POOL for an entry that maps it URL to a content checksum and is still up - to - date . If this could be found return the object ' s * KEY . Use POOL for allocations . Requires external serialization on CONFIG_POOL . Note that this is only the URL ( + rev ) - > Checksum lookup and does not guarantee that there is actually a config object available for * KEY .
static svn_error_t *
key_by_url(svn_membuf_t **key,
           svn_repos__config_pool_t *config_pool,
           const char *url,
           apr_pool_t *pool)
{
  svn_error_t *err;
  svn_stringbuf_t *contents;
  apr_int64_t current;
  in_repo_config_t *config = svn_hash_gets(config_pool->in_repo_configs, url);
  *key = NULL;
  if (!config)
    return SVN_NO_ERROR;
  err = svn_stringbuf_from_file2(&contents,
                                 svn_dirent_join(config->repo_root,
                                                 "db/current", pool),
                                 pool);
  if (!err)
    err = svn_cstring_atoi64(&current, contents->data);
  if (err)
    svn_error_clear(err);
  else if (current == config->revision)
    *key = checksum_as_key(config->key, pool);
  return SVN_NO_ERROR;
}
static svn_error_t * key_by_url ( svn_membuf_t * * key , svn_repos__config_pool_t * config_pool , const char * url , apr_pool_t * pool ) { svn_error_t * err ; svn_stringbuf_t * contents ; apr_int64_t current ; in_repo_config_t * config = svn_hash_gets ( config_pool -> in_repo_configs , url ) ; * key = NULL ; if ( ! config ) return SVN_NO_ERROR ; err = svn_stringbuf_from_file2 ( & contents , svn_dirent_join ( config -> repo_root , " " , pool ) , pool ) ; if ( ! err ) err = svn_cstring_atoi64 ( & current , contents -> data ) ; if ( err ) svn_error_clear ( err ) ; else if ( current == config -> revision ) * key = checksum_as_key ( config -> key , pool ) ; return SVN_NO_ERROR ; }
Given the URL, search the CONFIG_POOL for an entry that maps it URL to
 a content checksum and is still up-to-date.
Given the URL search the CONFIG_POOL for an entry that maps it URL to a content checksum and is still up - to - date .
/* hash lookup url -> sha1 -> config */ /* found *some* reference to a configuration.
   * Verify that it is still current.  Will fail for BDB repos. */