예제 #1
0
파일: commit.c 프로젝트: 2asoft/freebsd
static svn_error_t *
get_ra_editor(const svn_delta_editor_t **editor,
              void **edit_baton,
              svn_ra_session_t *ra_session,
              svn_client_ctx_t *ctx,
              const char *log_msg,
              const apr_array_header_t *commit_items,
              const apr_hash_t *revprop_table,
              apr_hash_t *lock_tokens,
              svn_boolean_t keep_locks,
              svn_commit_callback2_t commit_callback,
              void *commit_baton,
              apr_pool_t *pool)
{
  apr_hash_t *commit_revprops;
  apr_hash_t *relpath_map = NULL;

  SVN_ERR(svn_client__ensure_revprop_table(&commit_revprops, revprop_table,
                                           log_msg, ctx, pool));

#ifdef ENABLE_EV2_SHIMS
  if (commit_items)
    {
      int i;
      apr_pool_t *iterpool = svn_pool_create(pool);

      relpath_map = apr_hash_make(pool);
      for (i = 0; i < commit_items->nelts; i++)
        {
          svn_client_commit_item3_t *item = APR_ARRAY_IDX(commit_items, i,
                                                  svn_client_commit_item3_t *);
          const char *relpath;

          if (!item->path)
            continue;

          svn_pool_clear(iterpool);
          SVN_ERR(svn_wc__node_get_origin(NULL, NULL, &relpath, NULL, NULL,
                                          NULL, NULL,
                                          ctx->wc_ctx, item->path, FALSE, pool,
                                          iterpool));
          if (relpath)
            svn_hash_sets(relpath_map, relpath, item->path);
        }
      svn_pool_destroy(iterpool);
    }
#endif

  /* Fetch RA commit editor. */
  SVN_ERR(svn_ra__register_editor_shim_callbacks(ra_session,
                        svn_client__get_shim_callbacks(ctx->wc_ctx,
                                                       relpath_map, pool)));
  SVN_ERR(svn_ra_get_commit_editor3(ra_session, editor, edit_baton,
                                    commit_revprops, commit_callback,
                                    commit_baton, lock_tokens, keep_locks,
                                    pool));

  return SVN_NO_ERROR;
}
예제 #2
0
파일: delete.c 프로젝트: Ranga123/test1
            APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
        }
        SVN_ERR(svn_client__get_log_msg(&log_msg, &tmp_file, commit_items,
                                        ctx, pool));
        if (! log_msg)
            return SVN_NO_ERROR;
    }
    else
        log_msg = "";

    SVN_ERR(svn_client__ensure_revprop_table(&commit_revprops, revprop_table,
            log_msg, ctx, pool));

    /* Fetch RA commit editor */
    SVN_ERR(svn_ra__register_editor_shim_callbacks(ra_session,
            svn_client__get_shim_callbacks(ctx->wc_ctx,
                                           NULL, pool)));
    SVN_ERR(svn_ra_get_commit_editor3(ra_session, &editor, &edit_baton,
                                      commit_revprops,
                                      commit_callback,
                                      commit_baton,
                                      NULL, TRUE, /* No lock tokens */
                                      pool));

    /* Call the path-based editor driver. */
    err = svn_delta_path_driver2(editor, edit_baton, relpaths, TRUE,
                                 path_driver_cb_func, (void *)editor, pool);

    if (err)
    {
        return svn_error_trace(
                   svn_error_compose_create(err,