[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: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2007-06-17 09:36:00 CEST

patch again, with fixed log message.

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
 (struct svn_info_t): Add members working_size and size.
 (global): Add new define for unknown size

* subversion/libsvn_client/info.c
 (build_info_from_dirent, build_info_from_entry): Adjust accordingly.
]]]
Index: subversion/include/svn_client.h
===================================================================
--- subversion/include/svn_client.h (revision 25433)
+++ subversion/include/svn_client.h (working copy)
@@ -3757,6 +3757,13 @@
  * @{
  */
 
+/** The value of the size in the repository is unknown (because the info
+ * was fetched for a local path, not an URL).
+ *
+ * @since New in 1.5
+ */
+#define SVN_INFO_SIZE_UNKNOWN -1
+
 /**
  * A structure which describes various system-generated metadata about
  * a working-copy path or URL.
@@ -3821,8 +3828,26 @@
   /* @since New in 1.5. */
   const char *changelist;
   svn_depth_t depth;
+
+ /**
+ * Size of the file after being translated into local representation,
+ * or:
+ * @c SVN_WC_ENTRY_WORKING_SIZE_UNKOWN if unknown.
+ * @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). For directories,
+ * this value will be null.
+ * This is only set for URLs. For working copy paths, this size will
+ * be @c SVN_INFO_SIZE_UNKNOWN.
+ * @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,8 @@
   tmpinfo->conflict_wrk = entry->conflict_wrk;
   tmpinfo->prejfile = entry->prejfile;
   tmpinfo->changelist = entry->changelist;
+ tmpinfo->working_size = entry->working_size;
+ tmpinfo->size = SVN_INFO_SIZE_UNKNOWN;
 
   /* 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 Sun Jun 17 09:36:07 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.