subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1476634 - in /subversion/branches/fsfs-format7/subversion/libsvn_fs_fs: util.c util.h
Date Sat, 27 Apr 2013 17:24:03 GMT
Author: stefan2
Date: Sat Apr 27 17:24:02 2013
New Revision: 1476634

URL: http://svn.apache.org/r1476634
Log:
On the fsfs-format7: introduce two rev / pack file utility functions

* subversion/libsvn_fs_fs/util.h
  (packed_base_rev,
   pack_size): declare new utilities
* subversion/libsvn_fs_fs/util.c
  (packed_base_rev,
   pack_size): implement them

Modified:
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.h

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.c?rev=1476634&r1=1476633&r2=1476634&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.c Sat Apr 27 17:24:02 2013
@@ -72,6 +72,24 @@ is_packed_revprop(svn_fs_t *fs, svn_revn
       && (ffd->format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT);
 }
 
+svn_revnum_t
+packed_base_rev(svn_fs_t *fs, svn_revnum_t rev)
+{
+  fs_fs_data_t *ffd = fs->fsap_data;
+
+  return rev < ffd->min_unpacked_rev
+       ? rev - (rev % ffd->max_files_per_dir)
+       : rev;
+}
+
+svn_revnum_t
+pack_size(svn_fs_t *fs, svn_revnum_t rev)
+{
+  fs_fs_data_t *ffd = fs->fsap_data;
+
+  return rev < ffd->min_unpacked_rev ? ffd->max_files_per_dir : 1;
+}
+
 const char *
 path_format(svn_fs_t *fs, apr_pool_t *pool)
 {

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.h?rev=1476634&r1=1476633&r2=1476634&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.h Sat Apr 27 17:24:02 2013
@@ -78,6 +78,15 @@ svn_boolean_t
 is_packed_revprop(svn_fs_t *fs,
                   svn_revnum_t rev);
 
+/* Return the revision number of the pack / rev file in FS containing REV. */
+svn_revnum_t
+packed_base_rev(svn_fs_t *fs, svn_revnum_t rev);
+
+/* Return the number of revisions in the pack / rev file in FS that contains
+ * revision REV. */
+svn_revnum_t
+pack_size(svn_fs_t *fs, svn_revnum_t rev);
+
 const char *
 path_format(svn_fs_t *fs,
             apr_pool_t *pool);



Mime
View raw message