You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stefan Sperling <st...@elego.de> on 2010/07/22 20:37:20 UTC

Re: svn commit: r966841 - /subversion/trunk/subversion/svnrdump/svnrdump.c

On Thu, Jul 22, 2010 at 08:18:17PM -0000, artagnon@apache.org wrote:
> Author: artagnon
> Date: Thu Jul 22 20:18:16 2010
> New Revision: 966841
> 
> URL: http://svn.apache.org/viewvc?rev=966841&view=rev
> Log:
> * subversion/svnrdump/svnrdump.c (replay_range, main, usage): Fake a
>   revision 0 like svnsync does. svn:date is still a TODO.
> 
> Modified:
>     subversion/trunk/subversion/svnrdump/svnrdump.c
> 
> Modified: subversion/trunk/subversion/svnrdump/svnrdump.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/svnrdump.c?rev=966841&r1=966840&r2=966841&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/svnrdump/svnrdump.c (original)
> +++ subversion/trunk/subversion/svnrdump/svnrdump.c Thu Jul 22 20:18:16 2010
> @@ -32,6 +32,7 @@
>  #include "svn_utf.h"
>  #include "svn_private_config.h"
>  #include "svn_string.h"
> +#include "svn_props.h"
>  
>  #include "dump_editor.h"
>  
> @@ -178,14 +179,17 @@ open_connection(svn_ra_session_t **sessi
>  }
>  
>  static svn_error_t *
> -replay_range(svn_ra_session_t *session, svn_revnum_t start_revision,
> -             svn_revnum_t end_revision, apr_pool_t *pool,
> -             svn_boolean_t quiet)
> +replay_range(svn_ra_session_t *session, const char *url,
> +             svn_revnum_t start_revision, svn_revnum_t end_revision,
> +             svn_boolean_t quiet, apr_pool_t *pool)
>  {

[...]

> +
> +  /* Fake revision 0 if necessary */
> +  if (start_revision == 0)
> +    {
> +      SVN_ERR(svn_stream_printf(stdout_stream, pool,
> +                                SVN_REPOS_DUMPFILE_REVISION_NUMBER
> +                                ": %d\n", start_revision));
> +
> +      encoded_prophash = apr_hash_make(pool);
> +      propstring = svn_stringbuf_create("", pool);
> +
> +      /* Fake properties from svnsync ### what about svn:date? */
> +      apr_hash_set(encoded_prophash, SVNSYNC_PROP_FROM_URL,
> +                   APR_HASH_KEY_STRING, svn_string_create(url, pool));
> +      apr_hash_set(encoded_prophash, SVNSYNC_PROP_FROM_UUID,
> +                   APR_HASH_KEY_STRING, svn_string_create(uuid, pool));
> +      apr_hash_set(encoded_prophash, SVNSYNC_PROP_LAST_MERGED_REV,
> +                   APR_HASH_KEY_STRING, svn_string_createf(pool, "%ld",
> +                                                           end_revision));
> +      apr_hash_set(encoded_prophash, SVNSYNC_PROP_CURRENTLY_COPYING,
> +                   APR_HASH_KEY_STRING, svn_string_createf(pool, "%ld",
> +                                                           end_revision));

If these revision properties aren't set on the original repository,
you should not include them in the dump.

synsync creates these revision properties, but svnrdump should not.

I think you should query the actual revprop values using the RA API
(if possible), rather than using fixed values passed into this function.
Though maybe a better fix is to make the replay API replay any revision
properties that exist on revision 0?

Stefan