FreeBSD/contrib/subversion/subversion/libsvn_fs_x/tree.c
/* Merge changes between an ancestor and SOURCE_NODE into
   TXN.  The ancestor is either ANCESTOR_NODE, or if
   that is null, TXN's base node.

   If the merge is successful, TXN's base will become
   SOURCE_NODE, and its root node will have a new ID, a
   successor of SOURCE_NODE.

   If a conflict results, update *CONFLICT to the path in the txn that
   conflicted; see the CONFLICT_P parameter of merge() for details. */
Merge changes between an ancestor and SOURCE_NODE into
TXN.  The ancestor is either ANCESTOR_NODE, or if
that is null, TXN's base node.

If the merge is successful, TXN's base will become
SOURCE_NODE, and its root node will have a new ID, a
successor of SOURCE_NODE.

If a conflict results, update *CONFLICT to the path in the txn that
conflicted; see the CONFLICT_P parameter of merge() for details.
Merge changes between an ancestor and SOURCE_NODE into TXN . The ancestor is either ANCESTOR_NODE or if that is null TXN ' s base node . If the merge is successful TXN ' s base will become SOURCE_NODE and its root node will have a new ID a successor of SOURCE_NODE . If a conflict results update * CONFLICT to the path in the txn that conflicted ; see the CONFLICT_P parameter of merge () for details .
static svn_error_t *
merge_changes(dag_node_t *ancestor_node,
              dag_node_t *source_node,
              svn_fs_txn_t *txn,
              svn_stringbuf_t *conflict,
              apr_pool_t *scratch_pool)
{
  dag_node_t *txn_root_node;
  svn_fs_t *fs = txn->fs;
  svn_fs_x__txn_id_t txn_id = svn_fs_x__txn_get_id(txn);
  svn_boolean_t related;
  SVN_ERR(svn_fs_x__dag_txn_root(&txn_root_node, fs, txn_id, scratch_pool,
                                 scratch_pool));
  if (ancestor_node == NULL)
    {
      svn_revnum_t base_rev;
      SVN_ERR(svn_fs_x__get_base_rev(&base_rev, fs, txn_id, scratch_pool));
      SVN_ERR(svn_fs_x__dag_revision_root(&ancestor_node, fs, base_rev,
                                          scratch_pool, scratch_pool));
    }
  SVN_ERR(svn_fs_x__dag_related_node(&related, ancestor_node, txn_root_node));
  if (!related)
    {
      SVN_ERR_MALFUNCTION();
    }
  else
    SVN_ERR(merge(conflict, "/", txn_root_node,
                  source_node, ancestor_node, txn_id, NULL, scratch_pool));
  return SVN_NO_ERROR;
}
static svn_error_t * merge_changes ( dag_node_t * ancestor_node , dag_node_t * source_node , svn_fs_txn_t * txn , svn_stringbuf_t * conflict , apr_pool_t * scratch_pool ) { dag_node_t * txn_root_node ; svn_fs_t * fs = txn -> fs ; svn_fs_x__txn_id_t txn_id = svn_fs_x__txn_get_id ( txn ) ; svn_boolean_t related ; SVN_ERR ( svn_fs_x__dag_txn_root ( & txn_root_node , fs , txn_id , scratch_pool , scratch_pool ) ) ; if ( ancestor_node == NULL ) { svn_revnum_t base_rev ; SVN_ERR ( svn_fs_x__get_base_rev ( & base_rev , fs , txn_id , scratch_pool ) ) ; SVN_ERR ( svn_fs_x__dag_revision_root ( & ancestor_node , fs , base_rev , scratch_pool , scratch_pool ) ) ; } SVN_ERR ( svn_fs_x__dag_related_node ( & related , ancestor_node , txn_root_node ) ) ; if ( ! related ) { SVN_ERR_MALFUNCTION ( ) ; } else SVN_ERR ( merge ( conflict , " " , txn_root_node , source_node , ancestor_node , txn_id , NULL , scratch_pool ) ) ; return SVN_NO_ERROR ; }
Merge changes between an ancestor and SOURCE_NODE into
TXN.
Merge changes between an ancestor and SOURCE_NODE into TXN .
/* If no changes have been made in TXN since its current base,
         then it can't conflict with any changes since that base.
         The caller isn't supposed to call us in that case. */