示例#1
0
static svn_error_t *
set_fulltext(svn_stream_t **stream,
             void *node_baton)
{
  struct node_baton *nb = node_baton;
  struct revision_baton *rb = nb->rb;

  /* If we're skipping this revision, we're done here. */
  if (rb->skipped)
    {
      *stream = NULL;
      return SVN_NO_ERROR;
    }

  return svn_fs_apply_text(stream,
                           rb->txn_root, nb->path,
                           svn_checksum_to_cstring(nb->result_checksum,
                                                   nb->pool),
                           nb->pool);
}
示例#2
0
文件: editor.c 项目: Ranga123/test1
/* This implements svn_editor_cb_add_symlink_t */
static svn_error_t *
add_symlink_cb(void *baton,
               const char *relpath,
               const char *target,
               apr_hash_t *props,
               svn_revnum_t replaces_rev,
               apr_pool_t *scratch_pool)
{
    struct edit_baton *eb = baton;
    const char *fspath = FSPATH(relpath, scratch_pool);
    svn_fs_root_t *root;

    SVN_ERR(get_root(&root, eb));

    if (SVN_IS_VALID_REVNUM(replaces_rev))
    {
        SVN_ERR(can_modify(root, fspath, replaces_rev, scratch_pool));
        SVN_ERR(svn_fs_delete(root, fspath, scratch_pool));
    }
    else
    {
        SVN_ERR(can_create(root, fspath, scratch_pool));
    }

    /* ### we probably need to construct a file with specific contents
       ### (until the FS grows some symlink APIs)  */
#if 0
    SVN_ERR(svn_fs_make_file(root, fspath, scratch_pool));
    SVN_ERR(svn_fs_apply_text(&fs_contents, root, fspath,
                              NULL /* result_checksum */,
                              scratch_pool));
    /* ### SVN_ERR(svn_stream_printf(fs_contents, ..., scratch_pool));  */
    apr_hash_set(props, SVN_PROP_SPECIAL, APR_HASH_KEY_STRING,
                 SVN_PROP_SPECIAL_VALUE);

    SVN_ERR(add_new_props(root, fspath, props, scratch_pool));
#endif

    SVN__NOT_IMPLEMENTED();
}
示例#3
0
文件: editor.c 项目: Ranga123/test1
static svn_error_t *
set_text(svn_fs_root_t *root,
         const char *fspath,
         const svn_checksum_t *checksum,
         svn_stream_t *contents,
         svn_cancel_func_t cancel_func,
         void *cancel_baton,
         apr_pool_t *scratch_pool)
{
    svn_stream_t *fs_contents;

    /* ### We probably don't have an MD5 checksum, so no digest is available
       ### for svn_fs_apply_text() to validate. It would be nice to have an
       ### FS API that takes our CHECKSUM/CONTENTS pair (and PROPS!).  */
    SVN_ERR(svn_fs_apply_text(&fs_contents, root, fspath,
                              NULL /* result_checksum */,
                              scratch_pool));
    SVN_ERR(svn_stream_copy3(contents, fs_contents,
                             cancel_func, cancel_baton,
                             scratch_pool));

    return SVN_NO_ERROR;
}