You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ar...@apache.org on 2010/08/03 15:45:22 UTC
svn commit: r981876 - in /subversion/trunk/subversion/svnrdump:
load_editor.c load_editor.h
Author: artagnon
Date: Tue Aug 3 13:45:21 2010
New Revision: 981876
URL: http://svn.apache.org/viewvc?rev=981876&view=rev
Log:
* subversion/svnrdump/load_editor.c
(new_node_record, set_revision_property): Don't use repos_url from
the comit_edit_baton. Use svn_ra_get_repos_root2 in
set_revision_property instead. Also, use svn_path_url_add_component2
instead of svn_uri_join so that escaping is handled properly.
* subversion/svnrdump/load_editor.h
(commit_edit_baton): Remove structure as it's not required anymore.
(parse_baton): Add a new root_url field.
Modified:
subversion/trunk/subversion/svnrdump/load_editor.c
subversion/trunk/subversion/svnrdump/load_editor.h
Modified: subversion/trunk/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/load_editor.c?rev=981876&r1=981875&r2=981876&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/load_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/load_editor.c Tue Aug 3 13:45:21 2010
@@ -22,12 +22,12 @@
* ====================================================================
*/
-#include "svn_dirent_uri.h"
#include "svn_cmdline.h"
#include "svn_pools.h"
#include "svn_delta.h"
#include "svn_repos.h"
#include "svn_props.h"
+#include "svn_path.h"
#include "svn_ra.h"
#include "svn_io.h"
@@ -107,7 +107,6 @@ new_node_record(void **node_baton,
void *child_baton;
const struct svn_delta_editor_t *commit_editor;
void *commit_edit_baton;
- struct commit_edit_baton *eb;
void *root_baton;
rb = revision_baton;
@@ -173,8 +172,7 @@ new_node_record(void **node_baton,
repository; to implement this, the edit_baton structure
from commit.c had to be imported as a commit_edit_baton
structure in load_editor.h */
- eb = commit_edit_baton;
- nb->copyfrom_path = svn_uri_join(eb->repos_url,
+ nb->copyfrom_path = svn_path_url_add_component2(rb->pb->root_url,
apr_pstrdup(rb->pb->pool, hval),
rb->pb->pool);
}
@@ -206,7 +204,6 @@ new_node_record(void **node_baton,
return SVN_NO_ERROR;
}
-
static svn_error_t *
set_revision_property(void *baton,
const char *name,
@@ -395,10 +392,11 @@ drive_dumpstream_loader(svn_stream_t *st
svn_ra_session_t *session,
apr_pool_t *pool)
{
- void *pb;
+ struct parse_baton *pb;
pb = parse_baton;
- SVN_ERR(svn_repos_parse_dumpstream2(stream, parser,parse_baton,
+ SVN_ERR(svn_ra_get_repos_root2(session, &(pb->root_url), pool));
+ SVN_ERR(svn_repos_parse_dumpstream2(stream, parser, parse_baton,
NULL, NULL, pool));
return SVN_NO_ERROR;
Modified: subversion/trunk/subversion/svnrdump/load_editor.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/load_editor.h?rev=981876&r1=981875&r2=981876&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/load_editor.h (original)
+++ subversion/trunk/subversion/svnrdump/load_editor.h Tue Aug 3 13:45:21 2010
@@ -37,6 +37,7 @@ struct parse_baton
void *commit_edit_baton;
svn_ra_session_t *session;
const char *uuid;
+ const char *root_url;
apr_pool_t *pool;
};
@@ -75,71 +76,6 @@ struct revision_baton
};
/**
- * Imported from commit.c
- * (see comment in new_node_record in load_editor.h)
- */
-struct commit_edit_baton
-{
- apr_pool_t *pool;
-
- /** Supplied when the editor is created: **/
-
- /* Revision properties to set for this commit. */
- apr_hash_t *revprop_table;
-
- /* Callback to run when the commit is done. */
- svn_commit_callback2_t commit_callback;
- void *commit_callback_baton;
-
- /* Callback to check authorizations on paths. */
- svn_repos_authz_callback_t authz_callback;
- void *authz_baton;
-
- /* The already-open svn repository to commit to. */
- svn_repos_t *repos;
-
- /* URL to the root of the open repository. */
- const char *repos_url;
-
- /* The name of the repository (here for convenience). */
- const char *repos_name;
-
- /* The filesystem associated with the REPOS above (here for
- convenience). */
- svn_fs_t *fs;
-
- /* Location in fs where the edit will begin. */
- const char *base_path;
-
- /* Does this set of interfaces 'own' the commit transaction? */
- svn_boolean_t txn_owner;
-
- /* svn transaction associated with this edit (created in
- open_root, or supplied by the public API caller). */
- svn_fs_txn_t *txn;
-
- /** Filled in during open_root: **/
-
- /* The name of the transaction. */
- const char *txn_name;
-
- /* The object representing the root directory of the svn txn. */
- svn_fs_root_t *txn_root;
-
- /** Filled in when the edit is closed: **/
-
- /* The new revision created by this commit. */
- svn_revnum_t *new_rev;
-
- /* The date (according to the repository) of this commit. */
- const char **committed_date;
-
- /* The author (also according to the repository) of this commit. */
- const char **committed_author;
-};
-
-
-/**
* Build up a load editor @a parser for parsing a dumpfile stream from @a stream
* set to fire the appropriate callbacks in load editor along with a
* @a parser_baton, using @a pool for all memory allocations. The