subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1764284 - /subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c
Date Tue, 11 Oct 2016 16:08:26 GMT
Author: stsp
Date: Tue Oct 11 16:08:25 2016
New Revision: 1764284

URL: http://svn.apache.org/viewvc?rev=1764284&view=rev
Log:
On the 'resolve-incoming-add' branch: Remove unnecessary code.

* subversion/libsvn_client/conflicts.c
  (diff_dir_changed, diff_dir_deleted, diff_file_changed,
   diff_file_deleted): Remove. Since we're diffing an empty tree against
    an added tree, these should never be invoked.
  (merge_newly_added_dir): Only set the diff processor callbacks we need.
   The diff processor already provides stubs for the rest.

Modified:
    subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c

Modified: subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c?rev=1764284&r1=1764283&r2=1764284&view=diff
==============================================================================
--- subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c (original)
+++ subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c Tue Oct
11 16:08:25 2016
@@ -5732,141 +5732,6 @@ diff_dir_added(const char *relpath,
 
 /* An svn_diff_tree_processor_t callback. */
 static svn_error_t *
-diff_dir_changed(const char *relpath,
-                 const svn_diff_source_t *left_source,
-                 const svn_diff_source_t *right_source,
-                 apr_hash_t *left_props,
-                 apr_hash_t *right_props,
-                 const apr_array_header_t *prop_changes,
-                 void *dir_baton,
-                 const struct svn_diff_tree_processor_t *processor,
-                 apr_pool_t *scratch_pool)
-{
-  struct merge_newly_added_dir_baton *b = processor->baton;
-  const char *local_abspath;
-  svn_node_kind_t db_kind;
-  svn_node_kind_t on_disk_kind;
-
-  local_abspath = svn_dirent_join(b->target_abspath, relpath, scratch_pool);
-
-  SVN_ERR(svn_wc_read_kind2(&db_kind, b->ctx->wc_ctx, local_abspath,
-                            FALSE, FALSE, scratch_pool));
-  SVN_ERR(svn_io_check_path(local_abspath, &on_disk_kind, scratch_pool));
-
-  if (db_kind != svn_node_dir)
-    {
-      SVN_ERR(raise_tree_conflict(
-                local_abspath, svn_wc_conflict_action_edit,
-                svn_wc_conflict_reason_obstructed,
-                db_kind, svn_node_dir, svn_node_dir,
-                b->repos_root_url, b->repos_uuid,
-                svn_relpath_join(b->added_repos_relpath, relpath, scratch_pool),
-                b->merge_left_rev, b->merge_right_rev,
-                b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-                scratch_pool));
-      return SVN_NO_ERROR;
-    }
-
-  if (on_disk_kind == svn_node_none)
-    {
-      SVN_ERR(raise_tree_conflict(
-                local_abspath, svn_wc_conflict_action_edit,
-                svn_wc_conflict_reason_missing, on_disk_kind,
-                svn_node_dir, svn_node_dir, b->repos_root_url, b->repos_uuid,
-                svn_relpath_join(b->added_repos_relpath, relpath, scratch_pool),
-                b->merge_left_rev, b->merge_right_rev,
-                b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-                scratch_pool));
-      return SVN_NO_ERROR;
-    }
-  else if (on_disk_kind != svn_node_dir)
-    {
-      SVN_ERR(raise_tree_conflict(
-                local_abspath, svn_wc_conflict_action_edit,
-                svn_wc_conflict_reason_obstructed, on_disk_kind,
-                svn_node_dir, svn_node_dir, b->repos_root_url, b->repos_uuid,
-                svn_relpath_join(b->added_repos_relpath, relpath, scratch_pool),
-                b->merge_left_rev, b->merge_right_rev,
-                b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-                scratch_pool));
-      return SVN_NO_ERROR;
-    }
-
-  return SVN_NO_ERROR;
-}
-
-/* An svn_diff_tree_processor_t callback. */
-static svn_error_t *
-diff_dir_deleted(const char *relpath,
-                 const svn_diff_source_t *left_source,
-                 apr_hash_t *left_props,
-                 void *dir_baton,
-                 const struct svn_diff_tree_processor_t *processor,
-                 apr_pool_t *scratch_pool)
-{
-  struct merge_newly_added_dir_baton *b = processor->baton;
-  const char *local_abspath;
-  svn_node_kind_t db_kind;
-  svn_node_kind_t on_disk_kind;
-
-  local_abspath = svn_dirent_join(b->target_abspath, relpath, scratch_pool);
-
-  SVN_ERR(svn_wc_read_kind2(&db_kind, b->ctx->wc_ctx, local_abspath,
-                            FALSE, FALSE, scratch_pool));
-  SVN_ERR(svn_io_check_path(local_abspath, &on_disk_kind, scratch_pool));
-
-  if (db_kind != svn_node_dir)
-    {
-      svn_wc_conflict_reason_t local_change;
-
-      if (db_kind != svn_node_none && db_kind != svn_node_unknown)
-        local_change = svn_wc_conflict_reason_obstructed;
-      else
-        local_change = svn_wc_conflict_reason_missing;
-
-      SVN_ERR(raise_tree_conflict(
-                local_abspath, svn_wc_conflict_action_delete,
-                local_change, db_kind, svn_node_dir, svn_node_none,
-                b->repos_root_url, b->repos_uuid,
-                svn_relpath_join(b->added_repos_relpath, relpath, scratch_pool),
-                b->merge_left_rev, b->merge_right_rev,
-                b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-                scratch_pool));
-      return SVN_NO_ERROR;
-    }
-
-  if (on_disk_kind != svn_node_dir)
-    {
-      SVN_ERR(raise_tree_conflict(
-                local_abspath, svn_wc_conflict_action_delete,
-                svn_wc_conflict_reason_obstructed, on_disk_kind,
-                svn_node_dir, svn_node_none,
-                b->repos_root_url, b->repos_uuid,
-                svn_relpath_join(b->added_repos_relpath, relpath, scratch_pool),
-                b->merge_left_rev, b->merge_right_rev,
-                b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-                scratch_pool));
-      return SVN_NO_ERROR;
-    }
-  else if (on_disk_kind == svn_node_none)
-    {
-      SVN_ERR(raise_tree_conflict(
-                local_abspath, svn_wc_conflict_action_delete,
-                svn_wc_conflict_reason_missing, on_disk_kind,
-                svn_node_dir, svn_node_none,
-                b->repos_root_url, b->repos_uuid,
-                svn_relpath_join(b->added_repos_relpath, relpath, scratch_pool),
-                b->merge_left_rev, b->merge_right_rev,
-                b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-                scratch_pool));
-      return SVN_NO_ERROR;
-    }
-
-  return SVN_NO_ERROR;
-}
-
-/* An svn_diff_tree_processor_t callback. */
-static svn_error_t *
 diff_file_added(const char *relpath,
                 const svn_diff_source_t *copyfrom_source,
                 const svn_diff_source_t *right_source,
@@ -5931,145 +5796,6 @@ diff_file_added(const char *relpath,
   return SVN_NO_ERROR;
 }
 
-/* An svn_diff_tree_processor_t callback. */
-static svn_error_t *
-diff_file_changed(const char *relpath,
-                  const svn_diff_source_t *left_source,
-                  const svn_diff_source_t *right_source,
-                  const char *left_file,
-                  const char *right_file,
-                  apr_hash_t *left_props,
-                  apr_hash_t *right_props,
-                  svn_boolean_t file_modified,
-                  const apr_array_header_t *prop_changes,
-                  void *file_baton,
-                  const struct svn_diff_tree_processor_t *processor,
-                  apr_pool_t *scratch_pool)
-{
-  struct merge_newly_added_dir_baton *b = processor->baton;
-  const char *local_abspath;
-  svn_node_kind_t db_kind;
-  svn_node_kind_t on_disk_kind;
-
-  local_abspath = svn_dirent_join(b->target_abspath, relpath, scratch_pool);
-
-  SVN_ERR(svn_wc_read_kind2(&db_kind, b->ctx->wc_ctx, local_abspath,
-                            FALSE, FALSE, scratch_pool));
-  SVN_ERR(svn_io_check_path(local_abspath, &on_disk_kind, scratch_pool));
-
-  if (db_kind != svn_node_file)
-    {
-      SVN_ERR(raise_tree_conflict(
-                local_abspath, svn_wc_conflict_action_edit,
-                svn_wc_conflict_reason_obstructed,
-                db_kind, svn_node_file, svn_node_file,
-                b->repos_root_url, b->repos_uuid,
-                svn_relpath_join(b->added_repos_relpath, relpath, scratch_pool),
-                b->merge_left_rev, b->merge_right_rev,
-                b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-                scratch_pool));
-      return SVN_NO_ERROR;
-    }
-
-  if (on_disk_kind == svn_node_none)
-    {
-      SVN_ERR(raise_tree_conflict(
-                local_abspath, svn_wc_conflict_action_edit,
-                svn_wc_conflict_reason_missing, on_disk_kind,
-                svn_node_file, svn_node_file, b->repos_root_url, b->repos_uuid,
-                svn_relpath_join(b->added_repos_relpath, relpath, scratch_pool),
-                b->merge_left_rev, b->merge_right_rev,
-                b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-                scratch_pool));
-      return SVN_NO_ERROR;
-    }
-  else if (on_disk_kind != svn_node_file)
-    {
-      SVN_ERR(raise_tree_conflict(
-                local_abspath, svn_wc_conflict_action_edit,
-                svn_wc_conflict_reason_obstructed, on_disk_kind,
-                svn_node_file, svn_node_file, b->repos_root_url, b->repos_uuid,
-                svn_relpath_join(b->added_repos_relpath, relpath, scratch_pool),
-                b->merge_left_rev, b->merge_right_rev,
-                b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-                scratch_pool));
-      return SVN_NO_ERROR;
-    }
-
-  return SVN_NO_ERROR;
-}
-
-/* An svn_diff_tree_processor_t callback. */
-static svn_error_t *
-diff_file_deleted(const char *relpath,
-                  const svn_diff_source_t *left_source,
-                  const char *left_file,
-                  apr_hash_t *left_props,
-                  void *file_baton,
-                  const struct svn_diff_tree_processor_t *processor,
-                  apr_pool_t *scratch_pool)
-{
-  struct merge_newly_added_dir_baton *b = processor->baton;
-  const char *local_abspath;
-  svn_node_kind_t db_kind;
-  svn_node_kind_t on_disk_kind;
-
-  local_abspath = svn_dirent_join(b->target_abspath, relpath, scratch_pool);
-
-  SVN_ERR(svn_wc_read_kind2(&db_kind, b->ctx->wc_ctx, local_abspath,
-                            FALSE, FALSE, scratch_pool));
-  SVN_ERR(svn_io_check_path(local_abspath, &on_disk_kind, scratch_pool));
-
-  if (db_kind != svn_node_file)
-    {
-      svn_wc_conflict_reason_t local_change;
-
-      if (db_kind != svn_node_none && db_kind != svn_node_unknown)
-        local_change = svn_wc_conflict_reason_obstructed;
-      else
-        local_change = svn_wc_conflict_reason_missing;
-
-      SVN_ERR(raise_tree_conflict(
-                local_abspath, svn_wc_conflict_action_delete,
-                local_change, db_kind, svn_node_file, svn_node_none,
-                b->repos_root_url, b->repos_uuid,
-                svn_relpath_join(b->added_repos_relpath, relpath, scratch_pool),
-                b->merge_left_rev, b->merge_right_rev,
-                b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-                scratch_pool));
-      return SVN_NO_ERROR;
-    }
-
-  if (on_disk_kind != svn_node_file)
-    {
-      SVN_ERR(raise_tree_conflict(
-                local_abspath, svn_wc_conflict_action_delete,
-                svn_wc_conflict_reason_obstructed, on_disk_kind,
-                svn_node_file, svn_node_none,
-                b->repos_root_url, b->repos_uuid,
-                svn_relpath_join(b->added_repos_relpath, relpath, scratch_pool),
-                b->merge_left_rev, b->merge_right_rev, b->ctx->wc_ctx,
-                b->ctx->notify_func2, b->ctx->notify_baton2,
-                scratch_pool));
-      return SVN_NO_ERROR;
-    }
-  else if (on_disk_kind == svn_node_none)
-    {
-      SVN_ERR(raise_tree_conflict(
-                local_abspath, svn_wc_conflict_action_delete,
-                svn_wc_conflict_reason_missing, on_disk_kind,
-                svn_node_file, svn_node_none,
-                b->repos_root_url, b->repos_uuid,
-                svn_relpath_join(b->added_repos_relpath, relpath, scratch_pool),
-                b->merge_left_rev, b->merge_right_rev,
-                b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-                scratch_pool));
-      return SVN_NO_ERROR;
-    }
-
-  return SVN_NO_ERROR;
-}
-
 /* Merge a newly added directory into TARGET_ABSPATH in the working copy.
  *
  * This uses a diff-tree processor because our standard merge operation
@@ -6123,11 +5849,7 @@ merge_newly_added_dir(svn_client__confli
 
   processor = svn_diff__tree_processor_create(&baton, scratch_pool);
   processor->dir_added = diff_dir_added;
-  processor->dir_changed = diff_dir_changed;
-  processor->dir_deleted = diff_dir_deleted;
   processor->file_added = diff_file_added;
-  processor->file_changed = diff_file_changed;
-  processor->file_deleted = diff_file_deleted;
 
   diff_processor = processor;
   if (reverse_merge)



Mime
View raw message