You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2010/05/06 03:28:52 UTC

svn commit: r941560 - /subversion/trunk/subversion/libsvn_wc/entries.c

Author: gstein
Date: Thu May  6 01:28:51 2010
New Revision: 941560

URL: http://svn.apache.org/viewvc?rev=941560&view=rev
Log:
Clarify how the "hidden" concept is computed.

* subversion/libsvn_wc/entries.c:
  (svn_wc__entry_is_hidden): expand the code. add comments. add an
    assertion to demonstrate the restricted schedule values.

Modified:
    subversion/trunk/subversion/libsvn_wc/entries.c

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=941560&r1=941559&r2=941560&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Thu May  6 01:28:51 2010
@@ -135,15 +135,24 @@ alloc_entry(apr_pool_t *pool)
 svn_error_t *
 svn_wc__entry_is_hidden(svn_boolean_t *hidden, const svn_wc_entry_t *entry)
 {
-  /* Note: the condition below may allow certain combinations that the
-     rest of the system will never reach (eg. absent/add).
-
-     In English, the condition is: "the entry is not present, and I haven't
+  /* In English, the condition is: "the entry is not present, and I haven't
      scheduled something over the top of it."  */
-  *hidden = ((entry->deleted
-           || entry->absent
-           || entry->depth == svn_depth_exclude)
-          && entry->schedule != svn_wc_schedule_add);
+  if (entry->deleted
+      || entry->absent
+      || entry->depth == svn_depth_exclude)
+    {
+      /* These kinds of nodes cannot be marked for deletion (which also
+         means no "replace" either).  */
+      SVN_ERR_ASSERT(entry->schedule == svn_wc_schedule_add
+                     || entry->schedule == svn_wc_schedule_normal);
+
+      /* Hidden if something hasn't been added over it.
+
+         ### is this even possible with absent or excluded nodes?  */
+      *hidden = entry->schedule != svn_wc_schedule_add;
+    }
+  else
+    *hidden = FALSE;
 
   return SVN_NO_ERROR;
 }