FreeBSD/contrib/subversion/subversion/libsvn_wc/wc_db_update_move.c
/* In our merge conflicts we record the move_op_src path, which is essentially
   the depth at which what was moved is marked deleted. The problem is that
   this depth is not guaranteed to be stable, because somebody might just
   remove another ancestor, or revert one.

   To work around this problem we locate the layer below this path, and use
   that to pinpoint whatever is moved.

   For a path SRC_RELPATH that was deleted by an operation rooted at
   DELETE_OP_DEPTH find the op-depth at which the node was originally added.
   */
In our merge conflicts we record the move_op_src path, which is essentially
the depth at which what was moved is marked deleted. The problem is that
this depth is not guaranteed to be stable, because somebody might just
remove another ancestor, or revert one.

To work around this problem we locate the layer below this path, and use
that to pinpoint whatever is moved.

For a path SRC_RELPATH that was deleted by an operation rooted at
DELETE_OP_DEPTH find the op-depth at which the node was originally added.
In our merge conflicts we record the move_op_src path which is essentially the depth at which what was moved is marked deleted . The problem is that this depth is not guaranteed to be stable because somebody might just remove another ancestor or revert one . To work around this problem we locate the layer below this path and use that to pinpoint whatever is moved . For a path SRC_RELPATH that was deleted by an operation rooted at DELETE_OP_DEPTH find the op - depth at which the node was originally added .
static svn_error_t *
find_src_op_depth(int *src_op_depth,
                  svn_wc__db_wcroot_t *wcroot,
                  const char *src_relpath,
                  int delete_op_depth,
                  apr_pool_t *scratch_pool)
{
  svn_sqlite__stmt_t *stmt;
  svn_boolean_t have_row;
  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                    STMT_SELECT_HIGHEST_WORKING_NODE));
  SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id,
                            src_relpath, delete_op_depth));
  SVN_ERR(svn_sqlite__step(&have_row, stmt));
  if (have_row)
    *src_op_depth = svn_sqlite__column_int(stmt, 0);
  SVN_ERR(svn_sqlite__reset(stmt));
  if (!have_row)
    return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
                              _("'%s' is not deleted"),
                              path_for_error_message(wcroot, src_relpath,
                                                    scratch_pool));
  return SVN_NO_ERROR;
}
static svn_error_t * find_src_op_depth ( int * src_op_depth , svn_wc__db_wcroot_t * wcroot , const char * src_relpath , int delete_op_depth , apr_pool_t * scratch_pool ) { svn_sqlite__stmt_t * stmt ; svn_boolean_t have_row ; SVN_ERR ( svn_sqlite__get_statement ( & stmt , wcroot -> sdb , STMT_SELECT_HIGHEST_WORKING_NODE ) ) ; SVN_ERR ( svn_sqlite__bindf ( stmt , " " , wcroot -> wc_id , src_relpath , delete_op_depth ) ) ; SVN_ERR ( svn_sqlite__step ( & have_row , stmt ) ) ; if ( have_row ) * src_op_depth = svn_sqlite__column_int ( stmt , 0 ) ; SVN_ERR ( svn_sqlite__reset ( stmt ) ) ; if ( ! have_row ) return svn_error_createf ( SVN_ERR_WC_PATH_UNEXPECTED_STATUS , NULL , _ ( " " ) , path_for_error_message ( wcroot , src_relpath , scratch_pool ) ) ; return SVN_NO_ERROR ; }
In our merge conflicts we record the move_op_src path, which is essentially
the depth at which what was moved is marked deleted.
In our merge conflicts we record the move_op_src path which is essentially the depth at which what was moved is marked deleted .