subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ar...@apache.org
Subject svn commit: r1204374 [17/29] - in /subversion/branches/svn-bisect: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ build/win32/ contrib/client-side/ contrib/client-side/emacs/ notes/ notes/wc-ng/ subversion/bindings/javahl/native...
Date Mon, 21 Nov 2011 07:08:07 GMT
Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/diff_editor.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/diff_editor.c Mon Nov 21 07:07:56 2011
@@ -839,7 +839,7 @@ walk_local_nodes_diff(struct edit_baton 
       const char *name = APR_ARRAY_IDX(children, i, const char*);
       const char *child_abspath, *child_path;
       svn_wc__db_status_t status;
-      svn_wc__db_kind_t kind;
+      svn_kind_t kind;
 
       svn_pool_clear(iterpool);
 
@@ -875,12 +875,12 @@ walk_local_nodes_diff(struct edit_baton 
 
       switch (kind)
         {
-        case svn_wc__db_kind_file:
-        case svn_wc__db_kind_symlink:
+        case svn_kind_file:
+        case svn_kind_symlink:
           SVN_ERR(file_diff(eb, child_abspath, child_path, iterpool));
           break;
 
-        case svn_wc__db_kind_dir:
+        case svn_kind_dir:
           /* ### TODO: Don't know how to do replaced dirs. How do I get
              information about what is being replaced? If it was a
              directory then the directory elements are also going to be
@@ -1080,7 +1080,7 @@ report_wc_directory_as_added(struct edit
       const char *name = APR_ARRAY_IDX(children, i, const char *);
       const char *child_abspath, *child_path;
       svn_wc__db_status_t status;
-      svn_wc__db_kind_t kind;
+      svn_kind_t kind;
 
       svn_pool_clear(iterpool);
 
@@ -1111,13 +1111,13 @@ report_wc_directory_as_added(struct edit
 
       switch (kind)
         {
-        case svn_wc__db_kind_file:
-        case svn_wc__db_kind_symlink:
+        case svn_kind_file:
+        case svn_kind_symlink:
           SVN_ERR(report_wc_file_as_added(eb, child_abspath, child_path,
                                           iterpool));
           break;
 
-        case svn_wc__db_kind_dir:
+        case svn_kind_dir:
           if (depth > svn_depth_files || depth == svn_depth_unknown)
             {
               svn_depth_t depth_below_here = depth;
@@ -1187,7 +1187,7 @@ delete_entry(const char *path,
   const char *name = svn_dirent_basename(path, NULL);
   const char *local_abspath = svn_dirent_join(pb->local_abspath, name, pool);
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
 
   /* Mark this node as compared in the parent directory's baton. */
   apr_hash_set(pb->compared, apr_pstrdup(pb->pool, path),
@@ -1207,8 +1207,8 @@ delete_entry(const char *path,
   SVN_ERR(get_empty_file(pb->eb, &empty_file));
   switch (kind)
     {
-    case svn_wc__db_kind_file:
-    case svn_wc__db_kind_symlink:
+    case svn_kind_file:
+    case svn_kind_symlink:
       /* A delete is required to change working-copy into requested
          revision, so diff should show this as an add. Thus compare
          the empty file against the current working copy.  If
@@ -1245,7 +1245,7 @@ delete_entry(const char *path,
           SVN_ERR(report_wc_file_as_added(eb, local_abspath, path, pool));
         }
       break;
-    case svn_wc__db_kind_dir:
+    case svn_kind_dir:
       /* A delete is required to change working-copy into requested
          revision, so diff should show this as an add. */
       SVN_ERR(report_wc_directory_as_added(eb,
@@ -1880,6 +1880,8 @@ svn_wc_get_diff_editor6(const svn_delta_
   void *inner_baton;
   svn_delta_editor_t *tree_editor;
   const svn_delta_editor_t *inner_editor;
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                                svn_delta_shim_callbacks_default(result_pool);
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(anchor_abspath));
 
@@ -1923,11 +1925,16 @@ svn_wc_get_diff_editor6(const svn_delta_
                                                 inner_baton,
                                                 result_pool));
 
-  return svn_delta_get_cancellation_editor(cancel_func,
-                                           cancel_baton,
-                                           inner_editor,
-                                           inner_baton,
-                                           editor,
-                                           edit_baton,
-                                           result_pool);
+  SVN_ERR(svn_delta_get_cancellation_editor(cancel_func,
+                                            cancel_baton,
+                                            inner_editor,
+                                            inner_baton,
+                                            editor,
+                                            edit_baton,
+                                            result_pool));
+
+  SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
+                                   shim_callbacks, result_pool, scratch_pool));
+
+  return SVN_NO_ERROR;
 }

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/diff_local.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/diff_local.c Mon Nov 21 07:07:56 2011
@@ -138,7 +138,7 @@ file_diff(struct diff_baton *eb,
   const char *empty_file;
   const char *original_repos_relpath;
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_revnum_t revision;
   const svn_checksum_t *checksum;
   svn_boolean_t op_root;
@@ -167,7 +167,7 @@ file_diff(struct diff_baton *eb,
 
       if (replaced && base_replace /* && !have_more_work */)
         {
-          svn_wc__db_kind_t base_kind;
+          svn_kind_t base_kind;
           SVN_ERR(svn_wc__db_base_get_info(&base_status, &base_kind,
                                            &base_revision,
                                            NULL, NULL, NULL, NULL, NULL, NULL,
@@ -445,11 +445,25 @@ diff_status_callback(void *baton,
         break; /* Go check other conditions */
     }
 
-  if (eb->changelist_hash != NULL
-      && (!status->changelist
-          || ! apr_hash_get(eb->changelist_hash, status->changelist,
-                            APR_HASH_KEY_STRING)))
-    return SVN_NO_ERROR; /* Filtered via changelist */
+  /* Filter items by changelist. */
+  /* ### duplicated in ../libsvn_client/status.c */
+  if (eb->changelist_hash)
+    {
+      if (status->changelist)
+        {
+          /* Skip unless the caller requested this changelist. */
+          if (! apr_hash_get(eb->changelist_hash, status->changelist,
+                             APR_HASH_KEY_STRING))
+            return SVN_NO_ERROR;
+        }
+      else
+        {
+          /* Skip unless the caller requested changelist-lacking items. */
+          if (! apr_hash_get(eb->changelist_hash, "",
+                             APR_HASH_KEY_STRING))
+            return SVN_NO_ERROR;
+        }
+    }
 
   /* ### The following checks should probably be reversed as it should decide
          when *not* to show a diff, because generally all changed nodes should
@@ -474,8 +488,29 @@ diff_status_callback(void *baton,
           SVN_ERR(file_diff(eb, local_abspath, path, scratch_pool));
         }
     }
-  else
+  else  /* it's a directory */
     {
+      const char *path = svn_dirent_skip_ancestor(eb->anchor_abspath,
+                                                  local_abspath);
+
+      /* Report the directory as deleted and/or opened or added. */
+      if (status->node_status == svn_wc_status_deleted
+          || status->node_status == svn_wc_status_replaced)
+        SVN_ERR(eb->callbacks->dir_deleted(NULL, NULL, path,
+                                           eb->callback_baton, scratch_pool));
+
+      if (status->node_status == svn_wc_status_added
+          || status->node_status == svn_wc_status_replaced)
+        SVN_ERR(eb->callbacks->dir_added(NULL, NULL, NULL, NULL,
+                                         path, status->revision,
+                                         path, status->revision /* ### ? */,
+                                         eb->callback_baton, scratch_pool));
+      else
+        SVN_ERR(eb->callbacks->dir_opened(NULL, NULL, NULL,
+                                          path, status->revision,
+                                          eb->callback_baton, scratch_pool));
+
+      /* Report the prop change. */
       /* ### This case should probably be extended for git-diff, but this
              is what the old diff code provided */
       if (status->node_status == svn_wc_status_deleted
@@ -484,9 +519,6 @@ diff_status_callback(void *baton,
         {
           apr_array_header_t *propchanges;
           apr_hash_t *baseprops;
-          const char *path = svn_dirent_skip_ancestor(eb->anchor_abspath,
-                                                      local_abspath);
-
 
           SVN_ERR(svn_wc__internal_propdiff(&propchanges, &baseprops,
                                             eb->db, local_abspath,
@@ -498,6 +530,15 @@ diff_status_callback(void *baton,
                                                    eb->callback_baton,
                                                    scratch_pool));
         }
+
+      /* Close the dir.
+       * ### This should be done after all children have been processed, not
+       *     yet.  The current Subversion-internal callers don't care. */
+      SVN_ERR(eb->callbacks->dir_closed(
+                        NULL, NULL, NULL, path,
+                        (status->node_status == svn_wc_status_added
+                         || status->node_status == svn_wc_status_replaced),
+                        eb->callback_baton, scratch_pool));
     }
   return SVN_NO_ERROR;
 }
@@ -519,14 +560,14 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
              apr_pool_t *scratch_pool)
 {
   struct diff_baton eb = { 0 };
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_boolean_t get_all;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
   SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, local_abspath, FALSE,
                                scratch_pool));
 
-  if (kind == svn_wc__db_kind_dir)
+  if (kind == svn_kind_dir)
       eb.anchor_abspath = local_abspath;
   else
     eb.anchor_abspath = svn_dirent_dirname(local_abspath, scratch_pool);

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/entries.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/entries.c Mon Nov 21 07:07:56 2011
@@ -61,7 +61,7 @@ typedef struct db_node_t {
   const char *parent_relpath;
   svn_wc__db_status_t presence;
   svn_revnum_t revision;
-  svn_node_kind_t kind;  /* ### should switch to svn_wc__db_kind_t */
+  svn_node_kind_t kind;  /* ### should switch to svn_kind_t */
   svn_checksum_t *checksum;
   svn_filesize_t translated_size;
   svn_revnum_t changed_rev;
@@ -148,7 +148,7 @@ check_file_external(svn_wc_entry_t *entr
                     apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   const char *repos_relpath;
   svn_revnum_t peg_revision;
   svn_revnum_t revision;
@@ -169,7 +169,7 @@ check_file_external(svn_wc_entry_t *entr
     }
 
   if (status == svn_wc__db_status_normal
-      && kind == svn_wc__db_kind_file)
+      && kind == svn_kind_file)
     {
       entry->file_external_path = repos_relpath;
       if (SVN_IS_VALID_REVNUM(peg_revision))
@@ -204,7 +204,7 @@ check_file_external(svn_wc_entry_t *entr
 */
 static svn_error_t *
 get_info_for_deleted(svn_wc_entry_t *entry,
-                     svn_wc__db_kind_t *kind,
+                     svn_kind_t *kind,
                      const char **repos_relpath,
                      const svn_checksum_t **checksum,
                      svn_wc__db_t *db,
@@ -384,7 +384,7 @@ read_one_entry(const svn_wc_entry_t **ne
                apr_pool_t *result_pool,
                apr_pool_t *scratch_pool)
 {
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_wc__db_status_t status;
   svn_wc__db_lock_t *lock;
   const char *repos_relpath;
@@ -840,11 +840,11 @@ read_one_entry(const svn_wc_entry_t **ne
   if (entry->depth == svn_depth_unknown)
     entry->depth = svn_depth_infinity;
 
-  if (kind == svn_wc__db_kind_dir)
+  if (kind == svn_kind_dir)
     entry->kind = svn_node_dir;
-  else if (kind == svn_wc__db_kind_file)
+  else if (kind == svn_kind_file)
     entry->kind = svn_node_file;
-  else if (kind == svn_wc__db_kind_symlink)
+  else if (kind == svn_kind_symlink)
     entry->kind = svn_node_file;  /* ### no symlink kind */
   else
     entry->kind = svn_node_unknown;
@@ -896,12 +896,15 @@ read_one_entry(const svn_wc_entry_t **ne
           switch (cd->kind)
             {
             case svn_wc_conflict_kind_text:
-              entry->conflict_old = svn_dirent_basename(cd->base_abspath,
-                                                        result_pool);
-              entry->conflict_new = svn_dirent_basename(cd->their_abspath,
-                                                        result_pool);
-              entry->conflict_wrk = svn_dirent_basename(cd->my_abspath,
-                                                        result_pool);
+              if (cd->base_abspath)
+                entry->conflict_old = svn_dirent_basename(cd->base_abspath,
+                                                          result_pool);
+              if (cd->their_abspath)
+                entry->conflict_new = svn_dirent_basename(cd->their_abspath,
+                                                          result_pool);
+              if (cd->my_abspath)
+                entry->conflict_wrk = svn_dirent_basename(cd->my_abspath,
+                                                          result_pool);
               break;
             case svn_wc_conflict_kind_property:
               entry->prejfile = svn_dirent_basename(cd->their_abspath,
@@ -923,7 +926,7 @@ read_one_entry(const svn_wc_entry_t **ne
 
   /* Let's check for a file external.  ugh.  */
   if (status == svn_wc__db_status_normal
-      && kind == svn_wc__db_kind_file)
+      && kind == svn_kind_file)
     SVN_ERR(check_file_external(entry, db, entry_abspath, dir_abspath,
                                 result_pool, scratch_pool));
 
@@ -1463,6 +1466,8 @@ insert_node(svn_sqlite__db_t *sdb,
     SVN_ERR(svn_sqlite__bind_text(stmt, 8, "incomplete"));
   else if (node->presence == svn_wc__db_status_excluded)
     SVN_ERR(svn_sqlite__bind_text(stmt, 8, "excluded"));
+  else if (node->presence == svn_wc__db_status_server_excluded)
+    SVN_ERR(svn_sqlite__bind_text(stmt, 8, "absent"));
 
   if (node->kind == svn_node_none)
     SVN_ERR(svn_sqlite__bind_text(stmt, 10, "unknown"));
@@ -1471,8 +1476,20 @@ insert_node(svn_sqlite__db_t *sdb,
                                   svn_node_kind_to_word(node->kind)));
 
   if (node->kind == svn_node_file)
-    SVN_ERR(svn_sqlite__bind_checksum(stmt, 14, node->checksum,
-                                      scratch_pool));
+    {
+      if (!node->checksum
+          && node->op_depth == 0
+          && node->presence != svn_wc__db_status_not_present
+          && node->presence != svn_wc__db_status_excluded
+          && node->presence != svn_wc__db_status_server_excluded)
+        return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
+                                 _("The file '%s' has no checksum"),
+                                 svn_dirent_local_style(node->local_relpath,
+                                                        scratch_pool));
+
+      SVN_ERR(svn_sqlite__bind_checksum(stmt, 14, node->checksum,
+                                        scratch_pool));
+    }
 
   if (node->properties) /* ### Never set, props done later */
     SVN_ERR(svn_sqlite__bind_properties(stmt, 15, node->properties,
@@ -1667,6 +1684,13 @@ write_entry(struct write_baton **entry_n
 
       case svn_wc_schedule_add:
         working_node = MAYBE_ALLOC(working_node, result_pool);
+        if (entry->deleted)
+          {
+            if (parent_node->base)
+              base_node = MAYBE_ALLOC(base_node, result_pool);
+            else
+              below_working_node = MAYBE_ALLOC(below_working_node, result_pool);
+          }
         break;
 
       case svn_wc_schedule_delete:
@@ -1690,14 +1714,17 @@ write_entry(struct write_baton **entry_n
      BASE node to indicate the not-present node.  */
   if (entry->deleted)
     {
-      SVN_ERR_ASSERT(base_node && !working_node && !below_working_node);
+      SVN_ERR_ASSERT(base_node || below_working_node);
       SVN_ERR_ASSERT(!entry->incomplete);
-      base_node->presence = svn_wc__db_status_not_present;
+      if (base_node)
+        base_node->presence = svn_wc__db_status_not_present;
+      else
+        below_working_node->presence = svn_wc__db_status_not_present;
     }
-
-  if (entry->absent)
+  else if (entry->absent)
     {
-      SVN_ERR_ASSERT(base_node && !working_node);
+      SVN_ERR_ASSERT(base_node && !working_node && !below_working_node);
+      SVN_ERR_ASSERT(!entry->incomplete);
       base_node->presence = svn_wc__db_status_server_excluded;
     }
 
@@ -1705,16 +1732,10 @@ write_entry(struct write_baton **entry_n
     {
       if (entry->copyfrom_url)
         {
-          const char *relpath;
-
           working_node->repos_id = repos_id;
-          relpath = svn_uri__is_child(this_dir->repos,
-                                      entry->copyfrom_url,
-                                      result_pool);
-          if (relpath == NULL)
-            working_node->repos_relpath = "";
-          else
-            working_node->repos_relpath = relpath;
+          working_node->repos_relpath = svn_uri_skip_ancestor(
+                                          this_dir->repos, entry->copyfrom_url,
+                                          result_pool);
           working_node->revision = entry->copyfrom_rev;
           working_node->op_depth
             = svn_wc__db_op_depth_for_upgrade(local_relpath);
@@ -1870,10 +1891,23 @@ write_entry(struct write_baton **entry_n
 
       if (entry->deleted)
         {
-          base_node->presence = svn_wc__db_status_not_present;
+          SVN_ERR_ASSERT(base_node->presence == svn_wc__db_status_not_present);
           /* ### should be svn_node_unknown, but let's store what we have. */
           base_node->kind = entry->kind;
         }
+      else if (entry->absent)
+        {
+          SVN_ERR_ASSERT(base_node->presence 
+                                == svn_wc__db_status_server_excluded);
+          /* ### should be svn_node_unknown, but let's store what we have. */
+          base_node->kind = entry->kind;
+
+          /* Store the most likely revision in the node to avoid
+             base nodes without a valid revision. Of course
+             we remember that the data is still incomplete. */
+          if (!SVN_IS_VALID_REVNUM(base_node->revision) && parent_node->base)
+            base_node->revision = parent_node->base->revision;
+        }
       else
         {
           base_node->kind = entry->kind;
@@ -1931,9 +1965,20 @@ write_entry(struct write_baton **entry_n
                 found_md5_checksum = text_base_info->normal_base.md5_checksum;
               else
                 found_md5_checksum = NULL;
-              if (entry_md5_checksum && found_md5_checksum)
-                SVN_ERR_ASSERT(svn_checksum_match(entry_md5_checksum,
-                                                  found_md5_checksum));
+              if (entry_md5_checksum && found_md5_checksum &&
+                  !svn_checksum_match(entry_md5_checksum, found_md5_checksum))
+                return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
+                                         _("Bad base MD5 checksum for '%s'; "
+                                           "expected: '%s'; found '%s'; "),
+                                       svn_dirent_local_style(
+                                         svn_dirent_join(root_abspath,
+                                                         local_relpath,
+                                                         scratch_pool),
+                                         scratch_pool),
+                                       svn_checksum_to_cstring_display(
+                                         entry_md5_checksum, scratch_pool),
+                                       svn_checksum_to_cstring_display(
+                                         found_md5_checksum, scratch_pool));
               else
                 {
                   /* ### Not sure what conditions this should cover. */
@@ -1948,17 +1993,16 @@ write_entry(struct write_baton **entry_n
 
           if (entry->url != NULL)
             {
-              const char *relpath = svn_uri__is_child(this_dir->repos,
-                                                      entry->url,
-                                                      result_pool);
-              base_node->repos_relpath = relpath ? relpath : "";
+              base_node->repos_relpath = svn_uri_skip_ancestor(
+                                           this_dir->repos, entry->url,
+                                           result_pool);
             }
           else
             {
-              const char *relpath = svn_uri__is_child(this_dir->repos,
-                                                      this_dir->url,
-                                                      scratch_pool);
-              if (relpath == NULL)
+              const char *relpath = svn_uri_skip_ancestor(this_dir->repos,
+                                                          this_dir->url,
+                                                          scratch_pool);
+              if (relpath == NULL || *relpath == '\0')
                 base_node->repos_relpath = entry->name;
               else
                 base_node->repos_relpath =
@@ -1976,6 +2020,9 @@ write_entry(struct write_baton **entry_n
       base_node->changed_date = entry->cmt_date;
       base_node->changed_author = entry->cmt_author;
 
+      if (entry->file_external_path)
+        base_node->file_external = TRUE;
+
       SVN_ERR(insert_node(sdb, base_node, scratch_pool));
 
       /* We have to insert the lock after the base node, because the node
@@ -1993,12 +2040,6 @@ write_entry(struct write_baton **entry_n
           SVN_ERR(svn_wc__db_lock_add(db, tmp_entry_abspath, &lock,
                                       scratch_pool));
         }
-
-      /* Now, update the file external information. */
-      if (entry->file_external_path)
-        {
-          base_node->file_external = TRUE;
-        }
     }
 
   if (below_working_node)
@@ -2500,7 +2541,7 @@ svn_wc_walk_entries3(const char *path,
   const char *local_abspath;
   svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
   svn_error_t *err;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_depth_t depth;
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
@@ -2524,7 +2565,7 @@ svn_wc_walk_entries3(const char *path,
         walk_baton, pool);
     }
 
-  if (kind == svn_wc__db_kind_file || depth == svn_depth_exclude)
+  if (kind == svn_kind_file || depth == svn_depth_exclude)
     {
       const svn_wc_entry_t *entry;
 
@@ -2566,7 +2607,7 @@ svn_wc_walk_entries3(const char *path,
       return SVN_NO_ERROR;
     }
 
-  if (kind == svn_wc__db_kind_dir)
+  if (kind == svn_kind_dir)
     return walker_helper(path, adm_access, walk_callbacks, walk_baton,
                          walk_depth, show_hidden, cancel_func, cancel_baton,
                          pool);

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/externals.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/externals.c Mon Nov 21 07:07:56 2011
@@ -30,6 +30,7 @@
 #include <apr_hash.h>
 #include <apr_tables.h>
 #include <apr_general.h>
+#include <apr_uri.h>
 
 #include "svn_dirent_uri.h"
 #include "svn_path.h"
@@ -200,8 +201,7 @@ svn_wc_parse_externals_description3(apr_
       for (num_line_parts = 0; line_parts[num_line_parts]; num_line_parts++)
         ;
 
-      SVN_ERR(svn_wc_external_item_create
-              ((const svn_wc_external_item2_t **) &item, pool));
+      SVN_ERR(svn_wc_external_item2_create(&item, pool));
       item->revision.kind = svn_opt_revision_unspecified;
       item->peg_revision.kind = svn_opt_revision_unspecified;
 
@@ -441,7 +441,7 @@ open_file(const char *path,
           void **file_baton)
 {
   struct edit_baton *eb = parent_baton;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   if (strcmp(path, eb->name))
       return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
                                _("This editor can only update '%s'"),
@@ -457,7 +457,7 @@ open_file(const char *path,
                                    eb->db, eb->local_abspath,
                                    eb->pool, file_pool));
 
-  if (kind != svn_wc__db_kind_file)
+  if (kind != svn_kind_file)
     return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
                                _("Node '%s' is no existing file external"),
                                svn_dirent_local_style(eb->local_abspath,
@@ -609,8 +609,8 @@ close_file(void *file_baton,
     const svn_checksum_t *original_checksum = NULL;
 
     svn_boolean_t added = !SVN_IS_VALID_REVNUM(eb->original_revision);
-    const char *repos_relpath = svn_uri__is_child(eb->repos_root_url,
-                                                  eb->url, pool);
+    const char *repos_relpath = svn_uri_skip_ancestor(eb->repos_root_url,
+                                                      eb->url, pool);
 
     if (! added)
       {
@@ -669,7 +669,7 @@ close_file(void *file_baton,
                                       &new_pristine_props,
                                       &new_actual_props,
                                       eb->db, eb->local_abspath,
-                                      svn_wc__db_kind_file,
+                                      svn_kind_file,
                                       NULL, NULL,
                                       NULL /* server_baseprops*/,
                                       base_props,
@@ -901,8 +901,8 @@ svn_wc__get_file_external_editor(const s
   eb->diff3cmd = diff3_cmd;
 
   eb->record_ancestor_abspath = apr_pstrdup(edit_pool,record_ancestor_abspath);
-  eb->recorded_repos_relpath = svn_uri__is_child(repos_root_url, recorded_url,
-                                                 edit_pool);
+  eb->recorded_repos_relpath = svn_uri_skip_ancestor(repos_root_url, recorded_url,
+                                                     edit_pool);
 
   eb->changed_rev = SVN_INVALID_REVNUM;
 
@@ -955,7 +955,7 @@ svn_wc__crawl_file_external(svn_wc_conte
 {
   svn_wc__db_t *db = wc_ctx->db;
   svn_error_t *err;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_wc__db_lock_t *lock;
   svn_revnum_t revision;
   const char *repos_root_url;
@@ -970,7 +970,7 @@ svn_wc__crawl_file_external(svn_wc_conte
                                  scratch_pool, scratch_pool);
 
   if (err
-      || kind == svn_wc__db_kind_dir
+      || kind == svn_kind_dir
       || !update_root)
     {
       if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
@@ -1054,7 +1054,7 @@ svn_wc__read_external_info(svn_node_kind
 {
   const char *repos_root_url;
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_error_t *err;
 
   err = svn_wc__db_external_read(&status, &kind, defining_abspath,
@@ -1096,11 +1096,11 @@ svn_wc__read_external_info(svn_node_kind
       else
         switch(kind)
           {
-            case svn_wc__db_kind_file:
-            case svn_wc__db_kind_symlink:
+            case svn_kind_file:
+            case svn_kind_symlink:
               *external_kind = svn_node_file;
               break;
-            case svn_wc__db_kind_dir:
+            case svn_kind_dir:
               *external_kind = svn_node_dir;
               break;
             default:
@@ -1115,6 +1115,110 @@ svn_wc__read_external_info(svn_node_kind
   return SVN_NO_ERROR;
 }
 
+/* Return TRUE in *IS_ROLLED_OUT iff a node exists at XINFO->LOCAL_ABSPATH and
+ * if that node's origin corresponds with XINFO->REPOS_ROOT_URL and
+ * XINFO->REPOS_RELPATH.  All allocations are made in SCRATCH_POOL. */
+static svn_error_t *
+is_external_rolled_out(svn_boolean_t *is_rolled_out,
+                       svn_wc_context_t *wc_ctx,
+                       svn_wc__committable_external_info_t *xinfo,
+                       apr_pool_t *scratch_pool)
+{
+  const char *x_repos_relpath;
+  const char *x_repos_root_url;
+  svn_error_t *err;
+
+  *is_rolled_out = FALSE;
+
+  err = svn_wc__node_get_origin(NULL, NULL,
+                                &x_repos_relpath,
+                                &x_repos_root_url,
+                                NULL,
+                                wc_ctx, xinfo->local_abspath,
+                                FALSE, /* scan_deleted */
+                                scratch_pool, scratch_pool);
+
+  if (err)
+    {
+      if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+        {
+          svn_error_clear(err);
+          return SVN_NO_ERROR;
+        }
+      SVN_ERR(err);
+    }
+
+  *is_rolled_out = (strcmp(xinfo->repos_root_url, x_repos_root_url) == 0 &&
+                    strcmp(xinfo->repos_relpath, x_repos_relpath) == 0);
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_wc__committable_externals_below(apr_array_header_t **externals,
+                                    svn_wc_context_t *wc_ctx,
+                                    const char *local_abspath,
+                                    svn_depth_t depth,
+                                    apr_pool_t *result_pool,
+                                    apr_pool_t *scratch_pool)
+{
+  apr_array_header_t *orig_externals;
+  int i;
+  apr_pool_t *iterpool;
+
+  /* For svn_depth_files, this also fetches dirs. They are filtered later. */
+  SVN_ERR(svn_wc__db_committable_externals_below(&orig_externals,
+                                                 wc_ctx->db,
+                                                 local_abspath,
+                                                 depth != svn_depth_infinity,
+                                                 result_pool, scratch_pool));
+  
+  if (orig_externals == NULL)
+    return SVN_NO_ERROR;
+
+  iterpool = svn_pool_create(scratch_pool);
+
+  for (i = 0; i < orig_externals->nelts; i++)
+    {
+      svn_boolean_t is_rolled_out;
+
+      svn_wc__committable_external_info_t *xinfo =
+        APR_ARRAY_IDX(orig_externals, i,
+                      svn_wc__committable_external_info_t *);
+
+      /* Discard dirs for svn_depth_files (s.a.). */
+      if (depth == svn_depth_files
+          && xinfo->kind == svn_kind_dir)
+        continue;
+
+      svn_pool_clear(iterpool);
+
+      /* Discard those externals that are not currently checked out. */
+      SVN_ERR(is_external_rolled_out(&is_rolled_out, wc_ctx, xinfo,
+                                     iterpool));
+      if (! is_rolled_out)
+        continue;
+
+      if (*externals == NULL)
+        *externals = apr_array_make(
+                               result_pool, 0,
+                               sizeof(svn_wc__committable_external_info_t *));
+
+      APR_ARRAY_PUSH(*externals,
+                     svn_wc__committable_external_info_t *) = xinfo;
+
+      if (depth != svn_depth_infinity)
+        continue;
+
+      /* Are there any nested externals? */
+      SVN_ERR(svn_wc__committable_externals_below(externals, wc_ctx,
+                                                  xinfo->local_abspath,
+                                                  svn_depth_infinity,
+                                                  result_pool, iterpool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_wc__externals_defined_below(apr_hash_t **externals,
                                 svn_wc_context_t *wc_ctx,
@@ -1163,7 +1267,7 @@ svn_wc__external_remove(svn_wc_context_t
                         apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
 
   SVN_ERR(svn_wc__db_external_read(&status, &kind, NULL, NULL, NULL, NULL,
                                    NULL, NULL,
@@ -1173,7 +1277,7 @@ svn_wc__external_remove(svn_wc_context_t
   SVN_ERR(svn_wc__db_external_remove(wc_ctx->db, local_abspath, wri_abspath,
                                      NULL, scratch_pool));
 
-  if (kind == svn_wc__db_kind_dir)
+  if (kind == svn_kind_dir)
     SVN_ERR(svn_wc_remove_from_revision_control2(wc_ctx, local_abspath,
                                                  TRUE, FALSE,
                                                  cancel_func, cancel_baton,
@@ -1248,3 +1352,195 @@ svn_wc__externals_gather_definitions(apr
       return SVN_NO_ERROR;
     }
 }
+
+/* Return the scheme of @a uri in @a scheme allocated from @a pool.
+   If @a uri does not appear to be a valid URI, then @a scheme will
+   not be updated.  */
+static svn_error_t *
+uri_scheme(const char **scheme, const char *uri, apr_pool_t *pool)
+{
+  apr_size_t i;
+
+  for (i = 0; uri[i] && uri[i] != ':'; ++i)
+    if (uri[i] == '/')
+      goto error;
+
+  if (i > 0 && uri[i] == ':' && uri[i+1] == '/' && uri[i+2] == '/')
+    {
+      *scheme = apr_pstrmemdup(pool, uri, i);
+      return SVN_NO_ERROR;
+    }
+
+error:
+  return svn_error_createf(SVN_ERR_BAD_URL, 0,
+                           _("URL '%s' does not begin with a scheme"),
+                           uri);
+}
+
+svn_error_t *
+svn_wc__resolve_relative_external_url(const char **resolved_url,
+                                      const svn_wc_external_item2_t *item,
+                                      const char *repos_root_url,
+                                      const char *parent_dir_url,
+                                      apr_pool_t *result_pool,
+                                      apr_pool_t *scratch_pool)
+{
+  const char *url = item->url;
+  apr_uri_t parent_dir_uri;
+  apr_status_t status;
+
+  *resolved_url = item->url;
+
+  /* If the URL is already absolute, there is nothing to do. */
+  if (svn_path_is_url(url))
+    {
+      /* "http://server/path" */
+      *resolved_url = svn_uri_canonicalize(url, result_pool);
+      return SVN_NO_ERROR;
+    }
+
+  if (url[0] == '/')
+    {
+      /* "/path", "//path", and "///path" */
+      int num_leading_slashes = 1;
+      if (url[1] == '/')
+        {
+          num_leading_slashes++;
+          if (url[2] == '/')
+            num_leading_slashes++;
+        }
+
+      /* "//schema-relative" and in some cases "///schema-relative".
+         This last format is supported on file:// schema relative. */
+      url = apr_pstrcat(scratch_pool,
+                        apr_pstrndup(scratch_pool, url, num_leading_slashes),
+                        svn_relpath_canonicalize(url + num_leading_slashes,
+                                                 scratch_pool),
+                        (char*)NULL);
+    }
+  else
+    {
+      /* "^/path" and "../path" */
+      url = svn_relpath_canonicalize(url, scratch_pool);
+    }
+
+  /* Parse the parent directory URL into its parts. */
+  status = apr_uri_parse(scratch_pool, parent_dir_url, &parent_dir_uri);
+  if (status)
+    return svn_error_createf(SVN_ERR_BAD_URL, 0,
+                             _("Illegal parent directory URL '%s'"),
+                             parent_dir_url);
+
+  /* If the parent directory URL is at the server root, then the URL
+     may have no / after the hostname so apr_uri_parse() will leave
+     the URL's path as NULL. */
+  if (! parent_dir_uri.path)
+    parent_dir_uri.path = apr_pstrmemdup(scratch_pool, "/", 1);
+  parent_dir_uri.query = NULL;
+  parent_dir_uri.fragment = NULL;
+
+  /* Handle URLs relative to the current directory or to the
+     repository root.  The backpaths may only remove path elements,
+     not the hostname.  This allows an external to refer to another
+     repository in the same server relative to the location of this
+     repository, say using SVNParentPath. */
+  if ((0 == strncmp("../", url, 3)) ||
+      (0 == strncmp("^/", url, 2)))
+    {
+      apr_array_header_t *base_components;
+      apr_array_header_t *relative_components;
+      int i;
+
+      /* Decompose either the parent directory's URL path or the
+         repository root's URL path into components.  */
+      if (0 == strncmp("../", url, 3))
+        {
+          base_components = svn_path_decompose(parent_dir_uri.path,
+                                               scratch_pool);
+          relative_components = svn_path_decompose(url, scratch_pool);
+        }
+      else
+        {
+          apr_uri_t repos_root_uri;
+
+          status = apr_uri_parse(scratch_pool, repos_root_url,
+                                 &repos_root_uri);
+          if (status)
+            return svn_error_createf(SVN_ERR_BAD_URL, 0,
+                                     _("Illegal repository root URL '%s'"),
+                                     repos_root_url);
+
+          /* If the repository root URL is at the server root, then
+             the URL may have no / after the hostname so
+             apr_uri_parse() will leave the URL's path as NULL. */
+          if (! repos_root_uri.path)
+            repos_root_uri.path = apr_pstrmemdup(scratch_pool, "/", 1);
+
+          base_components = svn_path_decompose(repos_root_uri.path,
+                                               scratch_pool);
+          relative_components = svn_path_decompose(url + 2, scratch_pool);
+        }
+
+      for (i = 0; i < relative_components->nelts; ++i)
+        {
+          const char *component = APR_ARRAY_IDX(relative_components,
+                                                i,
+                                                const char *);
+          if (0 == strcmp("..", component))
+            {
+              /* Constructing the final absolute URL together with
+                 apr_uri_unparse() requires that the path be absolute,
+                 so only pop a component if the component being popped
+                 is not the component for the root directory. */
+              if (base_components->nelts > 1)
+                apr_array_pop(base_components);
+            }
+          else
+            APR_ARRAY_PUSH(base_components, const char *) = component;
+        }
+
+      parent_dir_uri.path = (char *)svn_path_compose(base_components,
+                                                     scratch_pool);
+      *resolved_url = svn_uri_canonicalize(apr_uri_unparse(scratch_pool,
+                                                           &parent_dir_uri, 0),
+                                       result_pool);
+      return SVN_NO_ERROR;
+    }
+
+  /* The remaining URLs are relative to either the scheme or server root
+     and can only refer to locations inside that scope, so backpaths are
+     not allowed. */
+  if (svn_path_is_backpath_present(url + 2))
+    return svn_error_createf(SVN_ERR_BAD_URL, 0,
+                             _("The external relative URL '%s' cannot have "
+                               "backpaths, i.e. '..'"),
+                             item->url);
+
+  /* Relative to the scheme: Build a new URL from the parts we know. */
+  if (0 == strncmp("//", url, 2))
+    {
+      const char *scheme;
+
+      SVN_ERR(uri_scheme(&scheme, repos_root_url, scratch_pool));
+      *resolved_url = svn_uri_canonicalize(apr_pstrcat(scratch_pool, scheme,
+                                                       ":", url, (char *)NULL),
+                                           result_pool);
+      return SVN_NO_ERROR;
+    }
+
+  /* Relative to the server root: Just replace the path portion of the
+     parent's URL. */
+  if (url[0] == '/')
+    {
+      parent_dir_uri.path = (char *)url;
+      *resolved_url = svn_uri_canonicalize(apr_uri_unparse(scratch_pool,
+                                                           &parent_dir_uri, 0),
+                                           result_pool);
+      return SVN_NO_ERROR;
+    }
+
+  return svn_error_createf(SVN_ERR_BAD_URL, 0,
+                           _("Unrecognized format for the relative external "
+                             "URL '%s'"),
+                           item->url);
+}

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/info.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/info.c Mon Nov 21 07:07:56 2011
@@ -86,7 +86,7 @@ build_info_for_node(svn_wc__info2_t **in
   svn_wc__info2_t *tmpinfo;
   const char *repos_relpath;
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t db_kind;
+  svn_kind_t db_kind;
   const char *original_repos_relpath;
   const char *original_repos_root_url;
   const char *original_uuid;
@@ -447,9 +447,8 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
                  apr_pool_t *scratch_pool)
 {
   struct found_entry_baton fe_baton;
-  const svn_wc_conflict_description2_t *root_tree_conflict;
   svn_error_t *err;
-  apr_pool_t *iterpool;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   apr_hash_index_t *hi;
 
   fe_baton.receiver = receiver;
@@ -460,39 +459,46 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
   fe_baton.tree_conflicts = apr_hash_make(scratch_pool);
   fe_baton.pool = scratch_pool;
 
-  if (fetch_actual_only)
-    {
-      SVN_ERR(svn_wc__db_op_read_tree_conflict(&root_tree_conflict,
-                                               wc_ctx->db, local_abspath,
-                                               scratch_pool, scratch_pool));
-      if (root_tree_conflict)
-        {
-          apr_hash_set(fe_baton.tree_conflicts, local_abspath,
-                       APR_HASH_KEY_STRING, root_tree_conflict);
-        }
-    }
-  else
-    root_tree_conflict = FALSE;
-
   err = svn_wc__internal_walk_children(wc_ctx->db, local_abspath,
                                        fetch_excluded,
                                        changelist_filter,
                                        info_found_node_callback,
                                        &fe_baton, depth,
                                        cancel_func, cancel_baton,
-                                       scratch_pool);
+                                       iterpool);
 
   /* If the target root node is not present, svn_wc__internal_walk_children()
      returns a PATH_NOT_FOUND error and doesn't call the callback.  If there
      is a tree conflict on this node, that is not an error. */
-  if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND && root_tree_conflict)
-    svn_error_clear(err);
-  else if (err)
-    return svn_error_trace(err);
+  if (fe_baton.first /* not visited by walk_children */
+      && fetch_actual_only
+      && err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+    {
+      const svn_wc_conflict_description2_t *root_tree_conflict;
+      svn_error_t *err2;
+
+      err2 = svn_wc__db_op_read_tree_conflict(&root_tree_conflict,
+                                              wc_ctx->db, local_abspath,
+                                              scratch_pool, iterpool);
+
+      if ((err2 && err2->apr_err == SVN_ERR_WC_PATH_NOT_FOUND))
+        {
+          svn_error_clear(err2);
+          return svn_error_trace(err);
+        }
+      else if (err2 || !root_tree_conflict)
+        return svn_error_compose_create(err, err2);
+
+      svn_error_clear(err);
+
+      apr_hash_set(fe_baton.tree_conflicts, local_abspath,
+                   APR_HASH_KEY_STRING, root_tree_conflict);
+    }
+  else
+    SVN_ERR(err);
 
   /* If there are any tree conflicts that we have found but have not reported,
    * send a minimal info struct for each one now. */
-  iterpool = svn_pool_create(scratch_pool);
   for (hi = apr_hash_first(scratch_pool, fe_baton.tree_conflicts); hi;
        hi = apr_hash_next(hi))
     {

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/lock.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/lock.c Mon Nov 21 07:07:56 2011
@@ -122,64 +122,64 @@ svn_wc__internal_check_wc(int *wc_format
         }
     }
 
-    if (*wc_format >= SVN_WC__WC_NG_VERSION)
-      {
-        svn_wc__db_status_t db_status;
-        svn_wc__db_kind_t db_kind;
-
-        if (check_path)
-          {
-            /* If a node is not a directory, it is not a working copy
-               directory.  This allows creating new working copies as
-               a path below an existing working copy. */
-            svn_node_kind_t wc_kind;
-
-            SVN_ERR(svn_io_check_path(local_abspath, &wc_kind, scratch_pool));
-            if (wc_kind != svn_node_dir)
-              {
-                *wc_format = 0; /* Not a directory, so not a wc-directory */
-                return SVN_NO_ERROR;
-              }
-          }
-
-        err = svn_wc__db_read_info(&db_status, &db_kind, NULL, NULL, NULL,
-                                   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                   NULL, NULL, NULL, NULL, NULL,
-                                   NULL, NULL, NULL,
-                                   db, local_abspath,
-                                   scratch_pool, scratch_pool);
+  if (*wc_format >= SVN_WC__WC_NG_VERSION)
+    {
+      svn_wc__db_status_t db_status;
+      svn_kind_t db_kind;
 
-        if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
-          {
-            svn_error_clear(err);
-            *wc_format = 0;
-            return SVN_NO_ERROR;
-          }
-        else
-          SVN_ERR(err);
-
-        if (db_kind != svn_wc__db_kind_dir)
-          {
-            /* The WC thinks there must be a file, so this is not
-               a wc-directory */
-            *wc_format = 0;
-            return SVN_NO_ERROR;
-          }
+      if (check_path)
+        {
+          /* If a node is not a directory, it is not a working copy
+             directory.  This allows creating new working copies as
+             a path below an existing working copy. */
+          svn_node_kind_t wc_kind;
 
-        switch (db_status)
-          {
-            case svn_wc__db_status_not_present:
-            case svn_wc__db_status_server_excluded:
-            case svn_wc__db_status_excluded:
-              /* If there is a directory here, it is not related to the parent
-                 working copy: Obstruction */
-              *wc_format = 0;
+          SVN_ERR(svn_io_check_path(local_abspath, &wc_kind, scratch_pool));
+          if (wc_kind != svn_node_dir)
+            {
+              *wc_format = 0; /* Not a directory, so not a wc-directory */
               return SVN_NO_ERROR;
-            default:
-              break;
-          }
-      }
+            }
+        }
+
+      err = svn_wc__db_read_info(&db_status, &db_kind, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL,
+                                 db, local_abspath,
+                                 scratch_pool, scratch_pool);
+
+      if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+        {
+          svn_error_clear(err);
+          *wc_format = 0;
+          return SVN_NO_ERROR;
+        }
+      else
+        SVN_ERR(err);
+
+      if (db_kind != svn_kind_dir)
+        {
+          /* The WC thinks there must be a file, so this is not
+             a wc-directory */
+          *wc_format = 0;
+          return SVN_NO_ERROR;
+        }
+
+      switch (db_status)
+        {
+          case svn_wc__db_status_not_present:
+          case svn_wc__db_status_server_excluded:
+          case svn_wc__db_status_excluded:
+            /* If there is a directory here, it is not related to the parent
+               working copy: Obstruction */
+            *wc_format = 0;
+            return SVN_NO_ERROR;
+          default:
+            break;
+        }
+    }
 
   return SVN_NO_ERROR;
 }
@@ -593,7 +593,7 @@ open_single(svn_wc_adm_access_t **adm_ac
    ### adminstrative area.  */
 static svn_error_t *
 adm_available(svn_boolean_t *available,
-              svn_wc__db_kind_t *kind,
+              svn_kind_t *kind,
               svn_wc__db_t *db,
               const char *local_abspath,
               apr_pool_t *scratch_pool)
@@ -601,7 +601,7 @@ adm_available(svn_boolean_t *available,
   svn_wc__db_status_t status;
 
   if (kind)
-    *kind = svn_wc__db_kind_unknown;
+    *kind = svn_kind_unknown;
 
   SVN_ERR(svn_wc__db_read_info(&status, kind, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -659,7 +659,7 @@ do_open(svn_wc_adm_access_t **adm_access
       for (i = 0; i < children->nelts; i++)
         {
           const char *node_abspath;
-          svn_wc__db_kind_t kind;
+          svn_kind_t kind;
           svn_boolean_t available;
           const char *name = APR_ARRAY_IDX(children, i, const char *);
 
@@ -677,7 +677,7 @@ do_open(svn_wc_adm_access_t **adm_access
                                 node_abspath,
                                 scratch_pool));
 
-          if (kind != svn_wc__db_kind_dir)
+          if (kind != svn_kind_dir)
             continue;
 
           if (available)
@@ -885,7 +885,7 @@ svn_wc_adm_retrieve(svn_wc_adm_access_t 
                     apr_pool_t *pool)
 {
   const char *local_abspath;
-  svn_wc__db_kind_t kind = svn_wc__db_kind_unknown;
+  svn_kind_t kind = svn_kind_unknown;
   svn_node_kind_t wckind;
   svn_error_t *err;
 
@@ -924,12 +924,12 @@ svn_wc_adm_retrieve(svn_wc_adm_access_t 
 
       if (err)
         {
-          kind = svn_wc__db_kind_unknown;
+          kind = svn_kind_unknown;
           svn_error_clear(err);
         }
     }
 
-  if (kind == svn_wc__db_kind_dir && wckind == svn_node_file)
+  if (kind == svn_kind_dir && wckind == svn_node_file)
     {
       err = svn_error_createf(
                SVN_ERR_WC_NOT_WORKING_COPY, NULL,
@@ -939,7 +939,7 @@ svn_wc_adm_retrieve(svn_wc_adm_access_t 
       return svn_error_create(SVN_ERR_WC_NOT_LOCKED, err, err->message);
     }
 
-  if (kind != svn_wc__db_kind_dir && kind != svn_wc__db_kind_unknown)
+  if (kind != svn_kind_dir && kind != svn_kind_unknown)
     {
       err = svn_error_createf(
                SVN_ERR_WC_NOT_WORKING_COPY, NULL,
@@ -949,7 +949,7 @@ svn_wc_adm_retrieve(svn_wc_adm_access_t 
       return svn_error_create(SVN_ERR_WC_NOT_LOCKED, err, err->message);
     }
 
-  if (kind == svn_wc__db_kind_unknown || wckind == svn_node_none)
+  if (kind == svn_kind_unknown || wckind == svn_node_none)
     {
       err = svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
                               _("Directory '%s' is missing"),
@@ -974,7 +974,7 @@ svn_wc_adm_probe_retrieve(svn_wc_adm_acc
 {
   const char *dir;
   const char *local_abspath;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_error_t *err;
 
   SVN_ERR_ASSERT(associated != NULL);
@@ -982,9 +982,9 @@ svn_wc_adm_probe_retrieve(svn_wc_adm_acc
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
   SVN_ERR(svn_wc__db_read_kind(&kind, associated->db, local_abspath, TRUE, pool));
 
-  if (kind == svn_wc__db_kind_dir)
+  if (kind == svn_kind_dir)
     dir = path;
-  else if (kind != svn_wc__db_kind_unknown)
+  else if (kind != svn_kind_unknown)
     dir = svn_dirent_dirname(path, pool);
   else
     /* Not a versioned item, probe it */
@@ -1284,7 +1284,7 @@ open_anchor(svn_wc_adm_access_t **anchor
       if (! t_access)
         {
           svn_boolean_t available;
-          svn_wc__db_kind_t kind;
+          svn_kind_t kind;
 
           err = adm_available(&available, &kind, db, local_abspath, pool);
 
@@ -1511,14 +1511,14 @@ svn_wc__acquire_write_lock(const char **
                            apr_pool_t *scratch_pool)
 {
   svn_wc__db_t *db = wc_ctx->db;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   svn_error_t *err;
 
   SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, local_abspath,
                                (lock_root_abspath != NULL),
                                scratch_pool));
 
-  if (!lock_root_abspath && kind != svn_wc__db_kind_dir)
+  if (!lock_root_abspath && kind != svn_kind_dir)
     return svn_error_createf(SVN_ERR_WC_NOT_DIRECTORY, NULL,
                              _("Can't obtain lock on non-directory '%s'."),
                              svn_dirent_local_style(local_abspath,
@@ -1527,7 +1527,7 @@ svn_wc__acquire_write_lock(const char **
   if (lock_anchor)
     {
       const char *parent_abspath;
-      svn_wc__db_kind_t parent_kind;
+      svn_kind_t parent_kind;
 
       SVN_ERR_ASSERT(lock_root_abspath != NULL);
 
@@ -1537,12 +1537,12 @@ svn_wc__acquire_write_lock(const char **
       if (err && SVN_WC__ERR_IS_NOT_CURRENT_WC(err))
         {
           svn_error_clear(err);
-          parent_kind = svn_wc__db_kind_unknown;
+          parent_kind = svn_kind_unknown;
         }
       else
         SVN_ERR(err);
 
-      if (kind == svn_wc__db_kind_dir && parent_kind == svn_wc__db_kind_dir)
+      if (kind == svn_kind_dir && parent_kind == svn_kind_dir)
         {
           svn_boolean_t disjoint;
           SVN_ERR(child_is_disjoint(&disjoint, wc_ctx->db, local_abspath,
@@ -1550,25 +1550,25 @@ svn_wc__acquire_write_lock(const char **
           if (!disjoint)
             local_abspath = parent_abspath;
         }
-      else if (parent_kind == svn_wc__db_kind_dir)
+      else if (parent_kind == svn_kind_dir)
         local_abspath = parent_abspath;
-      else if (kind != svn_wc__db_kind_dir)
+      else if (kind != svn_kind_dir)
         return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
                                  _("'%s' is not a working copy"),
                                  svn_dirent_local_style(local_abspath,
                                                         scratch_pool));
     }
-  else if (kind != svn_wc__db_kind_dir)
+  else if (kind != svn_kind_dir)
     {
       local_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
       /* Can't lock parents that don't exist */
-      if (kind == svn_wc__db_kind_unknown)
+      if (kind == svn_kind_unknown)
         {
           SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, FALSE,
                                        scratch_pool));
 
-          if (kind != svn_wc__db_kind_dir)
+          if (kind != svn_kind_dir)
             return svn_error_createf(
                              SVN_ERR_WC_NOT_DIRECTORY, NULL,
                              _("Can't obtain lock on non-directory '%s'."),

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/merge.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/merge.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/merge.c Mon Nov 21 07:07:56 2011
@@ -924,6 +924,77 @@ maybe_resolve_conflicts(svn_skel_t **wor
   return SVN_NO_ERROR;
 }
 
+
+/* Attempt a trivial merge of LEFT_ABSPATH and RIGHT_ABSPATH to TARGET_ABSPATH.
+ * The merge is trivial if the file at LEFT_ABSPATH equals TARGET_ABSPATH,
+ * because in this case the content of RIGHT_ABSPATH can be copied to the
+ * target. On success, set *MERGE_OUTCOME to SVN_WC_MERGE_MERGED in case the
+ * target was changed, or to SVN_WC_MERGE_UNCHANGED if the target was not
+ * changed. Install work queue items allocated in RESULT_POOL in *WORK_ITEMS.
+ * On failure, set *MERGE_OUTCOME to SVN_WC_MERGE_NO_MERGE. */
+static svn_error_t *
+merge_file_trivial(svn_skel_t **work_items,
+                   enum svn_wc_merge_outcome_t *merge_outcome,
+                   const char *left_abspath,
+                   const char *right_abspath,
+                   const char *target_abspath,
+                   svn_boolean_t dry_run,
+                   svn_wc__db_t *db,
+                   apr_pool_t *result_pool,
+                   apr_pool_t *scratch_pool)
+{
+  svn_skel_t *work_item;
+  svn_boolean_t same_contents = FALSE;
+  svn_node_kind_t kind;
+  svn_boolean_t is_special;
+
+  /* If the target is not a normal file, do not attempt a trivial merge. */
+  SVN_ERR(svn_io_check_special_path(target_abspath, &kind, &is_special,
+                                    scratch_pool));
+  if (kind != svn_node_file || is_special)
+    {
+      *merge_outcome = svn_wc_merge_no_merge;
+      return SVN_NO_ERROR;
+    }
+
+  /* If the LEFT side of the merge is equal to WORKING, then we can
+   * copy RIGHT directly. */
+  SVN_ERR(svn_io_files_contents_same_p(&same_contents, left_abspath,
+                                       target_abspath, scratch_pool));
+  if (same_contents)
+    {
+      /* Check whether the left side equals the right side.
+       * If it does, there is no change to merge so we leave the target
+       * unchanged. */
+      SVN_ERR(svn_io_files_contents_same_p(&same_contents, left_abspath,
+                                           right_abspath, scratch_pool));
+      if (same_contents)
+        {
+          *merge_outcome = svn_wc_merge_unchanged;
+        }
+      else
+        {
+          *merge_outcome = svn_wc_merge_merged;
+          if (!dry_run)
+            {
+              SVN_ERR(svn_wc__wq_build_file_install(
+                        &work_item, db, target_abspath, right_abspath,
+                        FALSE /* use_commit_times */,
+                        FALSE /* record_fileinfo */,
+                        result_pool, scratch_pool));
+              *work_items = svn_wc__wq_merge(*work_items, work_item,
+                                             result_pool);
+            }
+        }
+
+      return SVN_NO_ERROR;
+    }
+
+  *merge_outcome = svn_wc_merge_no_merge;
+  return SVN_NO_ERROR;
+}
+
+
 /* XXX Insane amount of parameters... */
 static svn_error_t*
 merge_text_file(svn_skel_t **work_items,
@@ -1037,7 +1108,7 @@ merge_text_file(svn_skel_t **work_items,
         }
 
       if (*merge_outcome == svn_wc_merge_merged)
-        return SVN_NO_ERROR;
+        goto done;
     }
   else if (contains_conflicts && dry_run)
       *merge_outcome = svn_wc_merge_conflict;
@@ -1074,6 +1145,7 @@ merge_text_file(svn_skel_t **work_items,
       *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
     }
 
+done:
   /* Remove the tempfile after use */
   SVN_ERR(svn_wc__wq_build_file_remove(&work_item,
                                        mt->db, result_target,
@@ -1111,37 +1183,15 @@ merge_binary_file(svn_skel_t **work_item
   const char *merge_dirpath, *merge_filename;
   const char *conflict_wrk;
   svn_skel_t *work_item;
-  svn_boolean_t same_contents = FALSE;
 
   *work_items = NULL;
 
   svn_dirent_split(&merge_dirpath, &merge_filename, mt->local_abspath, pool);
 
-  /* Attempt to merge the binary file. At the moment, we can only
-     handle the special case: if the LEFT side of the merge is equal
-     to WORKING, then we can copy RIGHT directly. */
-  SVN_ERR(svn_io_files_contents_same_p(&same_contents,
-                                      left_abspath,
-                                      mt->local_abspath,
-                                      scratch_pool));
+  /* If we get here the binary files differ. Because we don't know how
+   * to merge binary files in a non-trivial way we always flag a conflict. */
 
-  if (same_contents)
-    {
-      if (!dry_run)
-        {
-          SVN_ERR(svn_wc__wq_build_file_install(&work_item,
-                                                mt->db, mt->local_abspath,
-                                                right_abspath,
-                                                FALSE /* use_commit_times */,
-                                                FALSE /* record_fileinfo */,
-                                                result_pool, scratch_pool));
-          *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
-        }
-
-      *merge_outcome = svn_wc_merge_merged;
-      return SVN_NO_ERROR;
-    }
-  else if (dry_run)
+  if (dry_run)
     {
       *merge_outcome = svn_wc_merge_conflict;
       return SVN_NO_ERROR;
@@ -1320,7 +1370,6 @@ svn_wc__internal_merge(svn_skel_t **work
                        apr_pool_t *result_pool,
                        apr_pool_t *scratch_pool)
 {
-  apr_pool_t *pool = scratch_pool;  /* ### temporary rename  */
   const char *detranslated_target_abspath;
   svn_boolean_t is_binary = FALSE;
   const svn_prop_t *mimeprop;
@@ -1357,49 +1406,58 @@ svn_wc__internal_merge(svn_skel_t **work
   SVN_ERR(detranslate_wc_file(&detranslated_target_abspath, &mt,
                               (! is_binary) && diff3_cmd != NULL,
                               target_abspath,
-                              cancel_func, cancel_baton, pool, pool));
+                              cancel_func, cancel_baton,
+                              scratch_pool, scratch_pool));
 
   /* We cannot depend on the left file to contain the same eols as the
      right file. If the merge target has mods, this will mark the entire
      file as conflicted, so we need to compensate. */
   SVN_ERR(maybe_update_target_eols(&left_abspath, &mt, left_abspath,
-                                   cancel_func, cancel_baton, pool, pool));
+                                   cancel_func, cancel_baton,
+                                   scratch_pool, scratch_pool));
 
-  if (is_binary)
-    {
-      SVN_ERR(merge_binary_file(work_items,
-                                merge_outcome,
-                                &mt,
-                                left_abspath,
-                                right_abspath,
-                                left_label,
-                                right_label,
-                                target_label,
-                                dry_run,
-                                left_version,
-                                right_version,
-                                detranslated_target_abspath,
-                                conflict_func,
-                                conflict_baton,
-                                result_pool, scratch_pool));
-    }
-  else
+  SVN_ERR(merge_file_trivial(work_items, merge_outcome,
+                             left_abspath, right_abspath,
+                             target_abspath, dry_run, db,
+                             result_pool, scratch_pool));
+  if (*merge_outcome == svn_wc_merge_no_merge)
     {
-      SVN_ERR(merge_text_file(work_items,
-                              merge_outcome,
-                              &mt,
-                              left_abspath,
-                              right_abspath,
-                              left_label,
-                              right_label,
-                              target_label,
-                              dry_run,
-                              left_version,
-                              right_version,
-                              detranslated_target_abspath,
-                              conflict_func, conflict_baton,
-                              cancel_func, cancel_baton,
-                              result_pool, scratch_pool));
+      if (is_binary)
+        {
+          SVN_ERR(merge_binary_file(work_items,
+                                    merge_outcome,
+                                    &mt,
+                                    left_abspath,
+                                    right_abspath,
+                                    left_label,
+                                    right_label,
+                                    target_label,
+                                    dry_run,
+                                    left_version,
+                                    right_version,
+                                    detranslated_target_abspath,
+                                    conflict_func,
+                                    conflict_baton,
+                                    result_pool, scratch_pool));
+        }
+      else
+        {
+          SVN_ERR(merge_text_file(work_items,
+                                  merge_outcome,
+                                  &mt,
+                                  left_abspath,
+                                  right_abspath,
+                                  left_label,
+                                  right_label,
+                                  target_label,
+                                  dry_run,
+                                  left_version,
+                                  right_version,
+                                  detranslated_target_abspath,
+                                  conflict_func, conflict_baton,
+                                  cancel_func, cancel_baton,
+                                  result_pool, scratch_pool));
+        }
     }
 
   /* Merging is complete.  Regardless of text or binariness, we might
@@ -1454,12 +1512,12 @@ svn_wc_merge4(enum svn_wc_merge_outcome_
    * unless the merge target is a copyfrom text, which lives in a
    * temporary file and does not exist in ACTUAL yet. */
   {
-    svn_wc__db_kind_t kind;
+    svn_kind_t kind;
     svn_boolean_t hidden;
     SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, target_abspath, TRUE,
                                  scratch_pool));
 
-    if (kind == svn_wc__db_kind_unknown)
+    if (kind == svn_kind_unknown)
       {
         *merge_outcome = svn_wc_merge_no_merge;
         return SVN_NO_ERROR;

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/node.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/node.c Mon Nov 21 07:07:56 2011
@@ -214,6 +214,8 @@ svn_wc__internal_get_repos_info(const ch
                                        db, local_abspath,
                                        result_pool, scratch_pool));
 
+  SVN_ERR_ASSERT(repos_root_url == NULL || *repos_root_url != NULL);
+  SVN_ERR_ASSERT(repos_uuid == NULL || *repos_uuid != NULL);
   return SVN_NO_ERROR;
 }
 
@@ -235,28 +237,28 @@ svn_wc__node_get_repos_info(const char *
  * even if DB_STATUS indicates that the node is hidden.
  * Else, return svn_kind_none for such nodes.
  *
- * ### This is a bit ugly. We should consider promoting svn_wc__db_kind_t
+ * ### This is a bit ugly. We should consider promoting svn_kind_t
  * ### to the de-facto node kind type instead of converting between them
  * ### in non-backwards compat code.
- * ### See also comments at the definition of svn_wc__db_kind_t. */
+ * ### See also comments at the definition of svn_kind_t. */
 static svn_error_t *
 convert_db_kind_to_node_kind(svn_node_kind_t *node_kind,
-                             svn_wc__db_kind_t db_kind,
+                             svn_kind_t db_kind,
                              svn_wc__db_status_t db_status,
                              svn_boolean_t show_hidden)
 {
   switch (db_kind)
     {
-      case svn_wc__db_kind_file:
+      case svn_kind_file:
         *node_kind = svn_node_file;
         break;
-      case svn_wc__db_kind_dir:
+      case svn_kind_dir:
         *node_kind = svn_node_dir;
         break;
-      case svn_wc__db_kind_symlink:
+      case svn_kind_symlink:
         *node_kind = svn_node_file;
         break;
-      case svn_wc__db_kind_unknown:
+      case svn_kind_unknown:
         *node_kind = svn_node_unknown;
         break;
       default:
@@ -287,7 +289,7 @@ svn_wc_read_kind(svn_node_kind_t *kind,
                  apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t db_status;
-  svn_wc__db_kind_t db_kind;
+  svn_kind_t db_kind;
   svn_error_t *err;
 
   err = svn_wc__db_read_info(&db_status, &db_kind, NULL, NULL, NULL, NULL,
@@ -603,7 +605,7 @@ walker_helper(svn_wc__db_t *db,
     {
       const char *child_name = svn__apr_hash_index_key(hi);
       struct svn_wc__db_walker_info_t *wi = svn__apr_hash_index_val(hi);
-      svn_wc__db_kind_t child_kind = wi->kind;
+      svn_kind_t child_kind = wi->kind;
       svn_wc__db_status_t child_status = wi->status;
       const char *child_abspath;
 
@@ -627,7 +629,7 @@ walker_helper(svn_wc__db_t *db,
           }
 
       /* Return the child, if appropriate. */
-      if ( (child_kind == svn_wc__db_kind_file
+      if ( (child_kind == svn_kind_file
              || depth >= svn_depth_immediates)
            && svn_wc__internal_changelist_match(db, child_abspath,
                                                 changelist_filter,
@@ -646,7 +648,7 @@ walker_helper(svn_wc__db_t *db,
         }
 
       /* Recurse into this directory, if appropriate. */
-      if (child_kind == svn_wc__db_kind_dir
+      if (child_kind == svn_kind_dir
             && depth >= svn_depth_immediates)
         {
           svn_depth_t depth_below_here = depth;
@@ -681,7 +683,7 @@ svn_wc__internal_walk_children(svn_wc__d
                                void *cancel_baton,
                                apr_pool_t *scratch_pool)
 {
-  svn_wc__db_kind_t db_kind;
+  svn_kind_t db_kind;
   svn_node_kind_t kind;
   svn_wc__db_status_t status;
   apr_hash_t *changelist_hash = NULL;
@@ -706,13 +708,13 @@ svn_wc__internal_walk_children(svn_wc__d
                                         changelist_hash, scratch_pool))
     SVN_ERR(walk_callback(local_abspath, kind, walk_baton, scratch_pool));
 
-  if (db_kind == svn_wc__db_kind_file
+  if (db_kind == svn_kind_file
       || status == svn_wc__db_status_not_present
       || status == svn_wc__db_status_excluded
       || status == svn_wc__db_status_server_excluded)
     return SVN_NO_ERROR;
 
-  if (db_kind == svn_wc__db_kind_dir)
+  if (db_kind == svn_kind_dir)
     {
       return svn_error_trace(
         walker_helper(db, local_abspath, show_hidden, changelist_hash,
@@ -1493,7 +1495,7 @@ svn_wc__node_get_commit_status(svn_node_
                                apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t db_kind;
+  svn_kind_t db_kind;
   svn_wc__db_lock_t *lock;
   svn_boolean_t had_props;
   svn_boolean_t props_mod_tmp;
@@ -1517,9 +1519,9 @@ svn_wc__node_get_commit_status(svn_node_
 
   if (kind)
     {
-      if (db_kind == svn_wc__db_kind_file)
+      if (db_kind == svn_kind_file)
         *kind = svn_node_file;
-      else if (db_kind == svn_wc__db_kind_dir)
+      else if (db_kind == svn_kind_dir)
         *kind = svn_node_dir;
       else
         *kind = svn_node_unknown;
@@ -1552,7 +1554,7 @@ svn_wc__node_get_commit_status(svn_node_
       apr_hash_t *props;
       *symlink = FALSE;
 
-      if (db_kind == svn_wc__db_kind_file
+      if (db_kind == svn_kind_file
           && (had_props || *props_mod))
         {
           SVN_ERR(svn_wc__db_read_props(&props, wc_ctx->db, local_abspath,
@@ -1653,7 +1655,7 @@ svn_wc__check_for_obstructions(svn_wc_no
                                apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t db_kind;
+  svn_kind_t db_kind;
   svn_node_kind_t disk_kind;
   svn_error_t *err;
 
@@ -1703,7 +1705,7 @@ svn_wc__check_for_obstructions(svn_wc_no
       else
         SVN_ERR(err);
 
-      if (db_kind != svn_wc__db_kind_dir
+      if (db_kind != svn_kind_dir
           || (status != svn_wc__db_status_normal
               && status != svn_wc__db_status_added))
         {
@@ -1718,7 +1720,7 @@ svn_wc__check_for_obstructions(svn_wc_no
 
   /* Check for obstructing working copies */
   if (!no_wcroot_check
-      && db_kind == svn_wc__db_kind_dir
+      && db_kind == svn_kind_dir
       && status == svn_wc__db_status_normal)
     {
       svn_boolean_t is_root;

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/props.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/props.c Mon Nov 21 07:07:56 2011
@@ -145,8 +145,8 @@ diff_mergeinfo_props(svn_mergeinfo_t *de
       svn_mergeinfo_t from, to;
       SVN_ERR(svn_mergeinfo_parse(&from, from_prop_val->data, pool));
       SVN_ERR(svn_mergeinfo_parse(&to, to_prop_val->data, pool));
-      SVN_ERR(svn_mergeinfo_diff(deleted, added, from, to,
-                                 TRUE, pool));
+      SVN_ERR(svn_mergeinfo_diff2(deleted, added, from, to,
+                                  TRUE, pool, pool));
     }
   return SVN_NO_ERROR;
 }
@@ -167,7 +167,8 @@ combine_mergeinfo_props(const svn_string
 
   SVN_ERR(svn_mergeinfo_parse(&mergeinfo1, prop_val1->data, scratch_pool));
   SVN_ERR(svn_mergeinfo_parse(&mergeinfo2, prop_val2->data, scratch_pool));
-  SVN_ERR(svn_mergeinfo_merge(mergeinfo1, mergeinfo2, scratch_pool));
+  SVN_ERR(svn_mergeinfo_merge2(mergeinfo1, mergeinfo2, scratch_pool,
+                               scratch_pool));
   SVN_ERR(svn_mergeinfo_to_string(&mergeinfo_string, mergeinfo1, result_pool));
   *output = mergeinfo_string;
   return SVN_NO_ERROR;
@@ -181,27 +182,33 @@ combine_forked_mergeinfo_props(const svn
                                const svn_string_t *from_prop_val,
                                const svn_string_t *working_prop_val,
                                const svn_string_t *to_prop_val,
-                               apr_pool_t *pool)
+                               apr_pool_t *result_pool,
+                               apr_pool_t *scratch_pool)
 {
   svn_mergeinfo_t from_mergeinfo, l_deleted, l_added, r_deleted, r_added;
   svn_string_t *mergeinfo_string;
 
   /* ### OPTIMIZE: Use from_mergeinfo when diff'ing. */
   SVN_ERR(diff_mergeinfo_props(&l_deleted, &l_added, from_prop_val,
-                               working_prop_val, pool));
+                               working_prop_val, scratch_pool));
   SVN_ERR(diff_mergeinfo_props(&r_deleted, &r_added, from_prop_val,
-                               to_prop_val, pool));
-  SVN_ERR(svn_mergeinfo_merge(l_deleted, r_deleted, pool));
-  SVN_ERR(svn_mergeinfo_merge(l_added, r_added, pool));
+                               to_prop_val, scratch_pool));
+  SVN_ERR(svn_mergeinfo_merge2(l_deleted, r_deleted,
+                               scratch_pool, scratch_pool));
+  SVN_ERR(svn_mergeinfo_merge2(l_added, r_added,
+                               scratch_pool, scratch_pool));
 
   /* Apply the combined deltas to the base. */
-  SVN_ERR(svn_mergeinfo_parse(&from_mergeinfo, from_prop_val->data, pool));
-  SVN_ERR(svn_mergeinfo_merge(from_mergeinfo, l_added, pool));
+  SVN_ERR(svn_mergeinfo_parse(&from_mergeinfo, from_prop_val->data,
+                              scratch_pool));
+  SVN_ERR(svn_mergeinfo_merge2(from_mergeinfo, l_added,
+                               scratch_pool, scratch_pool));
 
-  SVN_ERR(svn_mergeinfo_remove2(&from_mergeinfo, l_deleted,
-                                from_mergeinfo, TRUE, pool, pool));
+  SVN_ERR(svn_mergeinfo_remove2(&from_mergeinfo, l_deleted, from_mergeinfo,
+                                TRUE, scratch_pool, scratch_pool));
 
-  SVN_ERR(svn_mergeinfo_to_string(&mergeinfo_string, from_mergeinfo, pool));
+  SVN_ERR(svn_mergeinfo_to_string(&mergeinfo_string, from_mergeinfo,
+                                  result_pool));
   *output = mergeinfo_string;
   return SVN_NO_ERROR;
 }
@@ -225,7 +232,7 @@ svn_wc__perform_props_merge(svn_wc_notif
 {
   int i;
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   apr_hash_t *pristine_props = NULL;
   apr_hash_t *actual_props = NULL;
   apr_hash_t *new_pristine_props;
@@ -315,7 +322,7 @@ svn_wc__perform_props_merge(svn_wc_notif
   {
     const char *dir_abspath;
 
-    if (kind == svn_wc__db_kind_dir)
+    if (kind == svn_kind_dir)
       dir_abspath = local_abspath;
     else
       dir_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
@@ -588,9 +595,9 @@ prop_conflict_from_skel(const svn_string
                                   incoming_base, scratch_pool);
 
   if (mine == NULL)
-    mine = svn_string_create("", scratch_pool);
+    mine = svn_string_create_empty(scratch_pool);
   if (incoming == NULL)
-    incoming = svn_string_create("", scratch_pool);
+    incoming = svn_string_create_empty(scratch_pool);
 
   /* Pick a suitable base for the conflict diff.
    * The incoming value is always a change,
@@ -600,7 +607,7 @@ prop_conflict_from_skel(const svn_string
       if (incoming_base)
         original = incoming_base;
       else
-        original = svn_string_create("", scratch_pool);
+        original = svn_string_create_empty(scratch_pool);
     }
   else if (incoming_base && svn_string_compare(original, mine))
     original = incoming_base;
@@ -1296,7 +1303,8 @@ apply_single_mergeinfo_prop_change(svn_w
                   SVN_ERR(combine_forked_mergeinfo_props(&new_val, old_val,
                                                          working_val,
                                                          new_val,
-                                                         result_pool));
+                                                         result_pool,
+                                                         scratch_pool));
                   apr_hash_set(working_props, propname,
                                APR_HASH_KEY_STRING, new_val);
                   set_prop_merge_state(state, svn_wc_notify_state_merged);
@@ -1348,7 +1356,8 @@ apply_single_mergeinfo_prop_change(svn_w
                  them to base to get the new value. */
               SVN_ERR(combine_forked_mergeinfo_props(&new_val, old_val,
                                                      working_val,
-                                                     new_val, result_pool));
+                                                     new_val, result_pool,
+                                                     scratch_pool));
               apr_hash_set(working_props, propname,
                            APR_HASH_KEY_STRING, new_val);
               set_prop_merge_state(state, svn_wc_notify_state_merged);
@@ -1532,7 +1541,7 @@ svn_wc__merge_props(svn_skel_t **work_it
                     apr_hash_t **new_actual_props,
                     svn_wc__db_t *db,
                     const char *local_abspath,
-                    svn_wc__db_kind_t kind,
+                    svn_kind_t kind,
                     const svn_wc_conflict_version_t *left_version,
                     const svn_wc_conflict_version_t *right_version,
                     apr_hash_t *server_baseprops,
@@ -1561,7 +1570,7 @@ svn_wc__merge_props(svn_skel_t **work_it
   *new_pristine_props = NULL;
   *new_actual_props = NULL;
 
-  is_dir = (kind == svn_wc__db_kind_dir);
+  is_dir = (kind == svn_kind_dir);
 
   if (!server_baseprops)
     server_baseprops = pristine_props;
@@ -2421,7 +2430,7 @@ svn_wc_prop_set4(svn_wc_context_t *wc_ct
                  apr_pool_t *scratch_pool)
 {
   enum svn_prop_kind prop_kind = svn_property_kind(NULL, name);
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   const char *dir_abspath;
 
   /* we don't do entry properties here */
@@ -2445,7 +2454,7 @@ svn_wc_prop_set4(svn_wc_context_t *wc_ct
   SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, local_abspath, TRUE,
                                scratch_pool));
 
-  if (kind == svn_wc__db_kind_dir)
+  if (kind == svn_kind_dir)
     dir_abspath = local_abspath;
   else
     dir_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
@@ -2465,7 +2474,7 @@ svn_wc_prop_set4(svn_wc_context_t *wc_ct
         return SVN_NO_ERROR;
 
       SVN_ERR(do_propset(wc_ctx->db, local_abspath,
-                         kind == svn_wc__db_kind_dir
+                         kind == svn_kind_dir
                             ? svn_node_dir
                             : svn_node_file,
                          name, value, skip_checks,

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/props.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/props.h?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/props.h (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/props.h Mon Nov 21 07:07:56 2011
@@ -45,7 +45,7 @@ extern "C" {
    For 1.7, we're removing this support. Some old code is being left around
    in case we decide to change this.
 
-   For more information, see ^/notes/api-errata/wc006.txt
+   For more information, see ^/notes/api-errata/1.7/wc006.txt
 */
 #undef SVN__SUPPORT_BASE_MERGE
 
@@ -106,7 +106,7 @@ svn_wc__merge_props(svn_skel_t **work_it
                     apr_hash_t **new_actual_props,
                     svn_wc__db_t *db,
                     const char *local_abspath,
-                    svn_wc__db_kind_t kind,
+                    svn_kind_t kind,
                     const svn_wc_conflict_version_t *left_version,
                     const svn_wc_conflict_version_t *right_version,
                     apr_hash_t *server_baseprops,

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/questions.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/questions.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/questions.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/questions.c Mon Nov 21 07:07:56 2011
@@ -244,7 +244,7 @@ svn_wc__internal_file_modified_p(svn_boo
   svn_stream_t *pristine_stream;
   svn_filesize_t pristine_size;
   svn_wc__db_status_t status;
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   const svn_checksum_t *checksum;
   svn_filesize_t recorded_size;
   apr_time_t recorded_mod_time;
@@ -265,7 +265,7 @@ svn_wc__internal_file_modified_p(svn_boo
   /* If we don't have a pristine or the node has a status that allows a
      pristine, just say that the node is modified */
   if (!checksum
-      || (kind != svn_wc__db_kind_file)
+      || (kind != svn_kind_file)
       || ((status != svn_wc__db_status_normal)
           && (status != svn_wc__db_status_added)))
     {
@@ -394,7 +394,7 @@ svn_wc__internal_conflicted_p(svn_boolea
                               apr_pool_t *scratch_pool)
 {
   svn_node_kind_t kind;
-  svn_wc__db_kind_t node_kind;
+  svn_kind_t node_kind;
   const apr_array_header_t *conflicts;
   int i;
   svn_boolean_t conflicted;

Modified: subversion/branches/svn-bisect/subversion/libsvn_wc/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_wc/relocate.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_wc/relocate.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_wc/relocate.c Mon Nov 21 07:07:56 2011
@@ -85,7 +85,7 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
                  void *validator_baton,
                  apr_pool_t *scratch_pool)
 {
-  svn_wc__db_kind_t kind;
+  svn_kind_t kind;
   const char *repos_relpath;
   const char *old_repos_root, *old_url;
   const char *new_repos_root, *new_url;
@@ -131,7 +131,7 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
                                wc_ctx->db, local_abspath, scratch_pool,
                                scratch_pool));
 
-  if (kind != svn_wc__db_kind_dir)
+  if (kind != svn_kind_dir)
     return svn_error_create(SVN_ERR_CLIENT_INVALID_RELOCATION, NULL,
                             _("Cannot relocate a single file"));
 



Mime
View raw message