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

Re: SVN 1.5 beta1 - info2 returns svn_info_t.size == 4294967295

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Mon, 31 Mar 2008 12:21:14 +0100

Karl Fogel wrote:
> Barry Scott <barry_at_barrys-emacs.org> writes:
>
>>>On Wed, 26 Mar 2008, Barry Scott wrote:
>>>
>>>>I'm running svn 1.5 beta1 on Mac OS X 10.4.11 PowerPC.
>>>>
>>>>svn_client_info2() for a wc file returned
>>>>
>>>>working_size == 33
>>>>size == 4294967295
>>>>
>>>>How should I interpret the value 4294967295?
[...]
>>
>>But is this a bug or a feature?
>>
>>Should I be raising a bug report about this?
>
> If we're trying to put a negative value into an unsigned field, that's a
> bug already (it may be a symptom of some larger bug too). So yes,
> please raise a bug report, if you have a full reproduction recipe...

Barry, the documentation of svn_info_t says:

> /**
> * The size of the file in the repository (untranslated,
> * e.g. without adjustment of line endings and keyword
> * expansion). Only applicable for file -- not directory -- URLs.
> * For working copy paths, size will be @c SVN_INFO_SIZE_UNKNOWN.
> * @since New in 1.5.
> */
> apr_size_t size;

and

> #define SVN_INFO_SIZE_UNKNOWN ((apr_size_t) -1)

So this is a documented feature, not a bug.

There is in fact a bug nearby: the corresponding constant for the
"working_size" field has the wrong type: it's always negative:

> /**
> * The size of the file after being translated into its local
> * representation, or @c SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN if
> * unknown. Not applicable for directories.
> * @since New in 1.5.
> */
> apr_size_t working_size;

and

> #define SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN -1

I think the best fix for this would be to change the documentation of
"working_size" to say that the value used in this case is
SVN_INFO_SIZE_UNKNOWN, and to generalise the documentation of that constant to
allow it to apply to both fields.

Fixed in r30130.

(An alternative fix would be to use the signed "apr_off_t" instead of
"apr_size_t". This is the approach taken within svn_wc_entry_t where
SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN is applicable.)

These fields are new in 1.5 so proposing for back-port to 1.5.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-03-31 13:21:32 CEST

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.