You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2011/01/21 18:21:29 UTC

svn commit: r1061917 - in /subversion/branches/uris-as-urls/subversion/svnrdump: dump_editor.c dump_editor.h

Author: cmpilato
Date: Fri Jan 21 17:21:29 2011
New Revision: 1061917

URL: http://svn.apache.org/viewvc?rev=1061917&view=rev
Log:
On the 'uris-as-urls' branch, review and correct some use of the
svn_uri_* APIs.  (One step of many similar ones.)

* subversion/svnrdump/dump_editor.h
  (struct dir_baton): Note that the copyfrom_path is a relpath and
    abspath is an fspath.

* subversion/svnrdump/dump_editor.c
  (make_dir_baton): Use path APIs where applicable.  Leave a FIXME
    comment, while here.
  (dump_node): Use path APIs where applicable.
  (open_directory): Correct the use of path APIs.

Modified:
    subversion/branches/uris-as-urls/subversion/svnrdump/dump_editor.c
    subversion/branches/uris-as-urls/subversion/svnrdump/dump_editor.h

Modified: subversion/branches/uris-as-urls/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-urls/subversion/svnrdump/dump_editor.c?rev=1061917&r1=1061916&r2=1061917&view=diff
==============================================================================
--- subversion/branches/uris-as-urls/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/uris-as-urls/subversion/svnrdump/dump_editor.c Fri Jan 21 17:21:29 2011
@@ -132,19 +132,18 @@ make_dir_baton(const char *path,
   const char *abspath;
 
   /* Construct the full path of this node. */
+  /* ### FIXME: Not sure why we use an abspath here.  If I understand
+     ### correctly, the only place we used this path is in dump_node(),
+     ### which immediately converts it into a relpath.  -- cmpilato.  */
   if (pb)
-    {
-      if (path[0] != '/')
-        abspath = apr_pstrcat(pool, "/", path, (char *)NULL);
-    }
+    abspath = svn_fspath__canonicalize(path, pool);
   else
     abspath = "/";
 
   /* Strip leading slash from copyfrom_path so that the path is
      canonical and svn_relpath_join can be used */
   if (copyfrom_path)
-    copyfrom_path = ((*copyfrom_path == '/') ?
-                     copyfrom_path + 1 : copyfrom_path);
+    copyfrom_path = svn_relpath_canonicalize(copyfrom_path, pool);
 
   new_db->eb = eb;
   new_db->parent_dir_baton = pb;
@@ -252,11 +251,10 @@ dump_node(struct dump_edit_baton *eb,
 {
   /* Remove leading slashes from path and copyfrom_path */
   if (path)
-    path = ((*path == '/') ? path + 1 : path);
+    path = svn_relpath_canonicalize(path, pool);
 
   if (copyfrom_path)
-    copyfrom_path = ((*copyfrom_path == '/') ?
-                     copyfrom_path + 1 : copyfrom_path);
+    copyfrom_path = svn_relpath_canonicalize(copyfrom_path, pool);
 
   /* Node-path: commons/STATUS */
   SVN_ERR(svn_stream_printf(eb->stream, pool,
@@ -484,9 +482,9 @@ open_directory(const char *path,
      record the same for this one. */
   if (pb && ARE_VALID_COPY_ARGS(pb->copyfrom_path, pb->copyfrom_rev))
     {
-      copyfrom_path = svn_uri_join(pb->copyfrom_path,
-                                   svn_relpath_basename(path, NULL),
-                                   pb->eb->pool);
+      copyfrom_path = svn_relpath_join(pb->copyfrom_path,
+                                       svn_relpath_basename(path, NULL),
+                                       pb->eb->pool);
       copyfrom_rev = pb->copyfrom_rev;
     }
 

Modified: subversion/branches/uris-as-urls/subversion/svnrdump/dump_editor.h
URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-urls/subversion/svnrdump/dump_editor.h?rev=1061917&r1=1061916&r2=1061917&view=diff
==============================================================================
--- subversion/branches/uris-as-urls/subversion/svnrdump/dump_editor.h (original)
+++ subversion/branches/uris-as-urls/subversion/svnrdump/dump_editor.h Fri Jan 21 17:21:29 2011
@@ -44,10 +44,10 @@ struct dir_baton
   svn_boolean_t written_out;
 
   /* the absolute path to this directory */
-  const char *abspath;
+  const char *abspath; /* an fspath */
 
-  /* Copyfrom info for the node, if any */
-  const char *copyfrom_path;
+  /* Copyfrom info for the node, if any. */
+  const char *copyfrom_path; /* a relpath */
   svn_revnum_t copyfrom_rev;
 
   /* Hash of paths that need to be deleted, though some -might- be