Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/libsvn_ra_serf/serf.c view on Meta::CPAN
session->session_url_str = apr_pstrdup(session->pool, url);
return SVN_NO_ERROR;
}
/* Implements svn_ra__vtable_t.get_session_url(). */
static svn_error_t *
svn_ra_serf__get_session_url(svn_ra_session_t *ra_session,
const char **url,
apr_pool_t *pool)
{
svn_ra_serf__session_t *session = ra_session->priv;
*url = apr_pstrdup(pool, session->session_url_str);
return SVN_NO_ERROR;
}
/* Implements svn_ra__vtable_t.get_latest_revnum(). */
static svn_error_t *
svn_ra_serf__get_latest_revnum(svn_ra_session_t *ra_session,
svn_revnum_t *latest_revnum,
apr_pool_t *pool)
{
svn_ra_serf__session_t *session = ra_session->priv;
return svn_error_trace(svn_ra_serf__get_youngest_revnum(
latest_revnum, session, pool));
}
/* Implements svn_ra__vtable_t.rev_proplist(). */
static svn_error_t *
svn_ra_serf__rev_proplist(svn_ra_session_t *ra_session,
svn_revnum_t rev,
apr_hash_t **ret_props,
apr_pool_t *pool)
{
svn_ra_serf__session_t *session = ra_session->priv;
apr_hash_t *props;
const char *propfind_path;
if (SVN_RA_SERF__HAVE_HTTPV2_SUPPORT(session))
{
propfind_path = apr_psprintf(pool, "%s/%ld", session->rev_stub, rev);
/* svn_ra_serf__retrieve_props() wants to added the revision as
a Label to the PROPFIND, which isn't really necessary when
querying a rev-stub URI. *Shrug* Probably okay to leave the
Label, but whatever. */
rev = SVN_INVALID_REVNUM;
}
else
{
/* Use the VCC as the propfind target path. */
SVN_ERR(svn_ra_serf__discover_vcc(&propfind_path, session, NULL, pool));
}
/* ### fix: fetch hash of *just* the PATH@REV props. no nested hash. */
SVN_ERR(svn_ra_serf__retrieve_props(&props, session, session->conns[0],
propfind_path, rev, "0", all_props,
pool, pool));
SVN_ERR(svn_ra_serf__select_revprops(ret_props, propfind_path, rev, props,
pool, pool));
return SVN_NO_ERROR;
}
/* Implements svn_ra__vtable_t.rev_prop(). */
static svn_error_t *
svn_ra_serf__rev_prop(svn_ra_session_t *session,
svn_revnum_t rev,
const char *name,
svn_string_t **value,
apr_pool_t *pool)
{
apr_hash_t *props;
SVN_ERR(svn_ra_serf__rev_proplist(session, rev, &props, pool));
*value = svn_hash_gets(props, name);
return SVN_NO_ERROR;
}
static svn_error_t *
fetch_path_props(apr_hash_t **props,
svn_ra_serf__session_t *session,
const char *session_relpath,
svn_revnum_t revision,
const svn_ra_serf__dav_props_t *desired_props,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
const char *url;
url = session->session_url.path;
/* If we have a relative path, append it. */
if (session_relpath)
url = svn_path_url_add_component2(url, session_relpath, scratch_pool);
/* If we were given a specific revision, get a URL that refers to that
specific revision (rather than floating with HEAD). */
if (SVN_IS_VALID_REVNUM(revision))
{
SVN_ERR(svn_ra_serf__get_stable_url(&url, NULL /* latest_revnum */,
session, NULL /* conn */,
url, revision,
scratch_pool, scratch_pool));
}
/* URL is stable, so we use SVN_INVALID_REVNUM since it is now irrelevant.
Or we started with SVN_INVALID_REVNUM and URL may be floating. */
SVN_ERR(svn_ra_serf__fetch_node_props(props, session->conns[0],
url, SVN_INVALID_REVNUM,
desired_props,
result_pool, scratch_pool));
return SVN_NO_ERROR;
}
/* Implements svn_ra__vtable_t.check_path(). */
( run in 0.390 second using v1.01-cache-2.11-cpan-39bf76dae61 )