[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Problem introduced in revision 34378 of libsvn_fs_fs/fs_fs.c?

From: David Glasser <glasser_at_davidglasser.net>
Date: Wed, 26 Nov 2008 09:03:34 -0800

I think that Hyrum's original version of this code didn't have a check
at all, which was a change.

ie, you should be comparing 34428 to something rather old, not ot
something as recent at 34377.

--dave

On Wed, Nov 26, 2008 at 1:51 AM, Marc Haesen
<Marc.Haesen_at_oneaccess-net.com> wrote:
> Hi,
>
>
>
> Could it be that the following code changed in revision 34378 of
> libsvn_fs_fs/fs_fs.c:
>
>
>
> ===================================================================
>
> --- fs_fs.c (revision 34377)
>
> +++ fs_fs.c (revision 34428)
>
> @@ -1867,19 +1866,21 @@
>
> }
>
>
>
>
>
> -/* Return a formatted string that represents the location of
>
> - representation REP. If MUTABLE_REP_TRUNCATED is given, the rep is
>
> - for props or dir contents, and only a "-1" revision number will be
>
> - given for a mutable rep. Perform the allocation from POOL. */
>
> +/* Return a formatted string, compatible with filesystem format FORMAT,
>
> + that represents the location of representation REP. If
>
> + MUTABLE_REP_TRUNCATED is given, the rep is for props or dir contents,
>
> + and only a "-1" revision number will be given for a mutable rep.
>
> + Perform the allocation from POOL. */
>
> static const char *
>
> representation_string(representation_t *rep,
>
> - svn_boolean_t mutable_rep_truncated, apr_pool_t
> *pool)
>
> + int format,
>
> + svn_boolean_t mutable_rep_truncated,
>
> + apr_pool_t *pool)
>
> {
>
> - /* ###: Make the writing of the sha1 and reuse count dependent on the
>
> - format number. */
>
> if (rep->txn_id && mutable_rep_truncated)
>
> return "-1";
>
> - else
>
> +
>
> + if (format < SVN_FS_FS__MIN_REP_SHARING_FORMAT)
>
> return apr_psprintf(pool, "%ld %" APR_OFF_T_FMT " %" SVN_FILESIZE_T_FMT
>
> " %" SVN_FILESIZE_T_FMT " %s %s %" APR_INT64_T_FMT,
>
> rep->revision, rep->offset, rep->size,
>
>
>
>
>
> Should have been (look at difference in test on repository format):
>
>
>
> ===================================================================
>
> --- fs_fs.c (revision 34377)
>
> +++ fs_fs.c (revision 34428)
>
> @@ -1867,19 +1866,21 @@
>
> }
>
>
>
>
>
> -/* Return a formatted string that represents the location of
>
> - representation REP. If MUTABLE_REP_TRUNCATED is given, the rep is
>
> - for props or dir contents, and only a "-1" revision number will be
>
> - given for a mutable rep. Perform the allocation from POOL. */
>
> +/* Return a formatted string, compatible with filesystem format FORMAT,
>
> + that represents the location of representation REP. If
>
> + MUTABLE_REP_TRUNCATED is given, the rep is for props or dir contents,
>
> + and only a "-1" revision number will be given for a mutable rep.
>
> + Perform the allocation from POOL. */
>
> static const char *
>
> representation_string(representation_t *rep,
>
> - svn_boolean_t mutable_rep_truncated, apr_pool_t
> *pool)
>
> + int format,
>
> + svn_boolean_t mutable_rep_truncated,
>
> + apr_pool_t *pool)
>
> {
>
> - /* ###: Make the writing of the sha1 and reuse count dependent on the
>
> - format number. */
>
> if (rep->txn_id && mutable_rep_truncated)
>
> return "-1";
>
> - else
>
> +
>
> + if (format >= SVN_FS_FS__MIN_REP_SHARING_FORMAT)
>
> return apr_psprintf(pool, "%ld %" APR_OFF_T_FMT " %" SVN_FILESIZE_T_FMT
>
> " %" SVN_FILESIZE_T_FMT " %s %s %" APR_INT64_T_FMT,
>
> rep->revision, rep->offset, rep->size,
>
>
>
> If I do a dump/load of a repository, I get a different size of the
> repository with revision 34377 compared with the current version (34428). If
> I apply this patch on 34428, I get the same repository after a dump/load.
>
>
>
> Regards,
>
> Marc

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-11-26 18:03:50 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.