Modified: subversion/branches/compressed-pristines/subversion/libsvn_wc/status.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/status.c?rev=1413258&r1=1413257&r2=1413258&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_wc/status.c 
(original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_wc/status.c Sat 
Nov 24 20:29:11 2012
@@ -939,10 +939,14 @@ send_status_structure(const struct walk_
 }
 
 
-/* Store in PATTERNS a list of all svn:ignore properties from
+/* Store in *PATTERNS a list of all svn:ignore properties from
    the working copy directory, including the default ignores
    passed in as IGNORES.
 
+   If INHERITED_PATTERNS is not NULL, then store in *INHERITED_PATTERNS
+   a list of all ignore patterns defined by the svn:inherited-ignores
+   properties explicitly set on, or inherited by, LOCAL_ABSPATH.
+
    Upon return, *PATTERNS will contain zero or more (const char *)
    patterns from the value of the SVN_PROP_IGNORE property set on
    the working directory path.
@@ -961,6 +965,7 @@ send_status_structure(const struct walk_
 */
 static svn_error_t *
 collect_ignore_patterns(apr_array_header_t **patterns,
+                        apr_array_header_t **inherited_patterns,
                         svn_wc__db_t *db,
                         const char *local_abspath,
                         const apr_array_header_t *ignores,
@@ -970,7 +975,7 @@ collect_ignore_patterns(apr_array_header
 {
   int i;
   const svn_string_t *value;
-  apr_hash_t *props;
+  apr_hash_t *props = NULL;
 
   /* ### assert we are passed a directory? */
 
@@ -984,21 +989,56 @@ collect_ignore_patterns(apr_array_header
                                                             ignore);
     }
 
-  if (!may_have_props)
-    return SVN_NO_ERROR;
+  if (may_have_props)
+    {
+      /* Add any svn:ignore globs to the PATTERNS array. */
+      SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath,
+                                    scratch_pool, scratch_pool));
 
-  /* Then add any svn:ignore globs to the PATTERNS array. */
-  SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath,
-                                scratch_pool, scratch_pool));
+      if (!props)
+        return SVN_NO_ERROR;
 
-  if (!props)
-    return SVN_NO_ERROR;
+      value = apr_hash_get(props, SVN_PROP_IGNORE, APR_HASH_KEY_STRING);
 
-  value = apr_hash_get(props, SVN_PROP_IGNORE, APR_HASH_KEY_STRING);
+      if (value != NULL)
+        svn_cstring_split_append(*patterns, value->data, "\n\r", FALSE,
+                                 result_pool);
+    }
 
-  if (value != NULL)
-    svn_cstring_split_append(*patterns, value->data, "\n\r", FALSE,
-                             result_pool);
+  if (inherited_patterns)
+    {
+      apr_array_header_t *inherited_props;
+
+      *inherited_patterns = apr_array_make(result_pool, 1,
+                                           sizeof(const char *));
+      if (props)
+        {
+          value = apr_hash_get(props, SVN_PROP_INHERITABLE_IGNORES,
+                               APR_HASH_KEY_STRING);
+          if (value != NULL)
+            svn_cstring_split_append(*inherited_patterns, value->data, "\n\r",
+                                     FALSE, result_pool);      
+        }
+
+      SVN_ERR(svn_wc__internal_get_iprops(&inherited_props, db, local_abspath,
+                                          SVN_PROP_INHERITABLE_IGNORES,
+                                          scratch_pool, scratch_pool));
+      for (i = 0; i < inherited_props->nelts; i++)
+        {
+          apr_hash_index_t *hi;
+          svn_prop_inherited_item_t *elt = APR_ARRAY_IDX(
+            inherited_props, i, svn_prop_inherited_item_t *);
+
+          for (hi = apr_hash_first(scratch_pool, elt->prop_hash);
+               hi;
+               hi = apr_hash_next(hi))
+            {
+              const svn_string_t *propval = svn__apr_hash_index_val(hi);
+              svn_cstring_split_append(*inherited_patterns, propval->data,
+                                       "\n\r", FALSE, result_pool);   
+            }
+        }
+    }
 
   return SVN_NO_ERROR;
 }
