Hi,
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.
Stefan
--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net
[[[
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.
]]]
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;
/** @} */
+ /**
+ * 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;
+
} 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
Received on Sat Jun 16 21:01:03 2007