Hi,

I was looking through the subversion/libsvn_wc/update_editor.c and noticed that there was a redundant member (added_with_history) in the file baton structure. This is not being set anywhere which results in some unreachable code. I have removed the member and the corresponding unreachable code. This was (as I gather from svn blame) introduced in r867451 by glasser to implement copy-on-update. I understand that some of this was reverted by cmpilato. I guess this should have been removed too. I have attached a patch and a log message. Please review and respond.

Regards,
Arwin Arni
Index: subversion/libsvn_wc/update_editor.c
===================================================================
--- subversion/libsvn_wc/update_editor.c        (revision 1049559)
+++ subversion/libsvn_wc/update_editor.c        (working copy)
@@ -908,9 +908,6 @@
   /* Set if this file is new. */
   svn_boolean_t adding_file;
 
-  /* Set if this file is new with history. */
-  svn_boolean_t added_with_history;
-
   /* Set if an unversioned file of the same name already existed in
      this directory. */
   svn_boolean_t obstruction_found;
@@ -3859,7 +3856,7 @@
           svn_node_kind_t wfile_kind;
 
           SVN_ERR(svn_io_check_path(fb->local_abspath, &wfile_kind, pool));
-          if (wfile_kind == svn_node_none && ! fb->added_with_history)
+          if (wfile_kind == svn_node_none)
             {
               /* working file is missing?!
                  Just copy the new text-base to the file. */
@@ -3890,14 +3887,6 @@
                     path_ext = "";
                 }
 
-              /* Create strings representing the revisions of the
-                 old and new text-bases. */
-              /* Either an old version, or an add-with-history */
-              if (fb->added_with_history)
-                oldrev_str = apr_psprintf(pool, ".copied%s%s",
-                                          *path_ext ? "." : "",
-                                          *path_ext ? path_ext : "");
-              else
                 {
                   svn_revnum_t old_rev = revision;
 
@@ -4137,14 +4126,6 @@
       SVN_ERR_ASSERT(new_text_base_md5_checksum &&
                      new_text_base_sha1_checksum);
     }
-  else if (fb->added_with_history)
-    {
-      SVN_ERR_ASSERT(! fb->new_text_base_sha1_checksum);
-      new_text_base_md5_checksum = fb->copied_text_base_md5_checksum;
-      new_text_base_sha1_checksum = fb->copied_text_base_sha1_checksum;
-      SVN_ERR_ASSERT(new_text_base_md5_checksum &&
-                     new_text_base_sha1_checksum);
-    }
   else
     {
       SVN_ERR_ASSERT(! fb->new_text_base_sha1_checksum
[[[
Removed a redundant member (added_with_history) from the file baton
and removed *relevent* unreachable code.

* subversion/libsvn_wc/update_editor.c
  (struct file_baton): Removed 'added_with_history'.
  (merge_file, close_file): Removed unreachable code.

Patch by: Arwin Arni <arwin_at_collab.net>
]]]

Reply via email to