@@ -1043,13 +1083,13 @@ is_external_path(apr_hash_t *externals,
    requested.  PATH_KIND is the node kind of NAME as determined by the
    caller.  PATH_SPECIAL is the special status of the path, also determined
    by the caller.
-   PATTERNS points to a list of filename patterns which are marked as
-   ignored.  None of these parameter may be NULL.  EXTERNALS is a hash
-   of known externals definitions for this status run.
+   PATTERNS and INHERITED_PATTERNS point to a list of filename patterns which
+   are marked as ignored.  None of these parameter may be NULL.  EXTERNALS is
+   a hash of known externals definitions for this status run.
 
-   If NO_IGNORE is non-zero, the item will be added regardless of
+   If NO_IGNORE is TRUE, the item will be added regardless of
    whether it is ignored; otherwise we will only add the item if it
-   does not match any of the patterns in PATTERNS.
+   does not match any of the patterns in PATTERN or INHERITED_IGNORES.
 
    Allocate everything in POOL.
 */
@@ -1059,22 +1099,26 @@ send_unversioned_item(const struct walk_
                       const svn_io_dirent2_t *dirent,
                       svn_boolean_t tree_conflicted,
                       const apr_array_header_t *patterns,
+                      const apr_array_header_t *inherited_patterns,
                       svn_boolean_t no_ignore,
                       svn_wc_status_func4_t status_func,
                       void *status_baton,
                       apr_pool_t *scratch_pool)
 {
   svn_boolean_t is_ignored;
+  svn_boolean_t is_mandatory_ignored;
   svn_boolean_t is_external;
   svn_wc_status3_t *status;
+  const char *base_name = svn_dirent_basename(local_abspath, NULL);
 
-  is_ignored = svn_wc_match_ignore_list(
-                 svn_dirent_basename(local_abspath, NULL),
-                 patterns, scratch_pool);
-
+  is_ignored = svn_wc_match_ignore_list(base_name, patterns, scratch_pool);
+  is_mandatory_ignored = svn_wc_match_ignore_list(base_name,
+                                                  inherited_patterns,
+                                                  scratch_pool);
   SVN_ERR(assemble_unversioned(&status,
                                wb->db, local_abspath,
-                               dirent, tree_conflicted, is_ignored,
+                               dirent, tree_conflicted,
+                               is_ignored || is_mandatory_ignored,
                                scratch_pool, scratch_pool));
 
   is_external = is_external_path(wb->externals, local_abspath, scratch_pool);
@@ -1089,7 +1133,9 @@ send_unversioned_item(const struct walk_
 
   /* If we aren't ignoring it, or if it's an externals path, pass this
      entry to the status func. */
-  if (no_ignore || (! is_ignored) || is_external)
+  if (no_ignore
+      || !(is_ignored || is_mandatory_ignored)
+      || is_external)
     return svn_error_trace((*status_func)(status_baton, local_abspath,
                                           status, scratch_pool));
 
@@ -1137,15 +1183,17 @@ get_dir_status(const struct walk_status_
  *
  * DIR_HAS_PROPS is a boolean indicating whether PARENT_ABSPATH has properties.
  *
- * If *COLLECTED_IGNORE_PATTERNS is NULL and ignore patterns are needed in
- * this call, *COLLECTED_IGNORE_PATTERNS will be set to an apr_array_header_t*
+ * If *COLLECTED_IGNORE_PATTERNS or COLLECTED_INHERITED_IGNORE_PATTERNS are 
NULL
+ * and ignore patterns are needed in this call, then *COLLECTED_IGNORE_PATTERNS
+ * *COLLECTED_INHERITED_IGNORE_PATTERNS will be set to an apr_array_header_t*
  * containing all ignore patterns, as returned by collect_ignore_patterns() on
- * PARENT_ABSPATH and IGNORE_PATTERNS. If *COLLECTED_IGNORE_PATTERNS is passed
- * non-NULL, it is assumed to already hold that result. This speeds up
- * repeated calls with the same PARENT_ABSPATH.
+ * PARENT_ABSPATH and IGNORE_PATTERNS. If *COLLECTED_IGNORE_PATTERNS and 
+ * COLLECTED_INHERITED_IGNORE_PATTERNS is passed non-NULL, it is assumed they
+ * already hold those results. This speeds up repeated calls with the same
+ * PARENT_ABSPATH.
  *
- * *COLLECTED_IGNORE_PATTERNS will be allocated in RESULT_POOL. All other
- * allocations are made in SCRATCH_POOL.
+ * *COLLECTED_IGNORE_PATTERNS and COLLECTED_INHERITED_IGNORE_PATTERNS will be
+ * allocated in RESULT_POOL. All other allocations are made in SCRATCH_POOL.
  *
  * The remaining parameters correspond to get_dir_status(). */
 static svn_error_t*
@@ -1160,6 +1208,7 @@ one_child_status(const struct walk_statu
                  svn_boolean_t dir_has_props,
                  svn_boolean_t unversioned_tree_conflicted,
                  apr_array_header_t **collected_ignore_patterns,
+                 apr_array_header_t **collected_inherited_ignore_patterns,
                  const apr_array_header_t *ignore_patterns,
                  svn_depth_t depth,
                  svn_boolean_t get_all,
@@ -1242,9 +1291,12 @@ one_child_status(const struct walk_statu
    * determined.  For example, in 'svn status', plain unversioned nodes show
    * as '?  C', where ignored ones show as 'I  C'. */
 
-  if (ignore_patterns && ! *collected_ignore_patterns)
-    SVN_ERR(collect_ignore_patterns(collected_ignore_patterns, wb->db,
-                                    parent_abspath, ignore_patterns,
+  if ((ignore_patterns && ! *collected_ignore_patterns)
+      || (collected_inherited_ignore_patterns
+          && ! collected_inherited_ignore_patterns))
+    SVN_ERR(collect_ignore_patterns(collected_ignore_patterns,
+                                    collected_inherited_ignore_patterns,
+                                    wb->db, parent_abspath, ignore_patterns,
                                     dir_has_props,
                                     result_pool, scratch_pool));
 
@@ -1253,6 +1305,7 @@ one_child_status(const struct walk_statu
                                 dirent,
                                 conflicted,
                                 *collected_ignore_patterns,
+                                *collected_inherited_ignore_patterns,
                                 no_ignore,
                                 status_func, status_baton,
                                 scratch_pool));
@@ -1306,6 +1359,7 @@ get_dir_status(const struct walk_status_
   apr_hash_t *dirents, *nodes, *conflicts, *all_children;
   apr_array_header_t *sorted_children;
   apr_array_header_t *collected_ignore_patterns = NULL;
+  apr_array_header_t *collected_inherited_ignore_patterns = NULL;
   apr_pool_t *iterpool, *subpool = svn_pool_create(scratch_pool);
   svn_error_t *err;
   int i;
@@ -1436,6 +1490,7 @@ get_dir_status(const struct walk_status_
                                dir_has_props,
                                apr_hash_get(conflicts, key, klen) != NULL,
                                &collected_ignore_patterns,
+                               &collected_inherited_ignore_patterns,
                                ignore_patterns,
                                depth,
                                get_all,
@@ -1485,6 +1540,7 @@ get_child_status(const struct walk_statu
   const char *dir_repos_uuid;
   const struct svn_wc__db_info_t *dir_info;
   apr_array_header_t *collected_ignore_patterns = NULL;
+  apr_array_header_t *collected_inherited_ignore_patterns = NULL;
   const svn_io_dirent2_t *dirent_p;
   const char *parent_abspath = svn_dirent_dirname(local_abspath,
                                                   scratch_pool);
@@ -1523,6 +1579,7 @@ get_child_status(const struct walk_statu
                            (dir_info->had_props || dir_info->props_mod),
                            FALSE, /* unversioned_tree_conflicted */
                            &collected_ignore_patterns,
+                           &collected_inherited_ignore_patterns,
                            ignore_patterns,
                            svn_depth_empty,
                            get_all,
@@ -2985,7 +3042,7 @@ svn_wc_get_ignores2(apr_array_header_t *
   apr_array_header_t *default_ignores;
 
   SVN_ERR(svn_wc_get_default_ignores(&default_ignores, config, scratch_pool));
-  return svn_error_trace(collect_ignore_patterns(patterns, wc_ctx->db,
+  return svn_error_trace(collect_ignore_patterns(patterns, NULL, wc_ctx->db,
                                                  local_abspath,
                                                  default_ignores, TRUE,
                                                  result_pool, scratch_pool));

Modified: 
subversion/branches/compressed-pristines/subversion/libsvn_wc/tree_conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/tree_conflicts.c?rev=1413258&r1=1413257&r2=1413258&view=diff
==============================================================================
--- 
subversion/branches/compressed-pristines/subversion/libsvn_wc/tree_conflicts.c 
(original)
+++ 
subversion/branches/compressed-pristines/subversion/libsvn_wc/tree_conflicts.c 
Sat Nov 24 20:29:11 2012
@@ -78,7 +78,6 @@ const svn_token_map_t svn_wc__conflict_r
   { "replaced",    svn_wc_conflict_reason_replaced },
   { "unversioned", svn_wc_conflict_reason_unversioned },
   { "moved-away", svn_wc_conflict_reason_moved_away },
-  { "moved-away-and-edited", svn_wc_conflict_reason_moved_away_and_edited },
   { "moved-here", svn_wc_conflict_reason_moved_here },
   { NULL }
 };
@@ -183,11 +182,12 @@ read_node_version_info(const svn_wc_conf
                           skel->children->next->next->next->next));
   kind = (svn_node_kind_t)n;
 
-  *version_info = svn_wc_conflict_version_create(repos_root,
-                                                 repos_relpath,
-                                                 peg_rev,
-                                                 kind,
-                                                 result_pool);
+  *version_info = svn_wc_conflict_version_create2(repos_root,
+                                                  NULL,
+                                                  repos_relpath,
+                                                  peg_rev,
+                                                  kind,
+                                                  result_pool);
 
   return SVN_NO_ERROR;
 }
@@ -473,7 +473,7 @@ svn_wc__get_tree_conflict(const svn_wc_c
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__read_conflicts(&conflicts,
-                                 wc_ctx->db, local_abspath,
+                                 wc_ctx->db, local_abspath, FALSE,
                                  scratch_pool, scratch_pool));
 
   if (!conflicts || conflicts->nelts == 0)

Modified: 
subversion/branches/compressed-pristines/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/update_editor.c?rev=1413258&r1=1413257&r2=1413258&view=diff
==============================================================================
--- 
subversion/branches/compressed-pristines/subversion/libsvn_wc/update_editor.c 
(original)
+++ 
subversion/branches/compressed-pristines/subversion/libsvn_wc/update_editor.c 
Sat Nov 24 20:29:11 2012
@@ -170,6 +170,12 @@ struct edit_baton
      generated conflict files. */
   const apr_array_header_t *ext_patterns;
 
+  /* Hash mapping const char * absolute working copy paths to depth-first
+     ordered arrays of svn_prop_inherited_item_t * structures representing
+     the properties inherited by the base node at that working copy path.
+     May be NULL. */
+  apr_hash_t *wcroot_iprops;
+
   /* The revision we're targeting...or something like that.  This
      starts off as a pointer to the revision to which we are updating,
      or SVN_INVALID_REVNUM, but by the end of the edit, should be
@@ -868,7 +874,7 @@ complete_conflict(svn_skel_t *conflict,
   SVN_ERR(svn_wc__conflict_skel_is_complete(&is_complete, conflict));
 
   if (is_complete)
-    return SVN_NO_ERROR; /* Already competed */
+    return SVN_NO_ERROR; /* Already completed */
 
   if (old_repos_relpath)
     src_left_version = svn_wc_conflict_version_create2(eb->repos_root,
@@ -1404,7 +1410,18 @@ check_tree_conflict(svn_skel_t **pconfli
 
 
       case svn_wc__db_status_deleted:
-        reason = svn_wc_conflict_reason_deleted;
+        {
+          const char *moved_to_abspath;
+
+          SVN_ERR(svn_wc__db_scan_deletion(NULL, &moved_to_abspath,
+                                           NULL, NULL, eb->db,
+                                           local_abspath,
+                                           scratch_pool, scratch_pool));
+          if (moved_to_abspath)
+            reason = svn_wc_conflict_reason_moved_away;
+          else
+            reason = svn_wc_conflict_reason_deleted;
+        }
         break;
 
       case svn_wc__db_status_incomplete:
@@ -1474,7 +1491,6 @@ check_tree_conflict(svn_skel_t **pconfli
   if (reason == svn_wc_conflict_reason_edited
       || reason == svn_wc_conflict_reason_deleted
       || reason == svn_wc_conflict_reason_moved_away
-      || reason == svn_wc_conflict_reason_moved_away_and_edited
       || reason == svn_wc_conflict_reason_replaced)
     /* When the node existed before (it was locally deleted, replaced or
      * edited), then 'update' cannot add it "again". So it can only send
@@ -1613,7 +1629,7 @@ delete_entry(const char *path,
     if (is_root)
       {
         /* Just skip this node; a future update will handle it */
-        remember_skipped_tree(eb, local_abspath, pool);
+        SVN_ERR(remember_skipped_tree(eb, local_abspath, pool));
         do_notification(eb, local_abspath, svn_node_unknown,
                         svn_wc_notify_update_skip_obstruction, scratch_pool);
 
@@ -1663,7 +1679,7 @@ delete_entry(const char *path,
 
 
 
-    /* Receive the remote removal of excluded/absent/not present node.
+    /* Receive the remote removal of excluded/server-excluded/not present node.
        Do not notify, but perform the change even when the node is shadowed */
   if (base_status == svn_wc__db_status_not_present
       || base_status == svn_wc__db_status_excluded
@@ -1730,7 +1746,6 @@ delete_entry(const char *path,
         }
       else if (reason == svn_wc_conflict_reason_deleted
                || reason == svn_wc_conflict_reason_moved_away
-               || reason == svn_wc_conflict_reason_moved_away_and_edited
                || reason == svn_wc_conflict_reason_replaced)
         {
           /* The item does not exist locally because it was already shadowed.
@@ -1903,7 +1918,7 @@ add_directory(const char *path,
                                                    NULL, NULL,
                                                    pool));
 
-      remember_skipped_tree(eb, db->local_abspath, pool);
+      SVN_ERR(remember_skipped_tree(eb, db->local_abspath, pool));
       db->skip_this = TRUE;
       db->already_notified = TRUE;
 
@@ -1927,7 +1942,7 @@ add_directory(const char *path,
          file externals.
       */
 
-      remember_skipped_tree(eb, db->local_abspath, pool);
+      SVN_ERR(remember_skipped_tree(eb, db->local_abspath, pool));
       db->skip_this = TRUE;
       db->already_notified = TRUE;
 
@@ -2185,7 +2200,7 @@ open_directory(const char *path,
     if (is_root)
       {
         /* Just skip this node; a future update will handle it */
-        remember_skipped_tree(eb, db->local_abspath, pool);
+        SVN_ERR(remember_skipped_tree(eb, db->local_abspath, pool));
         db->skip_this = TRUE;
         db->already_notified = TRUE;
 
@@ -2264,7 +2279,6 @@ open_directory(const char *path,
                                                   db->pool, db->pool));
       SVN_ERR_ASSERT(reason == svn_wc_conflict_reason_deleted
                      || reason == svn_wc_conflict_reason_moved_away
-                     || reason == svn_wc_conflict_reason_moved_away_and_edited
                      || reason == svn_wc_conflict_reason_replaced);
 
       /* Continue updating BASE */
@@ -2630,6 +2644,7 @@ close_directory(void *dir_baton,
   else
     {
       apr_hash_t *props;
+      apr_array_header_t *iprops = NULL;
 
       /* ### we know a base node already exists. it was created in
          ### open_directory or add_directory.  let's just preserve the
@@ -2689,6 +2704,22 @@ close_directory(void *dir_baton,
                                             scratch_pool);
         }
 
+      /* Any inherited props to be set set for this base node? */
+      if (eb->wcroot_iprops)
+        {
+          iprops = apr_hash_get(eb->wcroot_iprops, db->local_abspath,
+                                APR_HASH_KEY_STRING);
+
+          /* close_edit may also update iprops for switched nodes, catching
+             those for which close_directory is never called (e.g. a switch
+             with no changes).  So as a minor optimization we remove any
+             iprops from the hash so as not to set them again in
+             close_edit. */
+          if (iprops)
+            apr_hash_set(eb->wcroot_iprops, db->local_abspath,
+                         APR_HASH_KEY_STRING, NULL);
+        }
+
       /* Update the BASE data for the directory and mark the directory
          complete */
       SVN_ERR(svn_wc__db_base_add_directory(
@@ -2707,7 +2738,7 @@ close_directory(void *dir_baton,
                 conflict_skel,
                 (! db->shadowed) && new_base_props != NULL,
                 new_actual_props,
-                all_work_items,
+                iprops, all_work_items,
                 scratch_pool));
     }
 
@@ -2962,7 +2993,7 @@ add_file(const char *path,
       apr_hash_set(pb->not_present_files, apr_pstrdup(pb->pool, fb->name),
                    APR_HASH_KEY_STRING, (void*)1);
 
-      remember_skipped_tree(eb, fb->local_abspath, pool);
+      SVN_ERR(remember_skipped_tree(eb, fb->local_abspath, pool));
       fb->skip_this = TRUE;
       fb->already_notified = TRUE;
 
@@ -2987,7 +3018,7 @@ add_file(const char *path,
          The reason we get here is that the adm crawler doesn't report
          file externals.
       */
-      remember_skipped_tree(eb, fb->local_abspath, pool);
+      SVN_ERR(remember_skipped_tree(eb, fb->local_abspath, pool));
       fb->skip_this = TRUE;
       fb->already_notified = TRUE;
 
@@ -3232,7 +3263,7 @@ open_file(const char *path,
     if (is_root)
       {
         /* Just skip this node; a future update will handle it */
-        remember_skipped_tree(eb, fb->local_abspath, pool);
+        SVN_ERR(remember_skipped_tree(eb, fb->local_abspath, pool));
         fb->skip_this = TRUE;
         fb->already_notified = TRUE;
 
@@ -3309,7 +3340,6 @@ open_file(const char *path,
                                                   fb->pool, fb->pool));
       SVN_ERR_ASSERT(reason == svn_wc_conflict_reason_deleted
                      || reason == svn_wc_conflict_reason_moved_away
-                     || reason == svn_wc_conflict_reason_moved_away_and_edited
                      || reason == svn_wc_conflict_reason_replaced);
 
       /* Continue updating BASE */
@@ -4384,6 +4414,7 @@ close_edit(void *edit_baton,
                                                        eb->repos_uuid,
                                                        *(eb->target_revision),
                                                        eb->skipped_trees,
+                                                       eb->wcroot_iprops,
                                                        eb->pool));
 
       if (*eb->target_basename != '\0')
@@ -4457,6 +4488,7 @@ make_editor(svn_revnum_t *target_revisio
             svn_wc__db_t *db,
             const char *anchor_abspath,
             const char *target_basename,
+            apr_hash_t *wcroot_iprops,
             svn_boolean_t use_commit_times,
             const char *switch_url,
             svn_depth_t depth,
@@ -4522,6 +4554,7 @@ make_editor(svn_revnum_t *target_revisio
   eb->db                       = db;
   eb->target_basename          = target_basename;
   eb->anchor_abspath           = anchor_abspath;
+  eb->wcroot_iprops            = wcroot_iprops;
 
   SVN_ERR(svn_wc__db_get_wcroot(&eb->wcroot_abspath, db, anchor_abspath,
                                 edit_pool, scratch_pool));
@@ -4743,6 +4776,7 @@ svn_wc__get_update_editor(const svn_delt
                           svn_wc_context_t *wc_ctx,
                           const char *anchor_abspath,
                           const char *target_basename,
+                          apr_hash_t *wcroot_iprops,
                           svn_boolean_t use_commit_times,
                           svn_depth_t depth,
                           svn_boolean_t depth_is_sticky,
@@ -4766,7 +4800,7 @@ svn_wc__get_update_editor(const svn_delt
                           apr_pool_t *scratch_pool)
 {
   return make_editor(target_revision, wc_ctx->db, anchor_abspath,
-                     target_basename, use_commit_times,
+                     target_basename, wcroot_iprops, use_commit_times,
                      NULL, depth, depth_is_sticky, allow_unver_obstructions,
                      adds_as_modification, server_performs_filtering,
                      clean_checkout,
@@ -4787,6 +4821,7 @@ svn_wc__get_switch_editor(const svn_delt
                           const char *anchor_abspath,
                           const char *target_basename,
                           const char *switch_url,
+                          apr_hash_t *wcroot_iprops,
                           svn_boolean_t use_commit_times,
                           svn_depth_t depth,
                           svn_boolean_t depth_is_sticky,
@@ -4810,7 +4845,7 @@ svn_wc__get_switch_editor(const svn_delt
   SVN_ERR_ASSERT(switch_url && svn_uri_is_canonical(switch_url, scratch_pool));
 
   return make_editor(target_revision, wc_ctx->db, anchor_abspath,
-                     target_basename, use_commit_times,
+                     target_basename, wcroot_iprops, use_commit_times,
                      switch_url,
                      depth, depth_is_sticky, allow_unver_obstructions,
                      FALSE /* adds_as_modification */,
@@ -5042,10 +5077,10 @@ svn_wc__check_wc_root(svn_boolean_t *wc_
 }
 
 svn_error_t *
-svn_wc_is_wc_root2(svn_boolean_t *wc_root,
-                   svn_wc_context_t *wc_ctx,
-                   const char *local_abspath,
-                   apr_pool_t *scratch_pool)
+svn_wc__internal_is_wc_root(svn_boolean_t *wc_root,
+                            svn_wc__db_t *db,
+                            const char *local_abspath,
+                            apr_pool_t *scratch_pool)
 {
   svn_boolean_t is_root;
   svn_boolean_t is_switched;
@@ -5054,7 +5089,7 @@ svn_wc_is_wc_root2(svn_boolean_t *wc_roo
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   err = svn_wc__check_wc_root(&is_root, &kind, &is_switched,
-                              wc_ctx->db, local_abspath, scratch_pool);
+                              db, local_abspath, scratch_pool);
 
   if (err)
     {
@@ -5065,11 +5100,21 @@ svn_wc_is_wc_root2(svn_boolean_t *wc_roo
       return svn_error_create(SVN_ERR_ENTRY_NOT_FOUND, err, err->message);
     }
 
-  *wc_root = is_root || (kind == svn_kind_dir && is_switched);
+  *wc_root = is_root || is_switched;
 
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_wc_is_wc_root2(svn_boolean_t *wc_root,
+                   svn_wc_context_t *wc_ctx,
+                   const char *local_abspath,
+                   apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(svn_wc__internal_is_wc_root(wc_root, wc_ctx->db,
+                                                     local_abspath,
+                                                     scratch_pool));
+}
 
 svn_error_t*
 svn_wc__strictly_is_wc_root(svn_boolean_t *wc_root,

Modified: 
subversion/branches/compressed-pristines/subversion/libsvn_wc/upgrade.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/upgrade.c?rev=1413258&r1=1413257&r2=1413258&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_wc/upgrade.c 
(original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_wc/upgrade.c Sat 
Nov 24 20:29:11 2012
@@ -1380,7 +1380,11 @@ svn_wc__upgrade_conflict_skel_from_raw(s
                                        apr_pool_t *scratch_pool)
 {
   svn_skel_t *conflict_data = NULL;
-  
+  const char *wcroot_abspath;
+
+  SVN_ERR(svn_wc__db_get_wcroot(&wcroot_abspath, db, wri_abspath,
+                                scratch_pool, scratch_pool));
+
   if (conflict_old || conflict_new || conflict_wrk)
     {
       const char *old_abspath = NULL;
@@ -1390,19 +1394,16 @@ svn_wc__upgrade_conflict_skel_from_raw(s
       conflict_data = svn_wc__conflict_skel_create(result_pool);
 
       if (conflict_old)
-        SVN_ERR(svn_wc__db_from_relpath(&old_abspath, db, wri_abspath,
-                                        conflict_old,
-                                        scratch_pool, scratch_pool));
+        old_abspath = svn_dirent_join(wcroot_abspath, conflict_old,
+                                      scratch_pool);
 
       if (conflict_new)
-        SVN_ERR(svn_wc__db_from_relpath(&new_abspath, db, wri_abspath,
-                                        conflict_new,
-                                        scratch_pool, scratch_pool));
+        new_abspath = svn_dirent_join(wcroot_abspath, conflict_new,
+                                      scratch_pool);
 
       if (conflict_wrk)
-        SVN_ERR(svn_wc__db_from_relpath(&wrk_abspath, db, wri_abspath,
-                                        conflict_wrk,
-                                        scratch_pool, scratch_pool));
+        wrk_abspath = svn_dirent_join(wcroot_abspath, conflict_wrk,
+                                      scratch_pool);
 
       SVN_ERR(svn_wc__conflict_skel_add_text_conflict(conflict_data,
                                                       db, wri_abspath,
@@ -1420,9 +1421,7 @@ svn_wc__upgrade_conflict_skel_from_raw(s
       if (!conflict_data)
         conflict_data = svn_wc__conflict_skel_create(result_pool);
 
-      SVN_ERR(svn_wc__db_from_relpath(&prej_abspath, db, wri_abspath,
-                                      prej_file,
-                                      scratch_pool, scratch_pool));
+      prej_abspath = svn_dirent_join(wcroot_abspath, prej_file, scratch_pool);
 
       SVN_ERR(svn_wc__conflict_skel_add_prop_conflict(conflict_data,
                                                       db, wri_abspath,
@@ -1445,9 +1444,8 @@ svn_wc__upgrade_conflict_skel_from_raw(s
       tc_skel = svn_skel__parse(tree_conflict_data, tree_conflict_len,
                                 scratch_pool);
 
-      SVN_ERR(svn_wc__db_from_relpath(&local_abspath, db, wri_abspath,
-                                      local_relpath,
-                                      scratch_pool, scratch_pool));
+      local_abspath = svn_dirent_join(wcroot_abspath, local_relpath,
+                                      scratch_pool);
 
       SVN_ERR(svn_wc__deserialize_conflict(&tc, tc_skel,
                                            svn_dirent_dirname(local_abspath,
@@ -1561,6 +1559,47 @@ bump_to_30(void *baton, svn_sqlite__db_t
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+bump_to_31(void *baton,
+           svn_sqlite__db_t *sdb,
+           apr_pool_t *scratch_pool)
+{
+  svn_sqlite__stmt_t *stmt, *stmt_mark_switch_roots;
+  svn_boolean_t have_row;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  apr_array_header_t *empty_iprops = apr_array_make(
+    scratch_pool, 0, sizeof(svn_prop_inherited_item_t *));
+
+  /* Add the inherited_props column to NODES. */
+  SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_31));
+
+  /* Set inherited_props to an empty array for the roots of all
+     switched subtrees in the WC.  This allows subsequent updates
+     to recognize these roots as needing an iprops cache. */
+  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+                                    STMT_UPGRADE_31_SELECT_WCROOT_NODES));
+  SVN_ERR(svn_sqlite__step(&have_row, stmt));
+
+  SVN_ERR(svn_sqlite__get_statement(&stmt_mark_switch_roots, sdb,
+                                    STMT_UPDATE_IPROP));
+  while (have_row)
+    {
+      const char *switched_relpath = svn_sqlite__column_text(stmt, 1, NULL);
+      apr_int64_t wc_id = svn_sqlite__column_int64(stmt, 0);
+
+      SVN_ERR(svn_sqlite__bindf(stmt_mark_switch_roots, "is", wc_id,
+                                switched_relpath));
+      SVN_ERR(svn_sqlite__bind_iprops(stmt_mark_switch_roots, 3,
+                                      empty_iprops, iterpool));
+      SVN_ERR(svn_sqlite__step_done(stmt_mark_switch_roots));
+      SVN_ERR(svn_sqlite__step(&have_row, stmt));
+    }
+
+  SVN_ERR(svn_sqlite__reset(stmt));
+  svn_pool_destroy(iterpool);
+  return SVN_NO_ERROR;
+}
+
 
 struct upgrade_data_t {
   svn_sqlite__db_t *sdb;
@@ -1835,13 +1874,16 @@ svn_wc__upgrade_sdb(int *result_format,
         *result_format = 29;
         /* FALLTHROUGH  */
 
-#if SVN_WC__VERSION >= 30
       case 29:
         SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_30, &bb,
                                              scratch_pool));
         *result_format = 30;
+
+      case 30:
+        SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_31, &bb,
+                                             scratch_pool));
+        *result_format = 31;
         /* FALLTHROUGH  */
-#endif
       /* ### future bumps go here.  */
 #if 0
       case XXX-1:
@@ -1851,6 +1893,9 @@ svn_wc__upgrade_sdb(int *result_format,
         *result_format = XXX;
         /* FALLTHROUGH  */
 #endif
+      case SVN_WC__VERSION:
+        /* already upgraded */
+        *result_format = SVN_WC__VERSION;
     }
 
 #ifdef SVN_DEBUG
@@ -1978,7 +2023,7 @@ is_old_wcroot(const char *local_abspath,
     {
       return svn_error_createf(
         SVN_ERR_WC_INVALID_OP_ON_CWD, err,
-        _("Can't upgrade '%s' as it is not a pre-1.7 working copy directory"),
+        _("Can't upgrade '%s' as it is not a working copy"),
         svn_dirent_local_style(local_abspath, scratch_pool));
     }
   else if (svn_dirent_is_root(local_abspath, strlen(local_abspath)))
@@ -2027,7 +2072,7 @@ is_old_wcroot(const char *local_abspath,
 
   return svn_error_createf(
     SVN_ERR_WC_INVALID_OP_ON_CWD, NULL,
-    _("Can't upgrade '%s' as it is not a pre-1.7 working copy root,"
+    _("Can't upgrade '%s' as it is not a working copy root,"
       " the root is '%s'"),
     svn_dirent_local_style(local_abspath, scratch_pool),
     svn_dirent_local_style(parent_abspath, scratch_pool));
@@ -2087,6 +2132,34 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
   apr_hash_t *entries;
   const char *root_adm_abspath;
   upgrade_working_copy_baton_t cb_baton;
+  svn_error_t *err;
+  int result_format;
+
+  /* Try upgrading a wc-ng-style working copy. */
+  SVN_ERR(svn_wc__db_open(&db, NULL /* ### config */, TRUE, FALSE,
+                          scratch_pool, scratch_pool));
+
+  err = svn_wc__db_bump_format(&result_format, local_abspath, db,
+                               scratch_pool);
+  if (err)
+    {
+      if (err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED) /* pre-1.7 WC */
+        {
+          svn_error_clear(err);
+          SVN_ERR(svn_wc__db_close(db));
+        }
+      else
+        return svn_error_trace(err);
+    }
+  else
+    {
+      /* Auto-upgrade worked! */
+      SVN_ERR(svn_wc__db_close(db));
+
+      SVN_ERR_ASSERT(result_format == SVN_WC__VERSION);
+
+      return SVN_NO_ERROR;
+    }
 
   SVN_ERR(is_old_wcroot(local_abspath, scratch_pool));
 
@@ -2100,7 +2173,7 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
      upgrade. */
 
   SVN_ERR(svn_wc__db_open(&db,
-                          NULL /* ### config */, FALSE, FALSE,
+                          NULL /* ### config */, TRUE, FALSE,
                           scratch_pool, scratch_pool));
 
   SVN_ERR(svn_wc__read_entries_old(&entries, local_abspath,

Modified: subversion/branches/compressed-pristines/subversion/libsvn_wc/util.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/util.c?rev=1413258&r1=1413257&r2=1413258&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_wc/util.c 
(original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_wc/util.c Sat 
Nov 24 20:29:11 2012
@@ -469,7 +469,7 @@ svn_wc__status2_from_3(svn_wc_status2_t 
   /* (Currently a no-op, but just make sure it is ok) */
   if (old_status->repos_node_status == svn_wc_status_modified
       || old_status->repos_node_status == svn_wc_status_conflicted)
-    (*status)->text_status = old_status->repos_text_status;
+    (*status)->repos_text_status = old_status->repos_text_status;
 
   if (old_status->node_status == svn_wc_status_added)
     (*status)->prop_status = svn_wc_status_none; /* No separate info */

Modified: 
subversion/branches/compressed-pristines/subversion/libsvn_wc/wc-metadata.sql
URL: 
http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/wc-metadata.sql?rev=1413258&r1=1413257&r2=1413258&view=diff
==============================================================================
--- 
subversion/branches/compressed-pristines/subversion/libsvn_wc/wc-metadata.sql 
(original)
+++ 
subversion/branches/compressed-pristines/subversion/libsvn_wc/wc-metadata.sql 
Sat Nov 24 20:29:11 2012
@@ -32,7 +32,7 @@
  * the PRESENCE column in these tables has one of the following values
  * (see also the C type #svn_wc__db_status_t):
  *   "normal"
- *   "absent" -- server has declared it "absent" (ie. authz failure)
+ *   "server-excluded" -- server has declared it excluded (ie. authz failure)
  *   "excluded" -- administratively excluded (ie. sparse WC)
  *   "not-present" -- node not present at this REV
  *   "incomplete" -- state hasn't been filled in
@@ -367,7 +367,7 @@ CREATE TABLE NODES (
        current 'op_depth'.  This state is badly named, it should be
        something like 'deleted'.
 
-     absent: in the 'BASE' tree this is a node that is excluded by
+     server-excluded: in the 'BASE' tree this is a node that is excluded by
        authz.  The name of the node is known from the parent, but no
        other information is available.  Not valid in the 'WORKING'
        tree as there is no way to commit such a node.
@@ -475,6 +475,10 @@ CREATE TABLE NODES (
      ### anyway. */
   file_external  INTEGER,
 
+  /* serialized skel of this node's inherited properties. NULL if this
+     is not the BASE of a WC root node. */
+  inherited_props  BLOB,
+
   PRIMARY KEY (wc_id, local_relpath, op_depth)
 
   );
@@ -575,6 +579,8 @@ CREATE UNIQUE INDEX I_EXTERNALS_DEFINED 
                                                       def_local_relpath,
                                                       local_relpath);
 
+/* ------------------------------------------------------------------------- */
+
 /* Format 20 introduces NODES and removes BASE_NODE and WORKING_NODE */
 
 -- STMT_UPGRADE_TO_20
@@ -773,20 +779,22 @@ PRAGMA user_version = 29;
 
 /* ------------------------------------------------------------------------- */
 
-/* Format 30 currently just contains some nice to haves that should be included
-   with the next format bump  */
+/* Format 30 creates a new NODES index for move information, and a new
+   PRISTINE index for the md5_checksum column. It also activates use of
+   skel-based conflict storage -- see notes/wc-ng/conflict-storage-2.0.
+   It also renames the "absent" presence to "server-excluded". */
 -- STMT_UPGRADE_TO_30
 CREATE UNIQUE INDEX IF NOT EXISTS I_NODES_MOVED
 ON NODES (wc_id, moved_to, op_depth);
 
 CREATE INDEX IF NOT EXISTS I_PRISTINE_MD5 ON PRISTINE (md5_checksum);
 
+UPDATE nodes SET presence = "server-excluded" WHERE presence = "absent";
+
 /* Just to be sure clear out file external skels from pre 1.7.0 development
    working copies that were never updated by 1.7.0+ style clients */
 UPDATE nodes SET file_external=1 WHERE file_external IS NOT NULL;
 
-PRAGMA user_version = 30;
-
 -- STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE
 SELECT wc_id, local_relpath,
   conflict_old, conflict_working, conflict_new, prop_reject, tree_conflict_data
@@ -806,6 +814,38 @@ WHERE wc_id = ?1 and local_relpath = ?2
 
 /* ------------------------------------------------------------------------- */
 
+/* Format 31 adds the inherited_props column to the NODES table. C code then
+   initializes the update/switch roots to make sure future updates fetch the
+   inherited properties */
+-- STMT_UPGRADE_TO_31
+ALTER TABLE NODES ADD COLUMN inherited_props BLOB;
+
+PRAGMA user_version = 31;
+
+-- STMT_UPGRADE_31_SELECT_WCROOT_NODES
+/* Select all base nodes which are the root of a WC, including
+   switched subtrees, but excluding those which map to the root
+   of the repos.
+
+   ### IPROPS: Is this query horribly inefficient?  Quite likely,
+   ### but it only runs during an upgrade, so do we care? */
+SELECT l.wc_id, l.local_relpath FROM nodes as l
+LEFT OUTER JOIN nodes as r
+ON l.wc_id = r.wc_id
+   AND l.repos_id = r.repos_id
+   AND r.local_relpath = l.parent_relpath
+WHERE (l.local_relpath = '' AND l.repos_path != '')
+   OR (l.op_depth = 0
+       AND l.local_relpath != ''
+       AND l.repos_path != ltrim(r.repos_path
+                                 || '/'
+                                 || ltrim(substr(l.local_relpath,
+                                                 length(l.parent_relpath) + 1),
+                                          '/'),
+                                 '/'))
+
+/* ------------------------------------------------------------------------- */
+
 /* Format YYY introduces new handling for conflict information.  */
 -- format: YYY
 
@@ -818,9 +858,6 @@ WHERE wc_id = ?1 and local_relpath = ?2
    number will be, however, so we're just marking it as 99 for now.  */
 -- format: 99
 
-/* TODO: Rename the "absent" presence value to "server-excluded". wc_db.c
-   and this file have references to "absent" which still need to be changed
-   to "server-excluded". */
 /* TODO: Un-confuse *_revision column names in the EXTERNALS table to
    "-r<operative> foo@<peg>", as suggested by the patch attached to
    http://svn.haxx.se/dev/archive-2011-09/0478.shtml */

Modified: 
subversion/branches/compressed-pristines/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/wc-queries.sql?rev=1413258&r1=1413257&r2=1413258&view=diff
==============================================================================
--- 
subversion/branches/compressed-pristines/subversion/libsvn_wc/wc-queries.sql 
(original)
+++ 
subversion/branches/compressed-pristines/subversion/libsvn_wc/wc-queries.sql 
Sat Nov 24 20:29:11 2012
@@ -102,8 +102,7 @@ ORDER BY op_depth
 LIMIT 1
 
 -- STMT_SELECT_ACTUAL_NODE
-SELECT changelist, properties, conflict_data,
-conflict_old, conflict_new, conflict_working, prop_reject, tree_conflict_data
+SELECT changelist, properties, conflict_data
 FROM actual_node
 WHERE wc_id = ?1 AND local_relpath = ?2
 
@@ -127,8 +126,7 @@ FROM nodes_current
 WHERE wc_id = ?1 AND parent_relpath = ?2
 
 -- STMT_SELECT_ACTUAL_CHILDREN_INFO
-SELECT local_relpath, changelist, properties, conflict_data,
-conflict_old, conflict_new, conflict_working, prop_reject, tree_conflict_data
+SELECT local_relpath, changelist, properties, conflict_data
 FROM actual_node
 WHERE wc_id = ?1 AND parent_relpath = ?2
 
@@ -149,9 +147,10 @@ INSERT OR REPLACE INTO nodes (
   wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
   revision, presence, depth, kind, changed_revision, changed_date,
   changed_author, checksum, properties, translated_size, last_mod_time,
-  dav_cache, symlink_target, file_external, moved_to, moved_here)
+  dav_cache, symlink_target, file_external, moved_to, moved_here,
+  inherited_props)
 VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
-        ?15, ?16, ?17, ?18, ?19, ?20, ?21, ?22)
+        ?15, ?16, ?17, ?18, ?19, ?20, ?21, ?22, ?23)
 
 -- STMT_SELECT_BASE_PRESENT
 SELECT local_relpath, kind FROM nodes n
@@ -246,7 +245,7 @@ WHERE wc_id = ?1
 SELECT local_relpath FROM nodes
 WHERE wc_id = ?1 AND op_depth = ?3
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND presence == 'not-present'
+  AND presence = 'not-present'
 
 -- STMT_COMMIT_DESCENDANT_TO_BASE
 UPDATE NODES SET op_depth = 0, repos_id = ?4, repos_path = ?5, revision = ?6,
@@ -413,16 +412,11 @@ UPDATE nodes SET translated_size = ?3, l
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?5
 
 -- STMT_INSERT_ACTUAL_CONFLICT
-INSERT INTO actual_node (
-  wc_id, local_relpath, conflict_data,
-  conflict_old, conflict_new, conflict_working, prop_reject,
-  tree_conflict_data, parent_relpath)
-VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9)
+INSERT INTO actual_node (wc_id, local_relpath, conflict_data, parent_relpath)
+VALUES (?1, ?2, ?3, ?4)
 
 -- STMT_UPDATE_ACTUAL_CONFLICT
-UPDATE actual_node SET conflict_data = ?3,
-  conflict_old = ?4, conflict_new = ?5, conflict_working = ?6,
-  prop_reject = ?7, tree_conflict_data = ?8
+UPDATE actual_node SET conflict_data = ?3
 WHERE wc_id = ?1 AND local_relpath = ?2
 
 -- STMT_UPDATE_ACTUAL_CHANGELISTS
@@ -593,10 +587,6 @@ DELETE FROM actual_node
 WHERE wc_id = ?1 AND local_relpath = ?2
   AND properties IS NULL
   AND conflict_data IS NULL
-  AND conflict_old IS NULL
-  AND conflict_new IS NULL
-  AND prop_reject IS NULL
-  AND tree_conflict_data IS NULL
   AND changelist IS NULL
   AND text_mod IS NULL
   AND older_checksum IS NULL
@@ -609,10 +599,6 @@ WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND properties IS NULL
   AND conflict_data IS NULL
-  AND conflict_old IS NULL
-  AND conflict_new IS NULL
-  AND prop_reject IS NULL
-  AND tree_conflict_data IS NULL
   AND changelist IS NULL
   AND text_mod IS NULL
   AND older_checksum IS NULL
@@ -683,10 +669,6 @@ UPDATE actual_node
 SET properties = NULL,
     text_mod = NULL,
     conflict_data = NULL,
-    conflict_old = NULL,
-    conflict_new = NULL,
-    conflict_working = NULL,
-    prop_reject = NULL,
     tree_conflict_data = NULL,
     older_checksum = NULL,
     left_checksum = NULL,
@@ -698,10 +680,6 @@ UPDATE actual_node
 SET properties = NULL,
     text_mod = NULL,
     conflict_data = NULL,
-    conflict_old = NULL,
-    conflict_new = NULL,
-    conflict_working = NULL,
-    prop_reject = NULL,
     tree_conflict_data = NULL,
     older_checksum = NULL,
     left_checksum = NULL,
@@ -771,38 +749,7 @@ WHERE checksum = ?1 AND refcount = 0
 SELECT local_relpath, conflict_data
 FROM actual_node
 WHERE wc_id = ?1 AND parent_relpath = ?2 AND
-  NOT ((conflict_data IS NULL) AND (conflict_old IS NULL)
-       AND (conflict_new IS NULL) AND (conflict_working IS NULL)
-       AND (prop_reject IS NULL) AND (tree_conflict_data IS NULL))
-
--- STMT_SELECT_CONFLICT_MARKER_FILES1
-SELECT prop_reject
-FROM actual_node
-WHERE wc_id = ?1 AND local_relpath = ?2
-  AND (prop_reject IS NOT NULL)
-
--- STMT_SELECT_CONFLICT_MARKER_FILES2
-SELECT prop_reject, conflict_old, conflict_new, conflict_working
-FROM actual_node
-WHERE wc_id = ?1 AND parent_relpath = ?2
-  AND ((prop_reject IS NOT NULL) OR (conflict_old IS NOT NULL)
-       OR (conflict_new IS NOT NULL) OR (conflict_working IS NOT NULL))
-
--- STMT_CLEAR_TEXT_CONFLICT
-UPDATE actual_node SET
-  conflict_old = NULL,
-  conflict_new = NULL,
-  conflict_working = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2
-
--- STMT_CLEAR_PROPS_CONFLICT
-UPDATE actual_node SET
-  prop_reject = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2
-
--- STMT_CLEAR_TREE_CONFLICT
-UPDATE actual_node SET tree_conflict_data = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2
+  NOT (conflict_data IS NULL)
 
 -- STMT_INSERT_WC_LOCK
 INSERT INTO wc_lock (wc_id, local_dir_relpath, locked_levels)
@@ -879,7 +826,7 @@ WHERE wc_id = ?1
   AND (local_relpath = ?2
        OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
   AND op_depth = ?3
-  AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 'absent')
+  AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 
'server-excluded')
 
 -- STMT_INSERT_WORKING_NODE_FROM_BASE_COPY
 INSERT INTO nodes (
@@ -917,7 +864,7 @@ LIMIT 1
 SELECT local_relpath FROM nodes
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND op_depth = 0 AND presence = 'absent'
+  AND op_depth = 0 AND presence = 'server-excluded'
 LIMIT 1
 
 /* Select all excluded nodes. Not valid on the WC-root */
@@ -926,7 +873,7 @@ SELECT local_relpath FROM nodes
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND op_depth = 0
-  AND (presence = 'absent' OR presence = 'excluded')
+  AND (presence = 'server-excluded' OR presence = 'excluded')
 
 /* Creates a copy from one top level NODE to a different location */
 -- STMT_INSERT_WORKING_NODE_COPY_FROM
@@ -1093,15 +1040,17 @@ FROM nodes_current n
 WHERE (wc_id = ?1 AND local_relpath = ?2)
    OR (wc_id = ?1 AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
 
+-- STMT_PRAGMA_LOCKING_MODE
+PRAGMA locking_mode = exclusive
+
 /* ------------------------------------------------------------------------- */
 
 /* these are used in entries.c  */
 
 -- STMT_INSERT_ACTUAL_NODE
 INSERT OR REPLACE INTO actual_node (
-  wc_id, local_relpath, parent_relpath, properties, changelist, conflict_data,
-  conflict_old, conflict_new, conflict_working, prop_reject, 
tree_conflict_data)
-VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11)
+  wc_id, local_relpath, parent_relpath, properties, changelist, conflict_data)
+VALUES (?1, ?2, ?3, ?4, ?5, ?6)
 
 /* ------------------------------------------------------------------------- */
 
@@ -1112,8 +1061,7 @@ UPDATE actual_node SET conflict_data = ?
 WHERE wc_id = ?1 AND local_relpath = ?2
 
 -- STMT_INSERT_ACTUAL_CONFLICT_DATA
-INSERT INTO actual_node (
-  wc_id, local_relpath, conflict_data, parent_relpath)
+INSERT INTO actual_node (wc_id, local_relpath, conflict_data, parent_relpath)
 VALUES (?1, ?2, ?3, ?4)
 
 -- STMT_SELECT_ALL_FILES
@@ -1191,10 +1139,6 @@ CREATE TEMPORARY TABLE revert_list (
    local_relpath TEXT NOT NULL,
    actual INTEGER NOT NULL,         /* 1 if an actual row, 0 if a nodes row */
    conflict_data BLOB,
-   conflict_old TEXT,
-   conflict_new TEXT,
-   conflict_working TEXT,
-   prop_reject TEXT,
    notify INTEGER,         /* 1 if an actual row had props or tree conflict */
    op_depth INTEGER,
    repos_id INTEGER,
@@ -1214,11 +1158,8 @@ CREATE TEMPORARY TRIGGER trigger_revert_
 BEFORE DELETE ON actual_node
 BEGIN
    INSERT OR REPLACE INTO revert_list(local_relpath, actual, conflict_data,
-                                      conflict_old, conflict_new,
-                                      conflict_working, prop_reject, notify)
+                                      notify)
    SELECT OLD.local_relpath, 1, OLD.conflict_data,
-          OLD.conflict_old, OLD.conflict_new, OLD.conflict_working,
-          OLD.prop_reject,
           CASE
             WHEN OLD.properties IS NOT NULL
             THEN 1
@@ -1234,11 +1175,8 @@ CREATE TEMPORARY TRIGGER trigger_revert_
 BEFORE UPDATE ON actual_node
 BEGIN
    INSERT OR REPLACE INTO revert_list(local_relpath, actual, conflict_data,
-                                      conflict_old, conflict_new,
-                                      conflict_working, prop_reject, notify)
+                                      notify)
    SELECT OLD.local_relpath, 1, OLD.conflict_data,
-          OLD.conflict_old, OLD.conflict_new, OLD.conflict_working,
-          OLD.prop_reject,
           CASE
             WHEN OLD.properties IS NOT NULL
             THEN 1
@@ -1256,8 +1194,7 @@ DROP TRIGGER trigger_revert_list_actual_
 DROP TRIGGER trigger_revert_list_actual_update
 
 -- STMT_SELECT_REVERT_LIST
-SELECT actual, notify, kind, op_depth, repos_id, conflict_data,
-       conflict_old, conflict_new, conflict_working, prop_reject
+SELECT actual, notify, kind, op_depth, repos_id, conflict_data
 FROM revert_list
 WHERE local_relpath = ?1
 ORDER BY actual DESC
@@ -1309,7 +1246,7 @@ WHERE wc_id = ?1
   AND op_depth = (SELECT MAX(s.op_depth) FROM nodes AS s
                   WHERE s.wc_id = ?1
                     AND s.local_relpath = n.local_relpath)
-  AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 'absent')
+  AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 
'server-excluded')
 
 -- STMT_SELECT_DELETE_LIST
 SELECT local_relpath FROM delete_list
@@ -1339,7 +1276,7 @@ WHERE wc_id = ?1
   AND (local_relpath = ?2
        OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
   AND op_depth = 0
-  AND (presence IN ('absent', 'excluded')
+  AND (presence IN ('server-excluded', 'excluded')
         OR depth NOT IN ('infinity', 'unknown'))
   AND file_external IS NULL
 LIMIT 1
@@ -1487,7 +1424,41 @@ WHERE wc_id = ?1
 
 -- STMT_SELECT_ALL_NODES
 SELECT op_depth, local_relpath, parent_relpath, file_external FROM nodes
-WHERE wc_id == ?1
+WHERE wc_id = ?1
+
+/* ------------------------------------------------------------------------- */
+
+/* Queries for cached inherited properties. */
+
+/* Select the inherited properties of a single base node. */
+-- STMT_SELECT_IPROPS
+SELECT inherited_props FROM nodes
+WHERE wc_id = ?1
+  AND local_relpath = ?2
+  AND op_depth = 0
+
+/* Update the inherited properties of a single base node. */
+-- STMT_UPDATE_IPROP
+UPDATE nodes
+SET inherited_props = ?3
+WHERE (wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0)
+
+/* Select a single path if its base node has cached inherited properties. */
+-- STMT_SELECT_INODES
+SELECT local_relpath FROM nodes
+WHERE wc_id = ?1
+  AND local_relpath = ?2
+  AND op_depth = 0
+  AND (inherited_props not null)
+
+/* Select all paths whose base nodes at or below a given path, which
+   have cached inherited properties. */
+-- STMT_SELECT_INODES_RECURSIVE
+SELECT local_relpath FROM nodes
+WHERE wc_id = ?1
+  AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
+  AND op_depth = 0
+  AND (inherited_props not null)
 
 /* ------------------------------------------------------------------------- */
 

Modified: subversion/branches/compressed-pristines/subversion/libsvn_wc/wc.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/wc.h?rev=1413258&r1=1413257&r2=1413258&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_wc/wc.h 
(original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_wc/wc.h Sat Nov 
24 20:29:11 2012
@@ -152,12 +152,15 @@ extern "C" {
  * == 1.7.x shipped with format 29
  *
  * The bump to 30 switched the conflict storage to a skel inside conflict_data.
- * Also clears some known invalid state.
+ * Also clears some known invalid state. Bumped in r1387742.
+ *
+ * The bump to 31 added the inherited_props column in the NODES table.
+ * Bumped in r1395109.
  *
  * Please document any further format changes here.
  */
 
-#define SVN_WC__VERSION 29
+#define SVN_WC__VERSION 31
 
 
 /* Formats <= this have no concept of "revert text-base/props".  */
@@ -185,9 +188,6 @@ extern "C" {
 /* A version < this has no work queue (see workqueue.h).  */
 #define SVN_WC__HAS_WORK_QUEUE 13
 
-/* The first version that uses conflict skels for all conflicts */
-#define SVN_WC__USES_CONFLICT_SKELS 30
-
 /* Return true iff error E indicates an "is not a working copy" type
    of error, either because something wasn't a working copy at all, or
    because it's a working copy from a previous version (in need of
@@ -640,6 +640,31 @@ svn_wc__internal_get_repos_info(const ch
                                 apr_pool_t *result_pool,
                                 apr_pool_t *scratch_pool);
 
+/* Internal version of svn_wc__node_get_repos_relpath() */
+svn_error_t *
+svn_wc__internal_get_repos_relpath(const char **repos_relpath,
+                                   svn_wc__db_t *db,
+                                   const char *local_abspath,
+                                   apr_pool_t *result_pool,
+                                   apr_pool_t *scratch_pool);
+
+/* Internal version of svn_wc__get_iprops() */
+svn_error_t *
+svn_wc__internal_get_iprops(apr_array_header_t **inherited_props,
+                            svn_wc__db_t *db,
+                            const char *local_abspath,
+                            const char *propname,
+                            apr_pool_t *result_pool,
+                            apr_pool_t *scratch_pool);
+
+/* Internal version of svn_wc_is_wc_root2() */
+svn_error_t *
+svn_wc__internal_is_wc_root(svn_boolean_t *wc_root,
+                            svn_wc__db_t *db,
+                            const char *local_abspath,
+                            apr_pool_t *scratch_pool);
+
+
 /* Upgrade the wc sqlite database given in SDB for the wc located at
    WCROOT_ABSPATH. It's current/starting format is given by START_FORMAT.
    After the upgrade is complete (to as far as the automatic upgrade will
@@ -708,6 +733,8 @@ svn_wc__write_check(svn_wc__db_t *db,
  *
  * Victim must be versioned or be part of a tree conflict.
  *
+ * If CREATE_TEMPFILES is TRUE, create temporary files for property conflicts.
+ *
  * Allocate *CONFLICTS in RESULT_POOL and do temporary allocations in
  * SCRATCH_POOL
  */
@@ -715,6 +742,7 @@ svn_error_t *
 svn_wc__read_conflicts(const apr_array_header_t **conflicts,
                        svn_wc__db_t *db,
                        const char *local_abspath,
+                       svn_boolean_t create_tempfiles,
                        apr_pool_t *result_pool,
                        apr_pool_t *scratch_pool);
 


Reply via email to