You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/11/25 18:23:55 UTC
svn commit: r1039105 - in /subversion/trunk/subversion: svndumpfilter/main.c
svnrdump/dump_editor.c svnrdump/load_editor.c
Author: julianfoad
Date: Thu Nov 25 17:23:55 2010
New Revision: 1039105
URL: http://svn.apache.org/viewvc?rev=1039105&view=rev
Log:
Clean up some path handling. No functional change.
* subversion/svndumpfilter/main.c
(new_node_record, main): To make sure a path begins with '/', don't use
svn_uri_join("/", path) because we don't want to continue allowing "/"
to be treated as a valid URI by the svn_uri_* functions. Instead, test
and concatenate explicitly.
* subversion/svnrdump/dump_editor.c
(make_dir_baton): Same.
* subversion/svnrdump/load_editor.c
(new_node_record): The root relpath is simply ""; no need to calculate it.
Modified:
subversion/trunk/subversion/svndumpfilter/main.c
subversion/trunk/subversion/svnrdump/dump_editor.c
subversion/trunk/subversion/svnrdump/load_editor.c
Modified: subversion/trunk/subversion/svndumpfilter/main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svndumpfilter/main.c?rev=1039105&r1=1039104&r2=1039105&view=diff
==============================================================================
--- subversion/trunk/subversion/svndumpfilter/main.c (original)
+++ subversion/trunk/subversion/svndumpfilter/main.c Thu Nov 25 17:23:55 2010
@@ -485,9 +485,10 @@ new_node_record(void **node_baton,
APR_HASH_KEY_STRING);
/* Ensure that paths start with a leading '/'. */
- node_path = svn_uri_join("/", node_path, pool);
- if (copyfrom_path)
- copyfrom_path = svn_uri_join("/", copyfrom_path, pool);
+ if (node_path[0] != '/')
+ node_path = apr_pstrcat(pool, "/", node_path, (char *)NULL);
+ if (copyfrom_path && copyfrom_path[0] != '/')
+ copyfrom_path = apr_pstrcat(pool, "/", copyfrom_path, (char *)NULL);
nb->do_skip = skip_path(node_path, pb->prefixes,
pb->do_exclude, pb->glob);
@@ -1437,7 +1438,8 @@ main(int argc, const char *argv[])
style, and absolute. */
SVN_INT_ERR(svn_utf_cstring_to_utf8(&prefix, os->argv[i], pool));
prefix = svn_relpath_internal_style(prefix, pool);
- prefix = svn_uri_join("/", prefix, pool);
+ if (prefix[0] != '/')
+ prefix = apr_pstrcat(pool, "/", prefix, (char *)NULL);
APR_ARRAY_PUSH(opt_state.prefixes, const char *) = prefix;
}
Modified: subversion/trunk/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/dump_editor.c?rev=1039105&r1=1039104&r2=1039105&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/dump_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/dump_editor.c Thu Nov 25 17:23:55 2010
@@ -133,7 +133,10 @@ make_dir_baton(const char *path,
/* Construct the full path of this node. */
if (pb)
- abspath = svn_uri_join("/", path, pool);
+ {
+ if (path[0] != '/')
+ abspath = apr_pstrcat(pool, "/", path, (char *)NULL);
+ }
else
abspath = "/";
Modified: subversion/trunk/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/load_editor.c?rev=1039105&r1=1039104&r2=1039105&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/load_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/load_editor.c Thu Nov 25 17:23:55 2010
@@ -311,7 +311,7 @@ new_node_record(void **node_baton,
child_db = apr_pcalloc(rb->pool, sizeof(*child_db));
child_db->baton = child_baton;
child_db->depth = 0;
- child_db->relpath = svn_relpath_canonicalize("/", rb->pool);
+ child_db->relpath = "";
child_db->parent = NULL;
rb->db = child_db;
}