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/17 21:48:32 UTC

svn commit: r986466 - /subversion/trunk/subversion/svnrdump/dump_editor.c

Author: artagnon
Date: Tue Aug 17 19:48:32 2010
New Revision: 986466

URL: http://svn.apache.org/viewvc?rev=986466&view=rev
Log:
* subversion/svnrdump/dump_editor.c
  (open_file): Simplify a block of code that pushes to an array and
  then calls svn_path_compose; use svn_relpath_join instead.

Modified:
    subversion/trunk/subversion/svnrdump/dump_editor.c

Modified: subversion/trunk/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/dump_editor.c?rev=986466&r1=986465&r2=986466&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/dump_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/dump_editor.c Tue Aug 17 19:48:32 2010
@@ -499,21 +499,16 @@ open_file(const char *path,
   struct dir_baton *pb = parent_baton;
   const char *copyfrom_path = NULL;
   svn_revnum_t copyfrom_rev = SVN_INVALID_REVNUM;
-  apr_array_header_t *compose_path;
 
   /* Some pending properties to dump? */
   SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
 
-  compose_path = apr_array_make(pool, 2, sizeof(const char *));
-
   /* If the parent directory has explicit copyfrom path and rev,
      record the same for this one. */
   if (pb && ARE_VALID_COPY_ARGS(pb->copyfrom_path, pb->copyfrom_rev))
     {
-      APR_ARRAY_PUSH(compose_path, const char *) = pb->copyfrom_path;
-      APR_ARRAY_PUSH(compose_path, const char *) =
-        svn_relpath_basename(path, pool);
-      copyfrom_path = svn_path_compose(compose_path, pool);
+      copyfrom_path = svn_relpath_join(svn_relpath_basename(path, pool),
+                                       pb->copyfrom_path, pool);
       copyfrom_rev = pb->copyfrom_rev;
     }
 



Re: svn commit: r986466 - /subversion/trunk/subversion/svnrdump/dump_editor.c

Posted by Ramkumar Ramachandra <ar...@gmail.com>.
Hi Bert,

Bert Huijben writes:
> copyfrom_path is probably relative from the repository or session root (not sure which in your case). You are now appending the basename of a/paths/basename and then joining the copyfrom_path after it. Shouldn't that be the other way around?

Really silly mistake, and this is very apparent from the diff. Thanks
for catching; fixed in r986567 :)

-- Ram

RE: svn commit: r986466 - /subversion/trunk/subversion/svnrdump/dump_editor.c

Posted by Bert Huijben <be...@vmoo.com>.

> -----Original Message-----
> From: artagnon@apache.org [mailto:artagnon@apache.org]
> Sent: dinsdag 17 augustus 2010 12:49
> To: commits@subversion.apache.org
> Subject: svn commit: r986466 -
> /subversion/trunk/subversion/svnrdump/dump_editor.c
> 
> Author: artagnon
> Date: Tue Aug 17 19:48:32 2010
> New Revision: 986466
> 
> URL: http://svn.apache.org/viewvc?rev=986466&view=rev
> Log:
> * subversion/svnrdump/dump_editor.c
>   (open_file): Simplify a block of code that pushes to an array and
>   then calls svn_path_compose; use svn_relpath_join instead.
> 
> Modified:
>     subversion/trunk/subversion/svnrdump/dump_editor.c
> 
> Modified: subversion/trunk/subversion/svnrdump/dump_editor.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/dum
> p_editor.c?rev=986466&r1=986465&r2=986466&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/svnrdump/dump_editor.c (original)
> +++ subversion/trunk/subversion/svnrdump/dump_editor.c Tue Aug 17
> 19:48:32 2010
> @@ -499,21 +499,16 @@ open_file(const char *path,
>    struct dir_baton *pb = parent_baton;
>    const char *copyfrom_path = NULL;
>    svn_revnum_t copyfrom_rev = SVN_INVALID_REVNUM;
> -  apr_array_header_t *compose_path;
> 
>    /* Some pending properties to dump? */
>    SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE,
> pool));
> 
> -  compose_path = apr_array_make(pool, 2, sizeof(const char *));
> -
>    /* If the parent directory has explicit copyfrom path and rev,
>       record the same for this one. */
>    if (pb && ARE_VALID_COPY_ARGS(pb->copyfrom_path, pb-
> >copyfrom_rev))
>      {
> -      APR_ARRAY_PUSH(compose_path, const char *) = pb->copyfrom_path;
> -      APR_ARRAY_PUSH(compose_path, const char *) =
> -        svn_relpath_basename(path, pool);
> -      copyfrom_path = svn_path_compose(compose_path, pool);
> +      copyfrom_path = svn_relpath_join(svn_relpath_basename(path, pool),
> +                                       pb->copyfrom_path, pool);
>        copyfrom_rev = pb->copyfrom_rev;
>      }

copyfrom_path is probably relative from the repository or session root (not sure which in your case). You are now appending the basename of a/paths/basename and then joining the copyfrom_path after it. Shouldn't that be the other way around?

	Bert