Author: svn-role Date: Sun Feb 11 04:00:11 2018 New Revision: 1823807 URL: http://svn.apache.org/viewvc?rev=1823807&view=rev Log: Merge r1820778 from trunk:
* r1820778 Make mod_dav_svn report commit capabilities based on SVNMasterVersion. Justification: Allows 1.10 write-through proxy to 1.9 master. Notes: I believe this is a release blocker, without it we break backward compatibilty for write-through proxies. Votes: +1: philip, rhuijben, stsp, brane Modified: subversion/branches/1.10.x/ (props changed) subversion/branches/1.10.x/STATUS subversion/branches/1.10.x/subversion/mod_dav_svn/dav_svn.h subversion/branches/1.10.x/subversion/mod_dav_svn/mod_dav_svn.c subversion/branches/1.10.x/subversion/mod_dav_svn/version.c Propchange: subversion/branches/1.10.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sun Feb 11 04:00:11 2018 @@ -100,4 +100,4 @@ /subversion/branches/verify-at-commit:1462039-1462408 /subversion/branches/verify-keep-going:1439280-1546110 /subversion/branches/wc-collate-path:1402685-1480384 -/subversion/trunk:1817837,1817856,1818577-1818578,1818584,1818651,1818662,1818727,1818801,1818803,1818807,1818868,1818871,1819036-1819037,1819043,1819049,1819052,1819093,1819146,1819162,1819444,1819556-1819557,1819603,1819804,1819911,1820046-1820047,1820518,1820718,1821183,1821224,1821621,1821678,1822401,1822996,1823202-1823203 +/subversion/trunk:1817837,1817856,1818577-1818578,1818584,1818651,1818662,1818727,1818801,1818803,1818807,1818868,1818871,1819036-1819037,1819043,1819049,1819052,1819093,1819146,1819162,1819444,1819556-1819557,1819603,1819804,1819911,1820046-1820047,1820518,1820718,1820778,1821183,1821224,1821621,1821678,1822401,1822996,1823202-1823203 Modified: subversion/branches/1.10.x/STATUS URL: http://svn.apache.org/viewvc/subversion/branches/1.10.x/STATUS?rev=1823807&r1=1823806&r2=1823807&view=diff ============================================================================== --- subversion/branches/1.10.x/STATUS (original) +++ subversion/branches/1.10.x/STATUS Sun Feb 11 04:00:11 2018 @@ -21,16 +21,6 @@ Veto-blocked changes: Approved changes: ================= - * r1820778 - Make mod_dav_svn report commit capabilities based on SVNMasterVersion. - Justification: - Allows 1.10 write-through proxy to 1.9 master. - Notes: - I believe this is a release blocker, without it we break backward - compatibilty for write-through proxies. - Votes: - +1: philip, rhuijben, stsp, brane - * r1820044 Make 'svn shelves' diffstat output show WC-relative paths. Votes: Modified: subversion/branches/1.10.x/subversion/mod_dav_svn/dav_svn.h URL: http://svn.apache.org/viewvc/subversion/branches/1.10.x/subversion/mod_dav_svn/dav_svn.h?rev=1823807&r1=1823806&r2=1823807&view=diff ============================================================================== --- subversion/branches/1.10.x/subversion/mod_dav_svn/dav_svn.h (original) +++ subversion/branches/1.10.x/subversion/mod_dav_svn/dav_svn.h Sun Feb 11 04:00:11 2018 @@ -359,10 +359,6 @@ svn_boolean_t dav_svn__get_list_parentpa master server version (if provided via SVNMasterVersion). */ svn_boolean_t dav_svn__check_httpv2_support(request_rec *r); -/* For the repository referred to by this request, should ephemeral - txnprop support be advertised? */ -svn_boolean_t dav_svn__check_ephemeral_txnprops_support(request_rec *r); - /* SPECIAL URI Modified: subversion/branches/1.10.x/subversion/mod_dav_svn/mod_dav_svn.c URL: http://svn.apache.org/viewvc/subversion/branches/1.10.x/subversion/mod_dav_svn/mod_dav_svn.c?rev=1823807&r1=1823806&r2=1823807&view=diff ============================================================================== --- subversion/branches/1.10.x/subversion/mod_dav_svn/mod_dav_svn.c (original) +++ subversion/branches/1.10.x/subversion/mod_dav_svn/mod_dav_svn.c Sun Feb 11 04:00:11 2018 @@ -923,21 +923,6 @@ dav_svn__check_httpv2_support(request_re } -svn_boolean_t -dav_svn__check_ephemeral_txnprops_support(request_rec *r) -{ - svn_version_t *version = dav_svn__get_master_version(r); - - /* We know this server supports ephemeral txnprops. But if we're - proxying requests to a master server, we need to see if it - supports them, too. */ - if (version && (! svn_version__at_least(version, 1, 8, 0))) - return FALSE; - - return TRUE; -} - - /* FALSE if path authorization should be skipped. * TRUE if either the bypass or the apache subrequest methods should be used. */ Modified: subversion/branches/1.10.x/subversion/mod_dav_svn/version.c URL: http://svn.apache.org/viewvc/subversion/branches/1.10.x/subversion/mod_dav_svn/version.c?rev=1823807&r1=1823806&r2=1823807&view=diff ============================================================================== --- subversion/branches/1.10.x/subversion/mod_dav_svn/version.c (original) +++ subversion/branches/1.10.x/subversion/mod_dav_svn/version.c Sun Feb 11 04:00:11 2018 @@ -152,9 +152,6 @@ get_vsn_options(apr_pool_t *p, apr_text_ apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_INHERITED_PROPS); apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_INLINE_PROPS); apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_REVERSE_FILE_REVS); - apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_SVNDIFF1); - apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_SVNDIFF2); - apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_PUT_RESULT_CHECKSUM); apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_LIST); /* Mergeinfo is a special case: here we merely say that the server * knows how to handle mergeinfo -- whether the repository does too @@ -179,11 +176,29 @@ get_option(const dav_resource *resource, const apr_xml_elem *elem, apr_text_header *option) { + int i; request_rec *r = resource->info->r; const char *repos_root_uri = dav_svn__build_uri(resource->info->repos, DAV_SVN__BUILD_URI_PUBLIC, SVN_IGNORED_REVNUM, "", FALSE /* add_href */, resource->pool); + svn_version_t *master_version = dav_svn__get_master_version(r); + + /* These capabilities are used during commit and when configured as + a WebDAV slave (SVNMasterURI is set) their availablity should + depend on the master version (SVNMasterVersion is set) if it is + older than our own version. Also, although SVNDIFF1 is available + before 1.10 none of those earlier servers advertised it so for + consistency we don't advertise it for masters older than 1.10. */ + struct capability_versions_t { + const char *capability_name; + svn_version_t min_version; + } capabilities[] = { + { SVN_DAV_NS_DAV_SVN_EPHEMERAL_TXNPROPS, { 1, 8, 0, ""} }, + { SVN_DAV_NS_DAV_SVN_SVNDIFF1, { 1, 10, 0, ""} }, + { SVN_DAV_NS_DAV_SVN_SVNDIFF2, { 1, 10, 0, ""} }, + { SVN_DAV_NS_DAV_SVN_PUT_RESULT_CHECKSUM, { 1, 10, 0, ""} }, + }; /* ### DAV:version-history-collection-set */ if (elem->ns != APR_XML_NS_DAV_ID @@ -209,14 +224,6 @@ get_option(const dav_resource *resource, apr_text_append(resource->pool, option, "</D:activity-collection-set>"); - /* If we're allowed (by configuration) to do so, advertise support - for ephemeral transaction properties. */ - if (dav_svn__check_ephemeral_txnprops_support(r)) - { - apr_table_addn(r->headers_out, "DAV", - SVN_DAV_NS_DAV_SVN_EPHEMERAL_TXNPROPS); - } - if (resource->info->repos->fs) { svn_error_t *serr; @@ -277,8 +284,6 @@ get_option(const dav_resource *resource, DeltaV-free! If we're configured to advise this support, do so. */ if (resource->info->repos->v2_protocol) { - int i; - svn_version_t *master_version = dav_svn__get_master_version(r); dav_svn__bulk_upd_conf bulk_upd_conf = dav_svn__get_bulk_updates_flag(r); /* The list of Subversion's custom POSTs and which versions of @@ -349,6 +354,22 @@ get_option(const dav_resource *resource, } } + /* Report commit capabilites. */ + for (i = 0; i < sizeof(capabilities)/sizeof(capabilities[0]); ++i) + { + /* If a master version is declared filter out unsupported + capabilities. */ + if (master_version + && (!svn_version__at_least(master_version, + capabilities[i].min_version.major, + capabilities[i].min_version.minor, + capabilities[i].min_version.patch))) + continue; + + apr_table_addn(r->headers_out, "DAV", + apr_pstrdup(r->pool, capabilities[i].capability_name)); + } + return NULL; }