Hi All,

In my pursuit to understand libsvn_wc/update_editor.c I came across an unnecessary member (skip_descendants) in the dir_baton. skip_descendants and skip_this are being set at the same time and have identical values at all times. I have removed one of these (skip_descendants) and the *relevant* code that I understand as being unreachable. I have attached the patch and a log message. Please review and respond.

Regards,
Arwin Arni

[[[
Removed a redundant member (skip_descendants) from the dir baton
and removed *relevent* unreachable code.

* subversion/libsvn_wc/update_editor.c
  (struct dir_baton): Removed 'skip_descendants'.
  
  (open_root, 
   delete_entry,
   open_file,
   add_directory,
   open_directory): Removed unreachable code.

Patch by: Arwin Arni <arwin_at_collab.net>
]]]
Index: subversion/libsvn_wc/update_editor.c
===================================================================
--- subversion/libsvn_wc/update_editor.c        (revision 1053283)
+++ subversion/libsvn_wc/update_editor.c        (working copy)
@@ -275,9 +275,6 @@
   /* Set if updates to this directory are skipped */
   svn_boolean_t skip_this;
 
-  /* Set if updates to all descendants of this directory are skipped */
-  svn_boolean_t skip_descendants;
-
   /* Set if there was a previous notification for this directory */
   svn_boolean_t already_notified;
 
@@ -1214,7 +1211,6 @@
   if (already_conflicted)
     {
       db->skip_this = TRUE;
-      db->skip_descendants = TRUE;
       db->already_notified = TRUE;
       db->bump_info->skipped = TRUE;
 
@@ -2084,14 +2080,9 @@
 
   local_abspath = svn_dirent_join(pb->local_abspath, base, pool);
 
-  if (pb->skip_descendants)
-    {
-      if (!pb->skip_this)
-        SVN_ERR(remember_skipped_tree(pb->edit_baton, local_abspath));
+  if (pb->skip_this)
+    return SVN_NO_ERROR;
 
-      return SVN_NO_ERROR;
-    }
-
   SVN_ERR(check_path_under_root(pb->local_abspath, base, pool));
 
   their_relpath = svn_relpath_join(pb->new_relpath, base, pool);
@@ -2128,13 +2119,9 @@
   SVN_ERR(make_dir_baton(&db, path, eb, pb, TRUE, pool));
   *child_baton = db;
 
-  if (pb->skip_descendants)
+  if (pb->skip_this)
     {
-      if (!pb->skip_this)
-        SVN_ERR(remember_skipped_tree(eb, db->local_abspath));
-
       db->skip_this = TRUE;
-      db->skip_descendants = TRUE;
       db->already_notified = TRUE;
 
       return SVN_NO_ERROR;
@@ -2231,7 +2218,6 @@
       SVN_ERR(remember_skipped_tree(eb, db->local_abspath));
 
       db->skip_this = TRUE;
-      db->skip_descendants = TRUE;
       db->already_notified = TRUE;
 
       /* ### TODO: Also print victim_path in the skip msg. */
@@ -2416,7 +2402,6 @@
       SVN_ERR(remember_skipped_tree(eb, db->local_abspath));
 
       db->skip_this = TRUE;
-      db->skip_descendants = TRUE;
       db->already_notified = TRUE;
 
       do_notification(eb, db->local_abspath, svn_node_unknown,
@@ -2486,13 +2471,9 @@
   /* We should have a write lock on every directory touched.  */
   SVN_ERR(svn_wc__write_check(eb->db, db->local_abspath, pool));
 
-  if (pb->skip_descendants)
+  if (pb->skip_this)
     {
-      if (!pb->skip_this)
-        SVN_ERR(remember_skipped_tree(eb, db->local_abspath));
-
       db->skip_this = TRUE;
-      db->skip_descendants = TRUE;
       db->already_notified = TRUE;
 
       db->bump_info->skipped = TRUE;
@@ -2529,7 +2510,6 @@
       SVN_ERR(remember_skipped_tree(eb, db->local_abspath));
 
       db->skip_this = TRUE;
-      db->skip_descendants = TRUE;
       db->already_notified = TRUE;
 
       do_notification(eb, db->local_abspath, svn_node_unknown,
@@ -2566,7 +2546,6 @@
           tree_conflict->reason != svn_wc_conflict_reason_replaced)
         {
           SVN_ERR(remember_skipped_tree(eb, db->local_abspath));
-          db->skip_descendants = TRUE;
           db->skip_this = TRUE;
 
           return SVN_NO_ERROR;
@@ -3035,14 +3014,10 @@
   SVN_ERR(make_file_baton(&fb, pb, path, TRUE, pool));
   *file_baton = fb;
 
-  if (pb->skip_descendants)
+  if (pb->skip_this)
     {
-      if (!pb->skip_this)
-        SVN_ERR(remember_skipped_tree(eb, fb->local_abspath));
-
       fb->skip_this = TRUE;
       fb->already_notified = TRUE;
-
       return SVN_NO_ERROR;
     }
 
@@ -3322,14 +3297,10 @@
   SVN_ERR(make_file_baton(&fb, pb, path, FALSE, pool));
   *file_baton = fb;
 
-  if (pb->skip_descendants)
+  if (pb->skip_this)
     {
-      if (!pb->skip_this)
-        SVN_ERR(remember_skipped_tree(eb, fb->local_abspath));
-
       fb->skip_this = TRUE;
       fb->already_notified = TRUE;
-
       return SVN_NO_ERROR;
     }
 

Reply via email to