You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2017/07/28 12:01:27 UTC

svn commit: r1803269 - in /subversion/trunk/subversion: include/svn_ra_svn.h libsvn_ra_svn/client.c libsvn_ra_svn/editorp.c libsvn_ra_svn/protocol svnserve/serve.c

Author: danielsh
Date: Fri Jul 28 12:01:26 2017
New Revision: 1803269

URL: http://svn.apache.org/viewvc?rev=1803269&view=rev
Log:
ra_svn: Advertise acceptance of svndiff2 deltas.

Add an "accepts-svndiff2" wire capability, and have both the client and
the server advertise it.  While currently neither the client nor the
server sends svndiff2 over the wire, this capability will allow
1.11 endpoints to send svndiff2 to 1.10 endpoints.

No change was needed beyond the capability addition; the incumbent code
would already accept svndiff2 if a (non-compliant) remote endpoint used it.

* subversion/libsvn_ra_svn/protocol
  (accepts-svndiff2): New wire capability.

* subversion/include/svn_ra_svn.h
  (SVN_RA_SVN_CAP_SVNDIFF2_ACCEPTED): New.

* subversion/svnserve/serve.c
  (file_rev_handler): Note that this is where we could act on the
    new capability.
  (construct_server_baton): Advertise the new capability.

* subversion/libsvn_ra_svn/editorp.c
  (ra_svn_apply_textdelta): Note that this is where we could act on the
    new capability.

* subversion/libsvn_ra_svn/client.c
  (open_session): Advertise the new capability.

Modified:
    subversion/trunk/subversion/include/svn_ra_svn.h
    subversion/trunk/subversion/libsvn_ra_svn/client.c
    subversion/trunk/subversion/libsvn_ra_svn/editorp.c
    subversion/trunk/subversion/libsvn_ra_svn/protocol
    subversion/trunk/subversion/svnserve/serve.c

Modified: subversion/trunk/subversion/include/svn_ra_svn.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_ra_svn.h?rev=1803269&r1=1803268&r2=1803269&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_ra_svn.h (original)
+++ subversion/trunk/subversion/include/svn_ra_svn.h Fri Jul 28 12:01:26 2017
@@ -49,6 +49,7 @@ extern "C" {
 /** Currently-defined capabilities. */
 #define SVN_RA_SVN_CAP_EDIT_PIPELINE "edit-pipeline"
 #define SVN_RA_SVN_CAP_SVNDIFF1 "svndiff1"
+#define SVN_RA_SVN_CAP_SVNDIFF2_ACCEPTED "accepts-svndiff2"
 #define SVN_RA_SVN_CAP_ABSENT_ENTRIES "absent-entries"
 /* maps to SVN_RA_CAPABILITY_COMMIT_REVPROPS: */
 #define SVN_RA_SVN_CAP_COMMIT_REVPROPS "commit-revprops"

Modified: subversion/trunk/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/client.c?rev=1803269&r1=1803268&r2=1803269&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/client.c Fri Jul 28 12:01:26 2017
@@ -746,10 +746,11 @@ static svn_error_t *open_session(svn_ra_
    * capability list, and the URL, and subsequently there is an auth
    * request. */
   /* Client-side capabilities list: */
-  SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "n(wwwwww)cc(?c)",
+  SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "n(wwwwwww)cc(?c)",
                                   (apr_uint64_t) 2,
                                   SVN_RA_SVN_CAP_EDIT_PIPELINE,
                                   SVN_RA_SVN_CAP_SVNDIFF1,
+                                  SVN_RA_SVN_CAP_SVNDIFF2_ACCEPTED,
                                   SVN_RA_SVN_CAP_ABSENT_ENTRIES,
                                   SVN_RA_SVN_CAP_DEPTH,
                                   SVN_RA_SVN_CAP_MERGEINFO,

Modified: subversion/trunk/subversion/libsvn_ra_svn/editorp.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/editorp.c?rev=1803269&r1=1803268&r2=1803269&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/editorp.c Fri Jul 28 12:01:26 2017
@@ -353,6 +353,8 @@ static svn_error_t *ra_svn_apply_textdel
 
   /* If the connection does not support SVNDIFF1 or if we don't want to use
    * compression, use the non-compressing "version 0" implementation */
+ /* ### TODO: Check SVN_RA_SVN_CAP_SVNDIFF2_ACCEPTED and decide between
+  * ###       svndiff1[at compression_level] and svndiff2 */
   if (   svn_ra_svn_compression_level(b->conn) > 0
       && svn_ra_svn_has_capability(b->conn, SVN_RA_SVN_CAP_SVNDIFF1))
     svn_txdelta_to_svndiff3(wh, wh_baton, diff_stream, 1,

Modified: subversion/trunk/subversion/libsvn_ra_svn/protocol
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/protocol?rev=1803269&r1=1803268&r2=1803269&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/protocol (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/protocol Fri Jul 28 12:01:26 2017
@@ -188,6 +188,10 @@ capability and C indicates a client capa
 [CS] svndiff1          If both the client and server support svndiff version
                        1, this will be used as the on-the-wire format for 
                        svndiff instead of svndiff version 0.
+[CS] accepts-svndiff2  This capability advertises support for accepting
+                       svndiff2 deltas.  The sender of a delta (= the editor
+                       driver) may send it in any svndiff version the receiver
+                       has announced it can accept.
 [CS] absent-entries    If the remote end announces support for this capability,
                        it will accept the absent-dir and absent-file editor
                        commands.

Modified: subversion/trunk/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnserve/serve.c?rev=1803269&r1=1803268&r2=1803269&view=diff
==============================================================================
--- subversion/trunk/subversion/svnserve/serve.c (original)
+++ subversion/trunk/subversion/svnserve/serve.c Fri Jul 28 12:01:26 2017
@@ -2823,6 +2823,8 @@ static svn_error_t *file_rev_handler(voi
 
       /* If the connection does not support SVNDIFF1 or if we don't want to use
        * compression, use the non-compressing "version 0" implementation */
+      /* ### TODO: Check SVN_RA_SVN_CAP_SVNDIFF2_ACCEPTED and decide between
+       * ###       svndiff1[at compression_level] and svndiff2 */
       if (   svn_ra_svn_compression_level(frb->conn) > 0
           && svn_ra_svn_has_capability(frb->conn, SVN_RA_SVN_CAP_SVNDIFF1))
         svn_txdelta_to_svndiff3(d_handler, d_baton, stream, 1,
@@ -4135,10 +4137,11 @@ construct_server_baton(server_baton_t **
    * send an empty mechlist. */
   if (params->compression_level > 0)
     SVN_ERR(svn_ra_svn__write_cmd_response(conn, scratch_pool,
-                                           "nn()(wwwwwwwwwwww)",
+                                           "nn()(wwwwwwwwwwwww)",
                                            (apr_uint64_t) 2, (apr_uint64_t) 2,
                                            SVN_RA_SVN_CAP_EDIT_PIPELINE,
                                            SVN_RA_SVN_CAP_SVNDIFF1,
+                                           SVN_RA_SVN_CAP_SVNDIFF2_ACCEPTED,
                                            SVN_RA_SVN_CAP_ABSENT_ENTRIES,
                                            SVN_RA_SVN_CAP_COMMIT_REVPROPS,
                                            SVN_RA_SVN_CAP_DEPTH,