FreeBSD/contrib/subversion/subversion/libsvn_client/mtcc.c
/* Check if it is safe to create a new node at NEW_RELPATH. Return a proper
   error if it is not */
Check if it is safe to create a new node at NEW_RELPATH. Return a proper
error if it is not
Check if it is safe to create a new node at NEW_RELPATH . Return a proper error if it is not
static svn_error_t *
mtcc_verify_create(svn_client__mtcc_t *mtcc,
                   const char *new_relpath,
                   apr_pool_t *scratch_pool)
{
  svn_node_kind_t kind;
  if (*new_relpath || !MTCC_UNMODIFIED(mtcc))
    {
      mtcc_op_t *op;
      SVN_ERR(mtcc_op_find(&op, NULL, new_relpath, mtcc->root_op, TRUE, FALSE,
                           FALSE, mtcc->pool, scratch_pool));
      if (op)
        return svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL,
                                 _("Path '%s' already exists"),
                                 new_relpath);
      SVN_ERR(mtcc_op_find(&op, NULL, new_relpath, mtcc->root_op, TRUE, TRUE,
                           FALSE, mtcc->pool, scratch_pool));
      if (op)
        return SVN_NO_ERROR; 
    }
  SVN_ERR(svn_client__mtcc_check_path(&kind, new_relpath, FALSE,
                                      mtcc, scratch_pool));
  if (kind != svn_node_none)
    return svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL,
                             _("Path '%s' already exists"),
                             new_relpath);
  return SVN_NO_ERROR;
}
static svn_error_t * mtcc_verify_create ( svn_client__mtcc_t * mtcc , const char * new_relpath , apr_pool_t * scratch_pool ) { svn_node_kind_t kind ; if ( * new_relpath || ! MTCC_UNMODIFIED ( mtcc ) ) { mtcc_op_t * op ; SVN_ERR ( mtcc_op_find ( & op , NULL , new_relpath , mtcc -> root_op , TRUE , FALSE , FALSE , mtcc -> pool , scratch_pool ) ) ; if ( op ) return svn_error_createf ( SVN_ERR_FS_ALREADY_EXISTS , NULL , _ ( " " ) , new_relpath ) ; SVN_ERR ( mtcc_op_find ( & op , NULL , new_relpath , mtcc -> root_op , TRUE , TRUE , FALSE , mtcc -> pool , scratch_pool ) ) ; if ( op ) return SVN_NO_ERROR ; } SVN_ERR ( svn_client__mtcc_check_path ( & kind , new_relpath , FALSE , mtcc , scratch_pool ) ) ; if ( kind != svn_node_none ) return svn_error_createf ( SVN_ERR_FS_ALREADY_EXISTS , NULL , _ ( " " ) , new_relpath ) ; return SVN_NO_ERROR ; }
Check if it is safe to create a new node at NEW_RELPATH.
Check if it is safe to create a new node at NEW_RELPATH .
/* Node is explicitly deleted. We can replace */ /* mod_dav_svn used to allow overwriting existing directories. Let's hide
     that for users of this api */