Alien-SVN

 view release on metacpan or  search on metacpan

src/subversion/subversion/libsvn_client/merge.c  view on Meta::CPAN

              SVN_ERR(do_directory_merge(result_catalog, &conflicted_range_report,
                                         source, target->abspath,
                                         processor,
                                         depth, squelch_mergeinfo_notifications,
                                         &merge_cmd_baton, iterpool, iterpool));
            }

          /* Give the conflict resolver callback the opportunity to
           * resolve any conflicts that were raised.  If it resolves all
           * of them, go around again to merge the next sub-range (if any). */
          if (conflicted_range_report && ctx->conflict_func2 && ! dry_run)
            {
              svn_boolean_t conflicts_remain;

              SVN_ERR(svn_client__resolve_conflicts(
                        &conflicts_remain, merge_cmd_baton.conflicted_paths,
                        ctx, iterpool));
              if (conflicts_remain)
                break;

              merge_cmd_baton.conflicted_paths = NULL;
              /* Caution: this source is in iterpool */
              source = conflicted_range_report->remaining_source;
              conflicted_range_report = NULL;
            }
          else
            break;
        }
      while (source);

      /* The final mergeinfo on TARGET_WCPATH may itself elide. */
      if (! dry_run)
        SVN_ERR(svn_client__elide_mergeinfo(target->abspath, NULL,
                                            ctx, iterpool));

      /* If conflicts occurred while merging any but the very last
       * range of a multi-pass merge, we raise an error that aborts
       * the merge. The user will be asked to resolve conflicts
       * before merging subsequent revision ranges. */
      if (conflicted_range_report)
        {
          *conflict_report = conflict_report_create(
                               target->abspath, conflicted_range_report->conflicted_range,
                               (i == merge_sources->nelts - 1
                                && ! conflicted_range_report->remaining_source),
                               result_pool);
          break;
        }
    }

  if (! *conflict_report || (*conflict_report)->was_last_range)
    {
      /* Let everyone know we're finished here. */
      notify_merge_completed(target->abspath, ctx, iterpool);
    }

  /* Does the caller want to know what the merge has done? */
  if (modified_subtrees)
    {
      *modified_subtrees =
          apr_hash_overlay(result_pool, *modified_subtrees,
                           merge_cmd_baton.merged_abspaths);
      *modified_subtrees =
          apr_hash_overlay(result_pool, *modified_subtrees,
                           merge_cmd_baton.added_abspaths);
      *modified_subtrees =
          apr_hash_overlay(result_pool, *modified_subtrees,
                           merge_cmd_baton.skipped_abspaths);
      *modified_subtrees =
          apr_hash_overlay(result_pool, *modified_subtrees,
                           merge_cmd_baton.tree_conflicted_abspaths);
    }

  if (src_session)
    SVN_ERR(svn_ra_reparent(src_session, old_src_session_url, iterpool));

  svn_pool_destroy(iterpool);
  return SVN_NO_ERROR;
}

/* Perform a two-URL merge between URLs which are related, but neither
   is a direct ancestor of the other.  This first does a real two-URL
   merge (unless this is record-only), followed by record-only merges
   to represent the changed mergeinfo.

   Set *CONFLICT_REPORT to indicate if there were any conflicts, as in
   do_merge().

   The diff to be merged is between SOURCE->loc1 (in URL1_RA_SESSION1)
   and SOURCE->loc2 (in URL2_RA_SESSION2); YCA is their youngest
   common ancestor.

   SAME_REPOS must be true if and only if the source URLs are in the same
   repository as the target working copy.

   DIFF_IGNORE_ANCESTRY is as in do_merge().

   Other arguments are as in all of the public merge APIs.

   *USE_SLEEP will be set TRUE if a sleep is required to ensure timestamp
   integrity, *USE_SLEEP will be unchanged if no sleep is required.

   SCRATCH_POOL is used for all temporary allocations.
 */
static svn_error_t *
merge_cousins_and_supplement_mergeinfo(conflict_report_t **conflict_report,
                                       svn_boolean_t *use_sleep,
                                       const merge_target_t *target,
                                       svn_ra_session_t *URL1_ra_session,
                                       svn_ra_session_t *URL2_ra_session,
                                       const merge_source_t *source,
                                       const svn_client__pathrev_t *yca,
                                       svn_boolean_t same_repos,
                                       svn_depth_t depth,
                                       svn_boolean_t diff_ignore_ancestry,
                                       svn_boolean_t force_delete,
                                       svn_boolean_t record_only,
                                       svn_boolean_t dry_run,
                                       const apr_array_header_t *merge_options,
                                       svn_client_ctx_t *ctx,
                                       apr_pool_t *result_pool,
                                       apr_pool_t *scratch_pool)
{
  apr_array_header_t *remove_sources, *add_sources;
  apr_hash_t *modified_subtrees = NULL;

  /* Sure we could use SCRATCH_POOL throughout this function, but since this
     is a wrapper around three separate merges we'll create a subpool we can
     clear between each of the three.  If the merge target has a lot of
     subtree mergeinfo, then this will help keep memory use in check. */



( run in 4.064 seconds using v1.01-cache-2.11-cpan-22024b96cdf )