subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1819037 - in /subversion/trunk/subversion: include/svn_types.h libsvn_ra_local/ra_plugin.c libsvn_ra_serf/list.c libsvn_repos/list.c
Date Fri, 22 Dec 2017 13:06:58 GMT
Author: stefan2
Date: Fri Dec 22 13:06:58 2017
New Revision: 1819037

URL: http://svn.apache.org/viewvc?rev=1819037&view=rev
Log:
Fix inconsistent handling of svn_dirent_t.size for directories.

Most code uses SVN_INVALID_FILESIZE for them, so change the docs to match
that fact and update all users to consistently follow the new docstring.

* subversion/include/svn_types.h
   (svn_dirent_t): Change documentation for SIZE.

* subversion/libsvn_ra_local/ra_plugin.c
   (svn_ra_local__get_dir): Return the new default for directories.

* subversion/libsvn_ra_serf/list.c
   (item_closed): Be sure to default to SVN_INVALID_FILESIZE.

* subversion/libsvn_repos/list.c
   (fill_dirent): Set SIZE consistently with other RA layers.

Modified:
    subversion/trunk/subversion/include/svn_types.h
    subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
    subversion/trunk/subversion/libsvn_ra_serf/list.c
    subversion/trunk/subversion/libsvn_repos/list.c

Modified: subversion/trunk/subversion/include/svn_types.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_types.h?rev=1819037&r1=1819036&r2=1819037&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_types.h (original)
+++ subversion/trunk/subversion/include/svn_types.h Fri Dec 22 13:06:58 2017
@@ -652,7 +652,7 @@ typedef struct svn_dirent_t
   /** node kind */
   svn_node_kind_t kind;
 
-  /** length of file text, or 0 for directories */
+  /** length of file text, otherwise SVN_INVALID_FILESIZE */
   svn_filesize_t size;
 
   /** does the node have props? */

Modified: subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c?rev=1819037&r1=1819036&r2=1819037&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c Fri Dec 22 13:06:58 2017
@@ -1387,7 +1387,7 @@ svn_ra_local__get_dir(svn_ra_session_t *
             {
               /* size  */
               if (fs_entry->kind == svn_node_dir)
-                entry->size = 0;
+                entry->size = SVN_INVALID_FILESIZE;
               else
                 SVN_ERR(svn_fs_file_length(&(entry->size), root,
                                            fullpath, iterpool));

Modified: subversion/trunk/subversion/libsvn_ra_serf/list.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/list.c?rev=1819037&r1=1819036&r2=1819037&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/list.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/list.c Fri Dec 22 13:06:58 2017
@@ -139,6 +139,8 @@ item_closed(svn_ra_serf__xml_estate_t *x
 
       if (size)
         SVN_ERR(svn_cstring_atoi64(&dirent.size, size));
+      else
+        dirent.size = SVN_INVALID_FILESIZE;
 
       if (crev)
         SVN_ERR(svn_revnum_parse(&dirent.created_rev, crev, NULL));

Modified: subversion/trunk/subversion/libsvn_repos/list.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/list.c?rev=1819037&r1=1819036&r2=1819037&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/list.c (original)
+++ subversion/trunk/subversion/libsvn_repos/list.c Fri Dec 22 13:06:58 2017
@@ -51,7 +51,7 @@ fill_dirent(svn_dirent_t *dirent,
   if (dirent->kind == svn_node_file)
     SVN_ERR(svn_fs_file_length(&(dirent->size), root, path, scratch_pool));
   else
-    dirent->size = 0;
+    dirent->size = SVN_INVALID_FILESIZE;
 
   SVN_ERR(svn_fs_node_has_props(&dirent->has_props, root, path,
                                 scratch_pool));



Mime
View raw message