subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1837289 - /subversion/trunk/subversion/libsvn_ra_serf/update.c
Date Thu, 02 Aug 2018 11:18:33 GMT
Author: julianfoad
Date: Thu Aug  2 11:18:32 2018
New Revision: 1837289

URL: http://svn.apache.org/viewvc?rev=1837289&view=rev
Log:
Removed unused copyfrom-handling in RA-serf's update-editor code path.

No callers of svn_ra_do_update|switch() request 'send_copyfrom_args', and
the update-editor itself asserts that no copyfrom args are passed to it,
yet this RA-serf update-editor pass-though layer still contained code to
act on and pass through copyfrom args. This is now being removed.

A follow-up to r998193, "Finish issue #3711 by completing the purge of
copyfrom-args-over-update code from the client."

See https://issues.apache.org/jira/browse/SVN-3711, "Drop client support for
copyfrom-over-update".

* subversion/libsvn_ra_serf/update.c
  (dir_baton_t,
   file_baton_t,
   create_dir_baton,
   create_file_baton): Drop the copyfrom fields.
  (ensure_dir_opened,
   ensure_file_opened): Don't pretend to pass copyfrom args to the editor.
  (fetch_for_file): Don't attempt to select a delta base from copyfrom args.
  (update_opened): Don't attempt to receive copyfrom args from the server.
    Assert that none were transmitted.

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/update.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/update.c?rev=1837289&r1=1837288&r2=1837289&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/update.c Thu Aug  2 11:18:32 2018
@@ -287,9 +287,6 @@ typedef struct dir_baton_t
 
   svn_revnum_t base_rev;                /* base revision or NULL for Add */
 
-  const char *copyfrom_path;            /* NULL for open */
-  svn_revnum_t copyfrom_rev;            /* SVN_INVALID_REVNUM for open */
-
   /* controlling dir baton - this is only created in ensure_dir_opened() */
   svn_boolean_t dir_opened;
   void *dir_baton;
@@ -329,9 +326,6 @@ typedef struct file_baton_t
 
   svn_revnum_t base_rev;                /* SVN_INVALID_REVNUM for Add */
 
-  const char *copyfrom_path;            /* NULL for open */
-  svn_revnum_t copyfrom_rev;            /* SVN_INVALID_REVNUM for open */
-
   /* controlling dir baton - this is only created in ensure_file_opened() */
   svn_boolean_t file_opened;
   void *file_baton;
@@ -497,7 +491,6 @@ create_dir_baton(dir_baton_t **new_dir,
     }
 
   dir->base_rev = SVN_INVALID_REVNUM;
-  dir->copyfrom_rev = SVN_INVALID_REVNUM;
 
   dir->ref_count = 1;
 
@@ -535,7 +528,6 @@ create_file_baton(file_baton_t **new_fil
 
   /* Sane defaults */
   file->base_rev = SVN_INVALID_REVNUM;
-  file->copyfrom_rev = SVN_INVALID_REVNUM;
 
   *new_file = file;
 
@@ -694,8 +686,7 @@ ensure_dir_opened(dir_baton_t *dir,
         {
           SVN_ERR(ctx->editor->add_directory(dir->relpath,
                                              dir->parent_dir->dir_baton,
-                                             dir->copyfrom_path,
-                                             dir->copyfrom_rev,
+                                             NULL, SVN_INVALID_REVNUM,
                                              dir->pool,
                                              &dir->dir_baton));
         }
@@ -770,8 +761,7 @@ ensure_file_opened(file_baton_t *file,
     {
       SVN_ERR(editor->add_file(file->relpath,
                                file->parent_dir->dir_baton,
-                               file->copyfrom_path,
-                               file->copyfrom_rev,
+                               NULL, SVN_INVALID_REVNUM,
                                file->pool,
                                &file->file_baton));
     }
@@ -1294,17 +1284,6 @@ fetch_for_file(file_baton_t *file,
                                                           file->repos_relpath,
                                                           scratch_pool));
                 }
-              else if (file->copyfrom_path)
-                {
-                  SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(file->copyfrom_rev));
-
-                  fetch_ctx->delta_base = apr_psprintf(file->pool, "%s/%ld/%s",
-                                                       ctx->sess->rev_root_stub,
-                                                       file->copyfrom_rev,
-                                                       svn_path_uri_encode(
-                                                          file->copyfrom_path+1,
-                                                          scratch_pool));
-                }
             }
           else if (ctx->sess->wc_callbacks->get_wc_prop)
             {
@@ -1537,28 +1516,10 @@ update_opened(svn_ra_serf__xml_estate_t
             }
           else
             {
-              dir->copyfrom_path = svn_hash_gets(attrs, "copyfrom-path");
-
-              if (dir->copyfrom_path)
-                {
-                  apr_int64_t copyfrom_rev;
-                  const char *copyfrom_rev_str;
-                  dir->copyfrom_path = svn_fspath__canonicalize(
-                                                        dir->copyfrom_path,
-                                                        dir->pool);
-
-                  copyfrom_rev_str = svn_hash_gets(attrs, "copyfrom-rev");
-
-                  if (!copyfrom_rev_str)
-                    return svn_error_createf(SVN_ERR_XML_ATTRIB_NOT_FOUND,
-                                             NULL,
-                                            _("Missing '%s' attribute"),
-                                            "copyfrom-rev");
-
-                  SVN_ERR(svn_cstring_atoi64(&copyfrom_rev, copyfrom_rev_str));
-
-                  dir->copyfrom_rev = (svn_revnum_t)copyfrom_rev;
-                }
+              /* We told the server not to send copyfrom args and delta
+                 against the copy source. Issue #3711, "Drop client support
+                 for copyfrom-over-update". */
+              SVN_ERR_ASSERT(! svn_hash_gets(attrs, "copyfrom-path"));
 
               if (! ctx->add_props_included)
                 dir->fetch_props = TRUE;
@@ -1586,29 +1547,9 @@ update_opened(svn_ra_serf__xml_estate_t
           else
             {
               const char *sha1_checksum;
-              file->copyfrom_path = svn_hash_gets(attrs, "copyfrom-path");
-
-              if (file->copyfrom_path)
-                {
-                  apr_int64_t copyfrom_rev;
-                  const char *copyfrom_rev_str;
 
-                  file->copyfrom_path = svn_fspath__canonicalize(
-                                                        file->copyfrom_path,
-                                                        file->pool);
-
-                  copyfrom_rev_str = svn_hash_gets(attrs, "copyfrom-rev");
-
-                  if (!copyfrom_rev_str)
-                    return svn_error_createf(SVN_ERR_XML_ATTRIB_NOT_FOUND,
-                                             NULL,
-                                            _("Missing '%s' attribute"),
-                                            "copyfrom-rev");
-
-                  SVN_ERR(svn_cstring_atoi64(&copyfrom_rev, copyfrom_rev_str));
-
-                  file->copyfrom_rev = (svn_revnum_t)copyfrom_rev;
-                }
+              /* Same as in ADD_DIR case above. */
+              SVN_ERR_ASSERT(! svn_hash_gets(attrs, "copyfrom-path"));
 
               sha1_checksum = svn_hash_gets(attrs, "sha1-checksum");
               if (sha1_checksum)



Mime
View raw message