Author: hwright
Date: Thu Jul 7 16:10:44 2011
New Revision: 1143902
URL: http://svn.apache.org/viewvc?rev=1143902&view=rev
Log:
On the revprop-packing branch:
Bring up-to-date with trunk, to pick up changes to the FSFS structure file,
as well as a fix to the test suite.
Modified:
subversion/branches/revprop-packing/ (props changed)
subversion/branches/revprop-packing/subversion/include/svn_client.h
subversion/branches/revprop-packing/subversion/libsvn_client/deprecated.c
subversion/branches/revprop-packing/subversion/libsvn_client/util.c
subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c
subversion/branches/revprop-packing/subversion/libsvn_fs_fs/structure
subversion/branches/revprop-packing/subversion/libsvn_ra_serf/update.c
subversion/branches/revprop-packing/subversion/mod_dav_svn/util.c
subversion/branches/revprop-packing/subversion/tests/cmdline/svnadmin_tests.py
Propchange: subversion/branches/revprop-packing/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jul 7 16:10:44 2011
@@ -52,3 +52,4 @@
/subversion/branches/tree-conflicts:868291-873154
/subversion/branches/tree-conflicts-notify:873926-874008
/subversion/branches/uris-as-urls:1060426-1064427
+/subversion/trunk:1143817-1143899
Modified: subversion/branches/revprop-packing/subversion/include/svn_client.h
URL:
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/svn_client.h?rev=1143902&r1=1143901&r2=1143902&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/svn_client.h
(original)
+++ subversion/branches/revprop-packing/subversion/include/svn_client.h Thu Jul
7 16:10:44 2011
@@ -356,8 +356,9 @@ typedef struct svn_client_proplist_item_
/**
* The callback invoked by svn_client_proplist3(). Each invocation
- * describes the property specified by @a item. Use @a pool for all
- * temporary allocation.
+ * provides the regular properties of @a path which is either a WC path or
+ * a URL. @a prop_hash maps property names (char *) to property
+ values (svn_string_t *). Use @a pool for all temporary allocation.
*
* @since New in 1.5.
*/
Modified:
subversion/branches/revprop-packing/subversion/libsvn_client/deprecated.c
URL:
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_client/deprecated.c?rev=1143902&r1=1143901&r2=1143902&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_client/deprecated.c
(original)
+++ subversion/branches/revprop-packing/subversion/libsvn_client/deprecated.c
Thu Jul 7 16:10:44 2011
@@ -38,6 +38,7 @@
#include "svn_compat.h"
#include "svn_props.h"
#include "svn_utf.h"
+#include "svn_string.h"
#include "client.h"
#include "mergeinfo.h"
@@ -1721,6 +1722,40 @@ svn_client_propget(apr_hash_t **props,
}
+/* Duplicate a HASH containing (char * -> svn_string_t *) key/value
+ pairs using POOL. */
+static apr_hash_t *
+string_hash_dup(apr_hash_t *hash, apr_pool_t *pool)
+{
+ apr_hash_index_t *hi;
+ apr_hash_t *new_hash = apr_hash_make(pool);
+
+ for (hi = apr_hash_first(pool, hash); hi; hi = apr_hash_next(hi))
+ {
+ const char *key = apr_pstrdup(pool, svn__apr_hash_index_key(hi));
+ apr_ssize_t klen = svn__apr_hash_index_klen(hi);
+ svn_string_t *val = svn_string_dup(svn__apr_hash_index_val(hi), pool);
+
+ apr_hash_set(new_hash, key, klen, val);
+ }
+ return new_hash;
+}
+
+svn_client_proplist_item_t *
+svn_client_proplist_item_dup(const svn_client_proplist_item_t *item,
+ apr_pool_t * pool)
+{
+ svn_client_proplist_item_t *new_item = apr_pcalloc(pool, sizeof(*new_item));
+
+ if (item->node_name)
+ new_item->node_name = svn_stringbuf_dup(item->node_name, pool);
+
+ if (item->prop_hash)
+ new_item->prop_hash = string_hash_dup(item->prop_hash, pool);
+
+ return new_item;
+}
+
/* Receiver baton used by proplist2() */
struct proplist_receiver_baton {
apr_array_header_t *props;
Modified: subversion/branches/revprop-packing/subversion/libsvn_client/util.c
URL:
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_client/util.c?rev=1143902&r1=1143901&r2=1143902&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_client/util.c
(original)
+++ subversion/branches/revprop-packing/subversion/libsvn_client/util.c Thu Jul
7 16:10:44 2011
@@ -25,7 +25,6 @@
#include <apr_strings.h>
#include "svn_pools.h"
-#include "svn_string.h"
#include "svn_error.h"
#include "svn_types.h"
#include "svn_opt.h"
@@ -42,25 +41,6 @@
#include "svn_private_config.h"
-/* Duplicate a HASH containing (char * -> svn_string_t *) key/value
- pairs using POOL. */
-static apr_hash_t *
-string_hash_dup(apr_hash_t *hash, apr_pool_t *pool)
-{
- apr_hash_index_t *hi;
- apr_hash_t *new_hash = apr_hash_make(pool);
-
- for (hi = apr_hash_first(pool, hash); hi; hi = apr_hash_next(hi))
- {
- const char *key = apr_pstrdup(pool, svn__apr_hash_index_key(hi));
- apr_ssize_t klen = svn__apr_hash_index_klen(hi);
- svn_string_t *val = svn_string_dup(svn__apr_hash_index_val(hi), pool);
-
- apr_hash_set(new_hash, key, klen, val);
- }
- return new_hash;
-}
-
svn_client_commit_item3_t *
svn_client_commit_item3_create(apr_pool_t *pool)
{
@@ -95,21 +75,6 @@ svn_client_commit_item3_dup(const svn_cl
return new_item;
}
-svn_client_proplist_item_t *
-svn_client_proplist_item_dup(const svn_client_proplist_item_t *item,
- apr_pool_t * pool)
-{
- svn_client_proplist_item_t *new_item = apr_pcalloc(pool, sizeof(*new_item));
-
- if (item->node_name)
- new_item->node_name = svn_stringbuf_dup(item->node_name, pool);
-
- if (item->prop_hash)
- new_item->prop_hash = string_hash_dup(item->prop_hash, pool);
-
- return new_item;
-}
-
svn_error_t *
svn_client__path_relative_to_root(const char **rel_path,
svn_wc_context_t *wc_ctx,
Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c
URL:
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c?rev=1143902&r1=1143901&r2=1143902&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c
(original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c Thu Jul
7 16:10:44 2011
@@ -166,6 +166,15 @@ is_packed_rev(svn_fs_t *fs, svn_revnum_t
return (rev < ffd->min_unpacked_rev);
}
+/* Return TRUE is REV is packed in FS, FALSE otherwise. */
+static svn_boolean_t
+is_packed_revprop(svn_fs_t *fs, svn_revnum_t rev)
+{
+ fs_fs_data_t *ffd = fs->fsap_data;
+
+ return (rev < ffd->min_unpacked_revprop);
+}
+
static const char *
path_format(svn_fs_t *fs, apr_pool_t *pool)
{
@@ -6523,29 +6532,12 @@ commit_body(void *baton, apr_pool_t *poo
SVN_ERR(svn_fs_fs__change_txn_prop(cb->txn, SVN_PROP_REVISION_DATE,
&date, pool));
- if (ffd->format < SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT ||
- new_rev >= ffd->min_unpacked_revprop)
- {
- /* Move the revprops file into place. */
- revprop_filename = path_txn_props(cb->fs, cb->txn->id, pool);
- final_revprop = path_revprops(cb->fs, new_rev, pool);
- SVN_ERR(move_into_place(revprop_filename, final_revprop,
- old_rev_filename, pool));
- }
- else
- {
- /* Read the revprops, and commit them to the permenant sqlite db. */
- apr_hash_t *proplist = apr_hash_make(pool);
- svn_sqlite__stmt_t *stmt;
-
- SVN_ERR(get_txn_proplist(proplist, cb->fs, cb->txn->id, pool));
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, ffd->revprop_db,
- STMT_SET_REVPROP));
- SVN_ERR(svn_sqlite__bind_int64(stmt, 1, new_rev));
- SVN_ERR(svn_sqlite__bind_properties(stmt, 2, proplist, pool));
- SVN_ERR(svn_sqlite__insert(NULL, stmt));
- }
+ /* Move the revprops file into place. */
+ assert(! is_packed_revprop(cb->fs, new_rev));
+ revprop_filename = path_txn_props(cb->fs, cb->txn->id, pool);
+ final_revprop = path_revprops(cb->fs, new_rev, pool);
+ SVN_ERR(move_into_place(revprop_filename, final_revprop,
+ old_rev_filename, pool));
/* Update the 'current' file. */
SVN_ERR(write_final_current(cb->fs, cb->txn->id, new_rev, start_node_id,
Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/structure
URL:
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/structure?rev=1143902&r1=1143901&r2=1143902&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_fs/structure
(original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_fs/structure Thu
Jul 7 16:10:44 2011
@@ -34,7 +34,7 @@ repository) is:
revs/ Subdirectory containing revs
<shard>/ Shard directory, if sharding is in use (see below)
<revnum> File containing rev <revnum>
- <shard>.pack Pack directory, if the repo has been packed (see below)
+ <shard>.pack/ Pack directory, if the repo has been packed (see below)
pack Pack file, if the repository has been packed (see below)
manifest Pack manifest file, if a pack file exists (see below)
revprops/ Subdirectory containing rev-props
@@ -104,8 +104,10 @@ When representation sharing is enabled,
representation checksum and location mappings using a SQLite database in
"rep-cache.db". The database has a single table, which stores the sha1
hash text as the primary key, mapped to the representation revision, offset,
-size and expanded size. This file is not required, and may be removed at an
-abritrary time, with the subsequent loss of rep-sharing capabilities.
+size and expanded size. This file is only consulted during writes and never
+during reads. Consequently, it is not required, and may be removed at an
+abritrary time, with the subsequent loss of rep-sharing capabilities for
+revisions written thereafter.
Filesystem formats
------------------
Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_serf/update.c
URL:
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/update.c?rev=1143902&r1=1143901&r2=1143902&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_serf/update.c
(original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_serf/update.c Thu
Jul 7 16:10:44 2011
@@ -115,13 +115,9 @@ typedef struct report_dir_t
/* the expanded directory name (including all parent names) */
const char *name;
- /* the canonical url for this directory after updating. (received) */
+ /* the canonical url for this directory. */
const char *url;
- /* The original repos_relpath of this url (from the workingcopy)
- or NULL if the repos_relpath can be calculated from the edit root. */
- const char *repos_relpath;
-
/* Our base revision - SVN_INVALID_REVNUM if we're adding this dir. */
svn_revnum_t base_rev;
@@ -319,13 +315,6 @@ struct report_context_t {
/* Path -> lock token mapping. */
apr_hash_t *lock_path_tokens;
- /* Path -> const char *repos_relpath mapping */
- apr_hash_t *switched_paths;
-
- /* Boolean indicating whether "" is switched.
- (This indicates that the we are updating a single file) */
- svn_boolean_t root_is_switched;
-
/* Our master update editor and baton. */
const svn_delta_editor_t *update_editor;
void *update_baton;
@@ -1372,9 +1361,6 @@ start_report(svn_ra_serf__xml_parser_t *
info->base_name = info->dir->base_name;
info->name = info->dir->name;
-
- info->dir->repos_relpath = apr_hash_get(ctx->switched_paths, "",
- APR_HASH_KEY_STRING);
}
else if (state == NONE)
{
@@ -1422,15 +1408,6 @@ start_report(svn_ra_serf__xml_parser_t *
dir->name = svn_relpath_join(dir->parent_dir->name, dir->base_name,
dir->pool);
info->name = dir->name;
-
- dir->repos_relpath = apr_hash_get(ctx->switched_paths, dir->name,
- APR_HASH_KEY_STRING);
-
- if (!dir->repos_relpath
- && dir->parent_dir
- && dir->parent_dir->repos_relpath)
- dir->repos_relpath = svn_relpath_join(dir->parent_dir->repos_relpath,
- dir->base_name, dir->pool);
}
else if ((state == OPEN_DIR || state == ADD_DIR) &&
strcmp(name.name, "add-directory") == 0)
@@ -1863,67 +1840,8 @@ end_report(svn_ra_serf__xml_parser_t *pa
if (info->lock_token && info->fetch_props == FALSE)
info->fetch_props = TRUE;
- /* If possible, we'd like to fetch only a delta against a
- * version of the file we already have in our working copy,
- * rather than fetching a fulltext.
- *
- * In HTTP v2, we can simply construct the URL we need given the
- * path and base revision number.
- */
- if (SVN_RA_SERF__HAVE_HTTPV2_SUPPORT(ctx->sess))
- {
- const char *fs_path;
- const char *full_path =
- svn_fspath__join(ctx->sess->session_url.path,
- svn_path_uri_encode(info->name, info->pool),
- info->pool);
-
-#if 1
- /* If this file is switched vs the editor root we should provide
- its real url instead of the one calculated from the session root.
- */
- fs_path = apr_hash_get(ctx->switched_paths, info->name,
- APR_HASH_KEY_STRING);
-
- if (!fs_path)
- {
- if (ctx->root_is_switched)
- {
- /* ### BH: Needs more review.
-
- We are updating a direct target (most likely a file)
- that is switched vs its parent url */
- SVN_ERR_ASSERT(*svn_relpath_dirname(info->name, info->pool)
- == '\0');
-
- fs_path = apr_hash_get(ctx->switched_paths, "",
- APR_HASH_KEY_STRING);
- }
- else if (info->dir->repos_relpath)
- fs_path = svn_relpath_join(info->dir->repos_relpath,
- info->base_name, info->pool);
- else if (!fs_path)
- SVN_ERR(svn_ra_serf__get_relative_path(&fs_path, full_path,
- ctx->sess, NULL,
- info->pool));
- }
-#else
- /* This code path is broken for files where fs_path is not
- the same as the repository path. (E.g. when the file is switched)
- */
- SVN_ERR(svn_ra_serf__get_relative_path(&fs_path, full_path,
- ctx->sess, NULL, info->pool));
-#endif
-
-
- info->delta_base = svn_string_createf(info->pool, "%s/%ld/%s",
- ctx->sess->rev_root_stub,
- info->base_rev, fs_path);
- }
-
- /* Still no base URL? If we have a WC, we might be able to dive all
- * the way into the WC to get the previous URL so we can do a
- * differential GET with the base URL.
+ /* If we have a WC, we might be able to dive all the way into the WC to
+ get the previous URL so we can do a differential GET with the base
URL.
*/
if ((! info->delta_base) && (ctx->sess->wc_callbacks->get_wc_prop))
{
@@ -1932,99 +1850,6 @@ end_report(svn_ra_serf__xml_parser_t *pa
SVN_RA_SERF__WC_CHECKED_IN_URL, &info->delta_base, info->pool));
}
-#if 0 /* ### FIXME: Something's not quite right with this algorithm.
- ### Would be great to figure out the problem and correct it,
- ### but that'll only bring a performance enhancement to the
- ### technical correctness of not falling back to this URL
- ### construction. Motivation is low on this, though, because
- ### HTTP v2 won't hit this block. */
-
- /* STILL no base URL? Well, all else has failed, but we can
- * manually reconstruct the base URL. This avoids us having to
- * grab two full-text for URL<->URL diffs. Instead, we can just
- * grab one full-text and a diff from the server against that
- * other file.
- */
- if (! info->delta_base)
- {
- const char *c;
- apr_size_t comp_count;
- svn_stringbuf_t *path;
-
- c = svn_ra_serf__get_ver_prop(info->props, info->base_name,
- info->base_rev, "DAV:", "checked-in");
-
- path = svn_stringbuf_create(c, info->pool);
-
- comp_count = svn_path_component_count(info->name);
-
- svn_path_remove_components(path, comp_count);
-
- /* Find out the difference of the destination compared to
- * the repos root url. Cut off this difference from path,
- * which will give us our version resource root path.
- *
- * Example:
- * path:
- * /repositories/log_tests-17/!svn/ver/4/branches/a
- * repos_root:
- * http://localhost/repositories/log_tests-17
- * destination:
- * http://localhost/repositories/log_tests-17/branches/a
- *
- * So, find 'branches/a' as the difference. Cutting it off
- * path, gives us:
- * /repositories/log_tests-17/!svn/ver/4
- */
- if (ctx->destination &&
- strcmp(ctx->destination, ctx->sess->repos_root_str) != 0)
- {
- apr_size_t root_count, src_count;
-
- src_count = svn_path_component_count(ctx->destination);
- root_count = svn_path_component_count(ctx->sess->repos_root_str);
-
- svn_path_remove_components(path, src_count - root_count);
- }
-
- /* At this point, we should just have the version number
- * remaining. We know our target revision, so we'll replace it
- * and recreate what we just chopped off.
- */
- svn_path_remove_component(path);
-
- svn_path_add_component(path, apr_ltoa(info->pool, info->base_rev));
-
- /* Similar as above, we now have to add the relative path between
- * source and root path.
- *
- * Example:
- * path:
- * /repositories/log_tests-17/!svn/ver/2
- * repos_root path:
- * /repositories/log_tests-17
- * source:
- * /repositories/log_tests-17/trunk
- *
- * So, find 'trunk' as the difference. Addding it to path, gives us:
- * /repositories/log_tests-17/!svn/ver/2/trunk
- */
- if (strcmp(ctx->source, ctx->sess->repos_root.path) != 0)
- {
- apr_size_t root_len;
-
- root_len = strlen(ctx->sess->repos_root.path) + 1;
-
- svn_path_add_component(path, &ctx->source[root_len]);
- }
-
- /* Re-add the filename. */
- svn_path_add_component(path, info->name);
-
- info->delta_base = svn_string_create_from_buf(path, info->pool);
- }
-#endif
-
SVN_ERR(fetch_file(ctx, info));
svn_ra_serf__xml_pop_state(parser);
}
@@ -2273,18 +2098,11 @@ link_path(void *report_baton,
SVN_ERR(svn_io_file_write_full(report->body_file, buf->data, buf->len,
NULL, pool));
- /* Store the switch roots to allow generating repos_relpaths from just
- the working copy paths. (Needed for HTTPv2) */
- path = apr_pstrdup(report->pool, path);
- apr_hash_set(report->switched_paths, path, APR_HASH_KEY_STRING,
- apr_pstrdup(report->pool, link+1));
-
- if (!*path)
- report->root_is_switched = TRUE;
-
if (lock_token)
{
- apr_hash_set(report->lock_path_tokens, path, APR_HASH_KEY_STRING,
+ apr_hash_set(report->lock_path_tokens,
+ apr_pstrdup(report->pool, path),
+ APR_HASH_KEY_STRING,
apr_pstrdup(report->pool, lock_token));
}
@@ -2705,7 +2523,6 @@ make_update_reporter(svn_ra_session_t *r
report->send_copyfrom_args = send_copyfrom_args;
report->text_deltas = text_deltas;
report->lock_path_tokens = apr_hash_make(report->pool);
- report->switched_paths = apr_hash_make(report->pool);
report->source = src_path;
report->destination = dest_path;
Modified: subversion/branches/revprop-packing/subversion/mod_dav_svn/util.c
URL:
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/mod_dav_svn/util.c?rev=1143902&r1=1143901&r2=1143902&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/mod_dav_svn/util.c (original)
+++ subversion/branches/revprop-packing/subversion/mod_dav_svn/util.c Thu Jul
7 16:10:44 2011
@@ -375,7 +375,8 @@ dav_svn__simple_parse_uri(dav_svn__uri_i
/* an activity */
info->activity_id = path + 5;
}
- else if (len2 == 4 && memcmp(path, "/ver/", 5) == 0)
+ else if (len2 == 4 &&
+ (memcmp(path, "/ver/", 5) == 0 || memcmp(path, "/rvr/", 5) == 0))
{
/* a version resource */
path += 5;
Modified:
subversion/branches/revprop-packing/subversion/tests/cmdline/svnadmin_tests.py
URL:
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/tests/cmdline/svnadmin_tests.py?rev=1143902&r1=1143901&r2=1143902&view=diff
==============================================================================
---
subversion/branches/revprop-packing/subversion/tests/cmdline/svnadmin_tests.py
(original)
+++
subversion/branches/revprop-packing/subversion/tests/cmdline/svnadmin_tests.py
Thu Jul 7 16:10:44 2011
@@ -465,7 +465,7 @@ def fsfs_file(repo_dir, kind, rev):
if svntest.main.options.fsfs_sharding is None:
return os.path.join(repo_dir, 'db', kind, '0', rev)
else:
- shard = int(rev) // svntest.main.fsfs_sharding
+ shard = int(rev) // svntest.main.options.fsfs_sharding
path = os.path.join(repo_dir, 'db', kind, str(shard), rev)
if svntest.main.options.fsfs_packing is None or kind == 'revprops':