You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/12/20 00:28:56 UTC
svn commit: r1552455 - in /subversion/trunk/subversion:
libsvn_ra/ra_loader.c libsvn_ra_serf/inherited_props.c libsvn_ra_svn/client.c
Author: rhuijben
Date: Thu Dec 19 23:28:55 2013
New Revision: 1552455
URL: http://svn.apache.org/r1552455
Log:
Delegate the iprop ra command to the ra layers even when they don't report
that they support iprops to allow them to use a more efficient implementation
than calling the normal property obtain code in a loop.
This in preparation of adding an optimized implementation in ra_serf.
(I can't really think of a way to optimize this in ra_svn)
* subversion/libsvn_ra/ra_loader.c
(svn_ra_get_inherited_props): Always call the function in the vtable and
only fallback to default implementation when it returns the magic error.
* subversion/libsvn_ra_serf/inherited_props.c
(svn_ra_serf__get_inherited_props): Check how to obtain iprops.
* subversion/libsvn_ra_svn/client.c
(ra_svn_get_inherited_props): Check how to obtain iprops.
Modified:
subversion/trunk/subversion/libsvn_ra/ra_loader.c
subversion/trunk/subversion/libsvn_ra_serf/inherited_props.c
subversion/trunk/subversion/libsvn_ra_svn/client.c
Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.c?rev=1552455&r1=1552454&r2=1552455&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/trunk/subversion/libsvn_ra/ra_loader.c Thu Dec 19 23:28:55 2013
@@ -1457,27 +1457,24 @@ svn_ra_get_inherited_props(svn_ra_sessio
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- svn_boolean_t iprop_capable;
-
+ svn_error_t *err;
/* Path must be relative. */
SVN_ERR_ASSERT(svn_relpath_is_canonical(path));
- SVN_ERR(svn_ra_has_capability(session, &iprop_capable,
- SVN_RA_CAPABILITY_INHERITED_PROPS,
- scratch_pool));
+ err = session->vtable->get_inherited_props(session, iprops, path,
+ revision, result_pool,
+ scratch_pool);
- if (iprop_capable)
- {
- SVN_ERR(session->vtable->get_inherited_props(session, iprops, path,
- revision, result_pool,
- scratch_pool));
- }
- else
+ if (err && err->apr_err == SVN_ERR_RA_NOT_IMPLEMENTED)
{
+ svn_error_clear(err);
+
/* Fallback for legacy servers. */
SVN_ERR(svn_ra__get_inherited_props_walk(session, path, revision, iprops,
result_pool, scratch_pool));
}
+ else
+ SVN_ERR(err);
return SVN_NO_ERROR;
}
Modified: subversion/trunk/subversion/libsvn_ra_serf/inherited_props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/inherited_props.c?rev=1552455&r1=1552454&r2=1552455&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/inherited_props.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/inherited_props.c Thu Dec 19 23:28:55 2013
@@ -235,6 +235,20 @@ svn_ra_serf__get_inherited_props(svn_ra_
svn_ra_serf__handler_t *handler;
svn_ra_serf__xml_context_t *xmlctx;
const char *req_url;
+ svn_boolean_t iprop_capable;
+
+ SVN_ERR(svn_ra_serf__has_capability(ra_session, &iprop_capable,
+ SVN_RA_CAPABILITY_INHERITED_PROPS,
+ scratch_pool));
+
+ if (!iprop_capable)
+ {
+ /* ### TODO: Use pipelined propfind requests to obtain properties,
+ without waiting for every intermediate response */
+
+ /* For now, use implementation in libsvn_ra */
+ return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, NULL, NULL);
+ }
SVN_ERR(svn_ra_serf__get_stable_url(&req_url,
NULL /* latest_revnum */,
Modified: subversion/trunk/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/client.c?rev=1552455&r1=1552454&r2=1552455&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/client.c Thu Dec 19 23:28:55 2013
@@ -2847,6 +2847,16 @@ ra_svn_get_inherited_props(svn_ra_sessio
svn_ra_svn__session_baton_t *sess_baton = session->priv;
svn_ra_svn_conn_t *conn = sess_baton->conn;
apr_array_header_t *iproplist;
+ svn_boolean_t iprop_capable;
+
+ SVN_ERR(ra_svn_has_capability(session, &iprop_capable,
+ SVN_RA_CAPABILITY_INHERITED_PROPS,
+ scratch_pool));
+
+ /* If we don't support native iprop handling, use the implementation
+ in libsvn_ra */
+ if (!iprop_capable)
+ return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, NULL, NULL);
SVN_ERR(svn_ra_svn__write_cmd_get_iprops(conn, scratch_pool,
path, revision));