Author: stefan2
Date: Fri Jan 25 11:00:04 2013
New Revision: 1438448
URL: http://svn.apache.org/viewvc?rev=1438448&view=rev
Log:
On the fsfs-format7 branch: To be able to optimize pack files,
it will be useful to distinguish between dir, file, dir props
and file props representations.
* subversion/libsvn_fs_fs/index.h
(SVN_FS_FS__ITEM_TYPE_REP): drop; superseded by ...
(SVN_FS_FS__ITEM_TYPE_FILE_REP,
SVN_FS_FS__ITEM_TYPE_DIR_REP,
SVN_FS_FS__ITEM_TYPE_FILE_PROPS,
SVN_FS_FS__ITEM_TYPE_DIR_PROPS): ... these
(SVN_FS_FS__ITEM_TYPE_NODEREV,
SVN_FS_FS__ITEM_TYPE_CHANGES): renumber
* subversion/libsvn_fs_fs/transaction.c
(rep_write_contents_close): use the more specific type "file rep"
(write_hash_rep,
write_hash_delta_rep): use the item type selected by the caller
(write_final_rev): specify the specific item types
Modified:
subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/index.h
subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/index.h
URL:
http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/index.h?rev=1438448&r1=1438447&r2=1438448&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/index.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/index.h Fri Jan 25
11:00:04 2013
@@ -36,10 +36,13 @@
/* Data / item types as stored in the phys-to-log index.
*/
-#define SVN_FS_FS__ITEM_TYPE_UNUSED 0 /* file section not used */
-#define SVN_FS_FS__ITEM_TYPE_REP 1 /* item is a representation */
-#define SVN_FS_FS__ITEM_TYPE_NODEREV 2 /* item is a noderev */
-#define SVN_FS_FS__ITEM_TYPE_CHANGES 3 /* item is a changed paths list */
+#define SVN_FS_FS__ITEM_TYPE_UNUSED 0 /* file section not used */
+#define SVN_FS_FS__ITEM_TYPE_FILE_REP 1 /* item is a file representation */
+#define SVN_FS_FS__ITEM_TYPE_DIR_REP 2 /* item is a directory rep. */
+#define SVN_FS_FS__ITEM_TYPE_FILE_PROPS 3 /* item is a file property rep. */
+#define SVN_FS_FS__ITEM_TYPE_DIR_PROPS 4 /* item is a directory prop rep */
+#define SVN_FS_FS__ITEM_TYPE_NODEREV 5 /* item is a noderev */
+#define SVN_FS_FS__ITEM_TYPE_CHANGES 6 /* item is a changed paths list */
/* (user visible) entry in the phys-to-log index. It describes a section
* of some packed / non-packed rev file as containing a specific item.
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c
URL:
http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c?rev=1438448&r1=1438447&r2=1438448&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c
(original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c Fri
Jan 25 11:00:04 2013
@@ -2097,7 +2097,7 @@ rep_write_contents_close(void *baton)
entry.offset = b->rep_offset;
SVN_ERR(get_file_offset(&offset, b->file, b->pool));
entry.size = offset - b->rep_offset;
- entry.type = SVN_FS_FS__ITEM_TYPE_REP;
+ entry.type = SVN_FS_FS__ITEM_TYPE_FILE_REP;
entry.revision = SVN_INVALID_REVNUM;
entry.item_index = rep->item_index;
@@ -2296,6 +2296,7 @@ write_hash_rep(representation_t *rep,
svn_fs_t *fs,
const char *txn_id,
apr_hash_t *reps_hash,
+ int item_type,
apr_pool_t *pool)
{
svn_stream_t *stream;
@@ -2348,7 +2349,7 @@ write_hash_rep(representation_t *rep,
entry.offset = offset;
SVN_ERR(get_file_offset(&offset, file, pool));
entry.size = offset - entry.offset;
- entry.type = SVN_FS_FS__ITEM_TYPE_REP;
+ entry.type = item_type;
entry.revision = SVN_INVALID_REVNUM;
entry.item_index = rep->item_index;
SVN_ERR(store_p2l_index_entry(fs, txn_id, &entry, pool));
@@ -2377,7 +2378,7 @@ write_hash_delta_rep(representation_t *r
const char *txn_id,
node_revision_t *noderev,
apr_hash_t *reps_hash,
- svn_boolean_t props,
+ int item_type,
apr_pool_t *pool)
{
svn_txdelta_window_handler_t diff_wh;
@@ -2397,9 +2398,11 @@ write_hash_delta_rep(representation_t *r
struct write_hash_baton *whb;
fs_fs_data_t *ffd = fs->fsap_data;
int diff_version = ffd->format >= SVN_FS_FS__MIN_SVNDIFF1_FORMAT ? 1 : 0;
+ svn_boolean_t is_props = (item_type == SVN_FS_FS__ITEM_TYPE_FILE_PROPS)
+ || (item_type == SVN_FS_FS__ITEM_TYPE_DIR_PROPS);
/* Get the base for this delta. */
- SVN_ERR(choose_delta_base(&base_rep, fs, noderev, props, pool));
+ SVN_ERR(choose_delta_base(&base_rep, fs, noderev, is_props, pool));
SVN_ERR(svn_fs_fs__get_contents(&source, fs, base_rep, pool));
SVN_ERR(get_file_offset(&offset, file, pool));
@@ -2471,7 +2474,7 @@ write_hash_delta_rep(representation_t *r
entry.offset = offset;
SVN_ERR(get_file_offset(&offset, file, pool));
entry.size = offset - entry.offset;
- entry.type = SVN_FS_FS__ITEM_TYPE_REP;
+ entry.type = item_type;
entry.revision = SVN_INVALID_REVNUM;
entry.item_index = rep->item_index;
@@ -2646,10 +2649,12 @@ write_final_rev(const svn_fs_id_t **new_
if (ffd->deltify_directories)
SVN_ERR(write_hash_delta_rep(noderev->data_rep, file,
str_entries, fs, txn_id, noderev,
- NULL, FALSE, pool));
+ NULL, SVN_FS_FS__ITEM_TYPE_DIR_REP,
+ pool));
else
SVN_ERR(write_hash_rep(noderev->data_rep, file, str_entries,
- fs, txn_id, NULL, pool));
+ fs, txn_id, NULL,
+ SVN_FS_FS__ITEM_TYPE_DIR_REP, pool));
noderev->data_rep->txn_id = NULL;
}
@@ -2682,6 +2687,9 @@ write_final_rev(const svn_fs_id_t **new_
if (noderev->prop_rep && noderev->prop_rep->txn_id)
{
apr_hash_t *proplist;
+ int item_type = noderev->kind == svn_node_dir
+ ? SVN_FS_FS__ITEM_TYPE_DIR_PROPS
+ : SVN_FS_FS__ITEM_TYPE_FILE_PROPS;
SVN_ERR(svn_fs_fs__get_proplist(&proplist, fs, noderev, pool));
noderev->prop_rep->txn_id = NULL;
@@ -2690,10 +2698,10 @@ write_final_rev(const svn_fs_id_t **new_
if (ffd->deltify_properties)
SVN_ERR(write_hash_delta_rep(noderev->prop_rep, file,
proplist, fs, txn_id, noderev,
- reps_hash, TRUE, pool));
+ reps_hash, item_type, pool));
else
SVN_ERR(write_hash_rep(noderev->prop_rep, file, proplist,
- fs, txn_id, reps_hash, pool));
+ fs, txn_id, reps_hash, item_type, pool));
}
/* Convert our temporary ID into a permanent revision one. */