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

Re: [PATCH] Add size information to svn_client_info()

From: David Glasser <glasser_at_mit.edu>
Date: 2007-06-16 23:48:56 CEST

On 6/16/07, Stefan Küng <tortoisesvn@gmail.com> wrote:
> I need the size information from an svn_client_info() call and wondered
> whether that information would come for free or not. So I took a quick
> look at the code and saw that it really comes for free.
>
> Attached is a patch which adds an 'working_size' and 'size' member to
> the svn_info_t struct.

This seems like good information to have. A few comments about the patch:

> [[[
> Make svn_client_info() return the size or working size of a file or
> folder too since this information is already available and comes at no
> cost.
>
> subversion/include/svn_client.h : add members working_size and size to
> the svn_info_t struct and document
> them.
> subversion/libsvn_client/info.c : provide the working size and size
> information to the caller.
> ]]]

Please follow our standards for writing log messages, especially
including the names of the modified functions.

> Index: subversion/include/svn_client.h
> ===================================================================
> --- subversion/include/svn_client.h (revision 25433)
> +++ subversion/include/svn_client.h (working copy)
> @@ -3821,8 +3821,21 @@
> /* @since New in 1.5. */
> const char *changelist;
> svn_depth_t depth;
> +
> + /**
> + * size of the file in the working copy.
> + * @since New in 1.5.
> + */
> + apr_size_t working_size;
> /** @} */

This actually means "size of the file when originally checked out in
the working copy", not the current size with local modifications,
right?

> + /**
> + * size of the file in the repository (untranslated, i.e., without
> + * adjustment of line endings and keyword expansion).
> + * @since New in 1.5.
> + */
> + apr_size_t size;

It would seem to me that this value could hypothetically be set on an
info struct that comes from a WC as well as one that comes from an
URL; if you're not going to fill it for both that should be
documented.

The values of these fields for directories should be well-defined and
documented.

How can you tell the difference between a value of 0 for these fields
because the file has size 0 and a value of 0 because the function
didn't fill them in (because each call only fills in one or the
other)?

Should these be printed in "svn info"?

> } svn_info_t;
>
>
> Index: subversion/libsvn_client/info.c
> ===================================================================
> --- subversion/libsvn_client/info.c (revision 25433)
> +++ subversion/libsvn_client/info.c (working copy)
> @@ -54,6 +54,7 @@
> tmpinfo->last_changed_author = dirent->last_author;
> tmpinfo->lock = lock;
> tmpinfo->depth = svn_depth_unknown;
> + tmpinfo->size = dirent->size;
>
> *info = tmpinfo;
> return SVN_NO_ERROR;
> @@ -92,6 +93,7 @@
> tmpinfo->conflict_wrk = entry->conflict_wrk;
> tmpinfo->prejfile = entry->prejfile;
> tmpinfo->changelist = entry->changelist;
> + tmpinfo->working_size = entry->working_size;
>
> /* lock stuff */
> if (entry->lock_token) /* the token is the critical bit. */
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>

-- 
David Glasser | glasser_at_mit.edu | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jun 16 23:49:00 2007

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.