Daniel Shahaf <d...@daniel.shahaf.name> writes: > Perhaps invent an "I speak svndiff1" wire capability and make 1.10 > servers advertise it? I get that the workaround implemented is > necessary for interoperating with released servers, but we could at > least do it right from now on.
Makes sense. Something along these lines? [[[ Index: subversion/include/svn_dav.h =================================================================== --- subversion/include/svn_dav.h (revision 1704592) +++ subversion/include/svn_dav.h (working copy) @@ -386,7 +386,16 @@ extern "C" { #define SVN_DAV_NS_DAV_SVN_REVERSE_FILE_REVS\ SVN_DAV_PROP_NS_DAV "svn/reverse-file-revs" +/** Presence of this in a DAV header in an OPTIONS response indicates + * that the transmitter (in this case, the server) knows how to handle + * svndiff1 format encoding. + * + * @since New in 1.10. + */ +#define SVN_DAV_NS_DAV_SVN_SVNDIFF1\ + SVN_DAV_PROP_NS_DAV "svn/svndiff1" + /** @} */ /** @} */ Index: subversion/libsvn_ra_serf/options.c =================================================================== --- subversion/libsvn_ra_serf/options.c (revision 1704592) +++ subversion/libsvn_ra_serf/options.c (working copy) @@ -226,6 +226,12 @@ capabilities_headers_iterator_callback(void *baton { session->supports_rev_rsrc_replay = TRUE; } + if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_SVNDIFF1, vals)) + { + /* Use compressed svndiff1 format for servers that properly + advertise this capability (Subversion 1.10 and greater). */ + session->supports_svndiff1 = TRUE; + } } /* SVN-specific headers -- if present, server supports HTTP protocol v2 */ @@ -243,7 +249,8 @@ capabilities_headers_iterator_callback(void *baton apr_hash_set(session->supported_posts, "create-txn", 10, (void *)1); } - /* Use compressed svndiff1 format for servers that speak HTTPv2. + /* Use compressed svndiff1 format for servers that speak HTTPv2, + in addition to servers that send SVN_DAV_NS_DAV_SVN_SVNDIFF1. Apache HTTPd + mod_dav_svn servers support svndiff1, beginning from Subversion 1.4, but they do not advertise this capability. Index: subversion/mod_dav_svn/version.c =================================================================== --- subversion/mod_dav_svn/version.c (revision 1704592) +++ subversion/mod_dav_svn/version.c (working copy) @@ -152,6 +152,7 @@ get_vsn_options(apr_pool_t *p, apr_text_header *ph 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); /* Mergeinfo is a special case: here we merely say that the server * knows how to handle mergeinfo -- whether the repository does too * is a separate matter. ]]] Regards, Evgeny Kotkov