You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/10/12 12:22:27 UTC
svn commit: r1708080 [1/2] - in /subversion/branches/move-tracking-2: ./
subversion/ subversion/include/ subversion/libsvn_client/
subversion/libsvn_fs/ subversion/libsvn_fs_base/ subversion/libsvn_fs_fs/
subversion/libsvn_fs_x/ subversion/libsvn_ra_se...
Author: julianfoad
Date: Mon Oct 12 10:22:26 2015
New Revision: 1708080
URL: http://svn.apache.org/viewvc?rev=1708080&view=rev
Log:
On the 'move-tracking-2' branch: catch up to trunk@1708078.
Modified:
subversion/branches/move-tracking-2/ (props changed)
subversion/branches/move-tracking-2/CHANGES (contents, props changed)
subversion/branches/move-tracking-2/subversion/ (props changed)
subversion/branches/move-tracking-2/subversion/include/svn_config.h
subversion/branches/move-tracking-2/subversion/include/svn_fs.h
subversion/branches/move-tracking-2/subversion/libsvn_client/diff.c
subversion/branches/move-tracking-2/subversion/libsvn_client/patch.c
subversion/branches/move-tracking-2/subversion/libsvn_fs/deprecated.c
subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.c
subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.h
subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c
subversion/branches/move-tracking-2/subversion/libsvn_fs_base/revs-txns.c
subversion/branches/move-tracking-2/subversion/libsvn_fs_base/revs-txns.h
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/caching.c
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.c
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.h
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.h
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/pack.c
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/revprops.c
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/revprops.h
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/temp_serializer.c
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/temp_serializer.h
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/transaction.c
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/verify.c
subversion/branches/move-tracking-2/subversion/libsvn_fs_x/ (props changed)
subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs.c
subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/multistatus.c
subversion/branches/move-tracking-2/subversion/libsvn_repos/commit.c
subversion/branches/move-tracking-2/subversion/libsvn_repos/delta.c
subversion/branches/move-tracking-2/subversion/libsvn_repos/dump.c
subversion/branches/move-tracking-2/subversion/libsvn_repos/fs-wrap.c
subversion/branches/move-tracking-2/subversion/libsvn_repos/load-fs-vtable.c
subversion/branches/move-tracking-2/subversion/libsvn_repos/log.c
subversion/branches/move-tracking-2/subversion/libsvn_repos/reporter.c
subversion/branches/move-tracking-2/subversion/libsvn_repos/rev_hunt.c
subversion/branches/move-tracking-2/subversion/libsvn_subr/stream.c
subversion/branches/move-tracking-2/subversion/libsvn_wc/conflicts.c
subversion/branches/move-tracking-2/subversion/svnlook/svnlook.c
subversion/branches/move-tracking-2/subversion/tests/cmdline/diff_tests.py
subversion/branches/move-tracking-2/subversion/tests/cmdline/export_tests.py
subversion/branches/move-tracking-2/subversion/tests/cmdline/merge_automatic_tests.py
subversion/branches/move-tracking-2/subversion/tests/cmdline/patch_tests.py
subversion/branches/move-tracking-2/subversion/tests/cmdline/svnadmin_tests.py
subversion/branches/move-tracking-2/tools/ (props changed)
subversion/branches/move-tracking-2/tools/client-side/svn-mergeinfo-normalizer/help-cmd.c
Propchange: subversion/branches/move-tracking-2/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 12 10:22:26 2015
@@ -94,4 +94,4 @@
/subversion/branches/verify-at-commit:1462039-1462408
/subversion/branches/verify-keep-going:1439280-1546110
/subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1606692-1706962
+/subversion/trunk:1606692-1708078
Modified: subversion/branches/move-tracking-2/CHANGES
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/CHANGES?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/CHANGES (original)
+++ subversion/branches/move-tracking-2/CHANGES Mon Oct 12 10:22:26 2015
@@ -118,7 +118,7 @@ http://svn.apache.org/repos/asf/subversi
* fsfs: enable dir and prop deltas by default for formats that support
it (r1555286)
* fsfs: avoid out of date errors from files in a directory changing when
- you change a property on the directory (r1558224)
+ you change a property on the directory (issue #2118)
* fsfs: temporary transaction properties are preserved when commit is
interrupted (r1549907 et al)
* fsfs: speed up transaction creation (r1544719)
Propchange: subversion/branches/move-tracking-2/CHANGES
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 12 10:22:26 2015
@@ -86,4 +86,4 @@
/subversion/branches/verify-at-commit/CHANGES:1462039-1462408
/subversion/branches/verify-keep-going/CHANGES:1439280-1546110
/subversion/branches/wc-collate-path/CHANGES:1402685-1480384
-/subversion/trunk/CHANGES:1606692-1704317
+/subversion/trunk/CHANGES:1606692-1708078
Propchange: subversion/branches/move-tracking-2/subversion/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 12 10:22:26 2015
@@ -82,4 +82,4 @@
/subversion/branches/verify-at-commit/subversion:1462039-1462408
/subversion/branches/verify-keep-going/subversion:1439280-1546110
/subversion/branches/wc-collate-path/subversion:1402685-1480384
-/subversion/trunk/subversion:1606692-1706962
+/subversion/trunk/subversion:1606692-1708078
Modified: subversion/branches/move-tracking-2/subversion/include/svn_config.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/svn_config.h?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/svn_config.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/svn_config.h Mon Oct 12 10:22:26 2015
@@ -82,18 +82,27 @@ typedef struct svn_config_t svn_config_t
#define SVN_CONFIG_OPTION_HTTP_PROXY_EXCEPTIONS "http-proxy-exceptions"
#define SVN_CONFIG_OPTION_HTTP_TIMEOUT "http-timeout"
#define SVN_CONFIG_OPTION_HTTP_COMPRESSION "http-compression"
+/** @deprecated Not used since 1.8. */
#define SVN_CONFIG_OPTION_NEON_DEBUG_MASK "neon-debug-mask"
+/** @since New in 1.5. */
#define SVN_CONFIG_OPTION_HTTP_AUTH_TYPES "http-auth-types"
#define SVN_CONFIG_OPTION_SSL_AUTHORITY_FILES "ssl-authority-files"
#define SVN_CONFIG_OPTION_SSL_TRUST_DEFAULT_CA "ssl-trust-default-ca"
#define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE "ssl-client-cert-file"
#define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_PASSWORD "ssl-client-cert-password"
+/** @deprecated Not used since 1.8.
+ * @since New in 1.5. */
#define SVN_CONFIG_OPTION_SSL_PKCS11_PROVIDER "ssl-pkcs11-provider"
+/** @since New in 1.5. */
#define SVN_CONFIG_OPTION_HTTP_LIBRARY "http-library"
+/** @since New in 1.1. */
#define SVN_CONFIG_OPTION_STORE_PASSWORDS "store-passwords"
+/** @since New in 1.6. */
#define SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS "store-plaintext-passwords"
#define SVN_CONFIG_OPTION_STORE_AUTH_CREDS "store-auth-creds"
+/** @since New in 1.6. */
#define SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP "store-ssl-client-cert-pp"
+/** @since New in 1.6. */
#define SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \
"store-ssl-client-cert-pp-plaintext"
#define SVN_CONFIG_OPTION_USERNAME "username"
@@ -129,6 +138,7 @@ typedef struct svn_config_t svn_config_t
#define SVN_CONFIG_OPTION_DIFF_EXTENSIONS "diff-extensions"
#define SVN_CONFIG_OPTION_DIFF3_CMD "diff3-cmd"
#define SVN_CONFIG_OPTION_DIFF3_HAS_PROGRAM_ARG "diff3-has-program-arg"
+/** @since New in 1.5. */
#define SVN_CONFIG_OPTION_MERGE_TOOL_CMD "merge-tool-cmd"
#define SVN_CONFIG_SECTION_MISCELLANY "miscellany"
#define SVN_CONFIG_OPTION_GLOBAL_IGNORES "global-ignores"
@@ -139,8 +149,11 @@ typedef struct svn_config_t svn_config_t
#define SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS "enable-auto-props"
/** @since New in 1.9. */
#define SVN_CONFIG_OPTION_ENABLE_MAGIC_FILE "enable-magic-file"
+/** @since New in 1.2. */
#define SVN_CONFIG_OPTION_NO_UNLOCK "no-unlock"
+/** @since New in 1.5. */
#define SVN_CONFIG_OPTION_MIMETYPES_FILE "mime-types-file"
+/** @since New in 1.5. */
#define SVN_CONFIG_OPTION_PRESERVED_CF_EXTS "preserved-conflict-file-exts"
/** @since New in 1.7. */
#define SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS "interactive-conflicts"
@@ -178,9 +191,13 @@ typedef struct svn_config_t svn_config_t
#define SVN_CONFIG_OPTION_FORCE_USERNAME_CASE "force-username-case"
/** @since New in 1.8. */
#define SVN_CONFIG_OPTION_HOOKS_ENV "hooks-env"
+/** @since New in 1.5. */
#define SVN_CONFIG_SECTION_SASL "sasl"
+/** @since New in 1.5. */
#define SVN_CONFIG_OPTION_USE_SASL "use-sasl"
+/** @since New in 1.5. */
#define SVN_CONFIG_OPTION_MIN_SSF "min-encryption"
+/** @since New in 1.5. */
#define SVN_CONFIG_OPTION_MAX_SSF "max-encryption"
/* For repository password database */
Modified: subversion/branches/move-tracking-2/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/svn_fs.h?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/svn_fs.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/svn_fs.h Mon Oct 12 10:22:26 2015
@@ -2512,11 +2512,70 @@ svn_fs_deltify_revision(svn_fs_t *fs,
svn_revnum_t revision,
apr_pool_t *pool);
+/** Make sure that all completed revision property changes to the filesystem
+ * underlying @a fs are actually visible through @a fs. Use @a scratch_pool
+ * for temporary allocations.
+ *
+ * This is an explicit synchronization barrier for revprop changes made
+ * through different #svn_fs_t for the same underlying filesystem. Any
+ * revprop change through @a fs acts as an implicit barrier, i.e. that
+ * object will see all completed revprop changes up to an including its own.
+ * Only #svn_fs_revision_prop2 and #svn_fs_revision_proplist2 have an option
+ * to not synchronize with on-disk data and potentially return outdated data
+ * as old as the last barrier.
+ *
+ * The intended use of this is implementing efficient queries in upper layers
+ * where the result only needs to include all changes up the the start of
+ * that query but does not need to pick up on changes while the query is
+ * running:
+ *
+ * @code
+ SVN_ERR(svn_fs_deltify_revision(fs, pool);
+ for (i = 0; i < n; i++)
+ SVN_ERR(svn_fs_revision_prop2(&authors[i], fs, revs[i], "svn:author",
+ FALSE, pool, pool)); @endcode
+ *
+ * @see svn_fs_revision_prop2, svn_fs_revision_proplist2
+ *
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_fs_refresh_revision_props(svn_fs_t *fs,
+ apr_pool_t *scratch_pool);
/** Set @a *value_p to the value of the property named @a propname on
* revision @a rev in the filesystem @a fs. If @a rev has no property by
- * that name, set @a *value_p to zero. Allocate the result in @a pool.
+ * that name, set @a *value_p to zero.
+ *
+ * If @a refresh is set, this call acts as a read barrier and is guaranteed
+ * to return the latest value. Otherwise, it may return data as old as the
+ * last synchronization point but can be much faster to access - in
+ * particular for packed repositories.
+ *
+ * Allocate the result in @a result_pool and use @a scratch_pool for
+ * temporary allocations.
+ *
+ * @see svn_fs_refresh_revision_props
+ *
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_fs_revision_prop2(svn_string_t **value_p,
+ svn_fs_t *fs,
+ svn_revnum_t rev,
+ const char *propname,
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/** Like #svn_fs_revision_prop2 but using @a pool for @a scratch_pool as
+ * well as @a result_pool and setting @a refresh to #TRUE.
+ *
+ * @see svn_fs_refresh_revision_props
+ *
+ * @deprecated For backward compatibility with 1.9.
*/
+SVN_DEPRECATED
svn_error_t *
svn_fs_revision_prop(svn_string_t **value_p,
svn_fs_t *fs,
@@ -2528,15 +2587,41 @@ svn_fs_revision_prop(svn_string_t **valu
/** Set @a *table_p to the entire property list of revision @a rev in
* filesystem @a fs, as an APR hash table allocated in @a pool. The table
* maps <tt>char *</tt> property names to #svn_string_t * values; the names
- * and values are allocated in @a pool.
+ * and values are allocated in @a result_pool. Use @a scratch_pool for
+ * temporary allocations.
+ *
+ * If @a refresh is set, this call acts as a read barrier and is guaranteed
+ * to return the latest value. Otherwise, it may return data as old as the
+ * last synchronization point but can be much faster to access - in
+ * particular for packed repositories.
+ *
+ * @see svn_fs_refresh_revision_props
+ *
+ * @since New in 1.10.
+ *
*/
svn_error_t *
+svn_fs_revision_proplist2(apr_hash_t **table_p,
+ svn_fs_t *fs,
+ svn_revnum_t rev,
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/** Like svn_fs_revision_proplist2 but using @a pool for @a scratch_pool as
+ * well as @a result_pool and setting @a refresh to #TRUE.
+ *
+ * @see svn_fs_refresh_revision_props
+ *
+ * @deprecated For backward compatibility with 1.9.
+ */
+SVN_DEPRECATED
+svn_error_t *
svn_fs_revision_proplist(apr_hash_t **table_p,
svn_fs_t *fs,
svn_revnum_t rev,
apr_pool_t *pool);
-
/** Change a revision's property's value, or add/delete a property.
*
* - @a fs is a filesystem, and @a rev is the revision in that filesystem
Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/diff.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/diff.c Mon Oct 12 10:22:26 2015
@@ -2017,11 +2017,15 @@ diff_repos_repos(const char **root_relpa
/* Perform a diff between a repository path and a working-copy path.
PATH_OR_URL1 may be either a URL or a working copy path. PATH2 is a
- working copy path. REVISION1 and REVISION2 are their respective
- revisions. If REVERSE is TRUE, the diff will be done in reverse.
- If PEG_REVISION is specified, then PATH_OR_URL1 is the path in the peg
- revision, and the actual repository path to be compared is
- determined by following copy history.
+ working copy path. REVISION1 is the revision of URL1. If PEG_REVISION1
+ is specified, then PATH_OR_URL1 is the path in the peg revision, and the
+ actual repository path to be compared is determined by following copy
+ history.
+
+ REVISION_KIND2 specifies which revision should be reported from the
+ working copy (BASE or WORKING)
+
+ If REVERSE is TRUE, the diff will be reported in reverse.
All other options are the same as those passed to svn_client_diff6(). */
static svn_error_t *
@@ -2030,9 +2034,9 @@ diff_repos_wc(const char **root_relpath,
struct diff_driver_info_t *ddi,
const char *path_or_url1,
const svn_opt_revision_t *revision1,
- const svn_opt_revision_t *peg_revision,
+ const svn_opt_revision_t *peg_revision1,
const char *path2,
- const svn_opt_revision_t *revision2,
+ enum svn_opt_revision_kind revision2_kind,
svn_boolean_t reverse,
svn_depth_t depth,
svn_boolean_t ignore_ancestry,
@@ -2049,7 +2053,7 @@ diff_repos_wc(const char **root_relpath,
void *reporter_baton;
const svn_delta_editor_t *diff_editor;
void *diff_edit_baton;
- svn_boolean_t rev2_is_base = (revision2->kind == svn_opt_revision_base);
+ svn_boolean_t rev2_is_base = (revision2_kind == svn_opt_revision_base);
svn_boolean_t server_supports_depth;
const char *abspath_or_url1;
const char *abspath2;
@@ -2089,10 +2093,10 @@ diff_repos_wc(const char **root_relpath,
SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &loc1,
path_or_url1, abspath2,
- peg_revision, revision1,
+ peg_revision1, revision1,
ctx, scratch_pool));
- if (revision2->kind == svn_opt_revision_base || !is_copy)
+ if (revision2_kind == svn_opt_revision_base || !is_copy)
{
/* Convert path_or_url1 to a URL to feed to do_diff. */
SVN_ERR(svn_wc_get_actual_target2(&anchor, &target, ctx->wc_ctx, path2,
@@ -2236,7 +2240,7 @@ diff_repos_wc(const char **root_relpath,
- if (is_copy && revision2->kind != svn_opt_revision_base)
+ if (is_copy && revision2_kind != svn_opt_revision_base)
{
/* Tell the RA layer we want a delta to change our txn to URL1 */
SVN_ERR(svn_ra_do_diff3(ra_session,
@@ -2311,6 +2315,7 @@ do_diff(const char **root_relpath,
const svn_opt_revision_t *revision1,
const svn_opt_revision_t *revision2,
const svn_opt_revision_t *peg_revision,
+ svn_boolean_t no_peg_revision,
svn_depth_t depth,
svn_boolean_t ignore_ancestry,
const apr_array_header_t *changelists,
@@ -2331,7 +2336,7 @@ do_diff(const char **root_relpath,
{
if (is_repos2)
{
- /* ### Ignores 'show_copies_as_adds'. */
+ /* Ignores changelists. */
SVN_ERR(diff_repos_repos(root_relpath, root_is_dir,
ddi,
path_or_url1, path_or_url2,
@@ -2344,8 +2349,11 @@ do_diff(const char **root_relpath,
else /* path_or_url2 is a working copy path */
{
SVN_ERR(diff_repos_wc(root_relpath, root_is_dir, ddi,
- path_or_url1, revision1, peg_revision,
- path_or_url2, revision2, FALSE, depth,
+ path_or_url1, revision1,
+ no_peg_revision ? revision1
+ : peg_revision,
+ path_or_url2, revision2->kind,
+ FALSE, depth,
ignore_ancestry, changelists,
diff_processor, ctx,
result_pool, scratch_pool));
@@ -2356,8 +2364,12 @@ do_diff(const char **root_relpath,
if (is_repos2)
{
SVN_ERR(diff_repos_wc(root_relpath, root_is_dir, ddi,
- path_or_url2, revision2, peg_revision,
- path_or_url1, revision1, TRUE, depth,
+ path_or_url2, revision2,
+ no_peg_revision ? revision2
+ : peg_revision,
+ path_or_url1,
+ revision1->kind,
+ TRUE, depth,
ignore_ancestry, changelists,
diff_processor, ctx,
result_pool, scratch_pool));
@@ -2376,7 +2388,7 @@ do_diff(const char **root_relpath,
scratch_pool));
/* ### What about ddi? */
-
+ /* Ignores changelists, ignore_ancestry */
SVN_ERR(svn_client__arbitrary_nodes_diff(root_relpath, root_is_dir,
abspath1, abspath2,
depth,
@@ -2580,7 +2592,8 @@ svn_client_diff6(const apr_array_header_
return svn_error_trace(do_diff(NULL, NULL, &dwi.ddi,
path_or_url1, path_or_url2,
- revision1, revision2, &peg_revision,
+ revision1, revision2,
+ &peg_revision, TRUE /* no_peg_revision */,
depth, ignore_ancestry, changelists,
TRUE /* text_deltas */,
diff_processor, ctx, pool, pool));
@@ -2663,7 +2676,8 @@ svn_client_diff_peg6(const apr_array_hea
return svn_error_trace(do_diff(NULL, NULL, &dwi.ddi,
path_or_url, path_or_url,
- start_revision, end_revision, peg_revision,
+ start_revision, end_revision,
+ peg_revision, FALSE /* no_peg_revision */,
depth, ignore_ancestry, changelists,
TRUE /* text_deltas */,
diff_processor, ctx, pool, pool));
@@ -2696,7 +2710,8 @@ svn_client_diff_summarize2(const char *p
return svn_error_trace(do_diff(p_root_relpath, NULL, NULL,
path_or_url1, path_or_url2,
- revision1, revision2, &peg_revision,
+ revision1, revision2,
+ &peg_revision, TRUE /* no_peg_revision */,
depth, ignore_ancestry, changelists,
FALSE /* text_deltas */,
diff_processor, ctx, pool, pool));
@@ -2725,7 +2740,8 @@ svn_client_diff_summarize_peg2(const cha
return svn_error_trace(do_diff(p_root_relpath, NULL, NULL,
path_or_url, path_or_url,
- start_revision, end_revision, peg_revision,
+ start_revision, end_revision,
+ peg_revision, FALSE /* no_peg_revision */,
depth, ignore_ancestry, changelists,
FALSE /* text_deltas */,
diff_processor, ctx, pool, pool));
Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/patch.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/patch.c Mon Oct 12 10:22:26 2015
@@ -1241,13 +1241,6 @@ init_patch_target(patch_target_t **patch
svn_io_file_del_none,
result_pool, scratch_pool));
- /* The reject file needs a diff header. */
- SVN_ERR(svn_stream_printf(target->reject_stream, scratch_pool,
- "--- %s" APR_EOL_STR
- "+++ %s" APR_EOL_STR,
- target->canon_path_from_patchfile,
- target->canon_path_from_patchfile));
-
/* Handle properties. */
if (! target->skipped)
{
@@ -1425,6 +1418,24 @@ init_patch_target(patch_target_t **patch
target->deleted = TRUE;
}
+ if (target->reject_stream != NULL)
+ {
+ /* The reject file needs a diff header. */
+ const char *left_src = target->canon_path_from_patchfile;
+ const char *right_src = target->canon_path_from_patchfile;
+
+ /* Handle moves specifically? */
+ if (target->added)
+ left_src = "/dev/null";
+ if (target->deleted)
+ right_src = "/dev/null";
+
+ SVN_ERR(svn_stream_printf(target->reject_stream, scratch_pool,
+ "--- %s" APR_EOL_STR
+ "+++ %s" APR_EOL_STR,
+ left_src, right_src));
+ }
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs/deprecated.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs/deprecated.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs/deprecated.c Mon Oct 12 10:22:26 2015
@@ -64,6 +64,28 @@ svn_fs_begin_txn(svn_fs_txn_t **txn_p, s
}
svn_error_t *
+svn_fs_revision_prop(svn_string_t **value_p,
+ svn_fs_t *fs,
+ svn_revnum_t rev,
+ const char *propname,
+ apr_pool_t *pool)
+{
+ return svn_error_trace(
+ svn_fs_revision_prop2(value_p, fs, rev, propname, TRUE, pool,
+ pool));
+}
+
+svn_error_t *
+svn_fs_revision_proplist(apr_hash_t **table_p,
+ svn_fs_t *fs,
+ svn_revnum_t rev,
+ apr_pool_t *pool)
+{
+ return svn_error_trace(
+ svn_fs_revision_proplist2(table_p, fs, rev, TRUE, pool, pool));
+}
+
+svn_error_t *
svn_fs_change_rev_prop(svn_fs_t *fs, svn_revnum_t rev, const char *name,
const svn_string_t *value, apr_pool_t *pool)
{
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.c Mon Oct 12 10:22:26 2015
@@ -1553,19 +1553,39 @@ svn_fs_deltify_revision(svn_fs_t *fs, sv
}
svn_error_t *
-svn_fs_revision_prop(svn_string_t **value_p, svn_fs_t *fs, svn_revnum_t rev,
- const char *propname, apr_pool_t *pool)
+svn_fs_refresh_revision_props(svn_fs_t *fs,
+ apr_pool_t *scratch_pool)
+{
+ return svn_error_trace(fs->vtable->refresh_revprops(fs, scratch_pool));
+}
+
+svn_error_t *
+svn_fs_revision_prop2(svn_string_t **value_p,
+ svn_fs_t *fs,
+ svn_revnum_t rev,
+ const char *propname,
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
return svn_error_trace(fs->vtable->revision_prop(value_p, fs, rev,
- propname, pool));
+ propname, refresh,
+ result_pool,
+ scratch_pool));
}
svn_error_t *
-svn_fs_revision_proplist(apr_hash_t **table_p, svn_fs_t *fs, svn_revnum_t rev,
- apr_pool_t *pool)
+svn_fs_revision_proplist2(apr_hash_t **table_p,
+ svn_fs_t *fs,
+ svn_revnum_t rev,
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
return svn_error_trace(fs->vtable->revision_proplist(table_p, fs, rev,
- pool));
+ refresh,
+ result_pool,
+ scratch_pool));
}
svn_error_t *
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.h?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.h Mon Oct 12 10:22:26 2015
@@ -196,11 +196,17 @@ typedef struct fs_vtable_t
{
svn_error_t *(*youngest_rev)(svn_revnum_t *youngest_p, svn_fs_t *fs,
apr_pool_t *pool);
+ svn_error_t *(*refresh_revprops)(svn_fs_t *fs, apr_pool_t *scratch_pool);
svn_error_t *(*revision_prop)(svn_string_t **value_p, svn_fs_t *fs,
svn_revnum_t rev, const char *propname,
- apr_pool_t *pool);
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
svn_error_t *(*revision_proplist)(apr_hash_t **table_p, svn_fs_t *fs,
- svn_revnum_t rev, apr_pool_t *pool);
+ svn_revnum_t rev,
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
svn_error_t *(*change_rev_prop)(svn_fs_t *fs, svn_revnum_t rev,
const char *name,
const svn_string_t *const *old_value_p,
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c Mon Oct 12 10:22:26 2015
@@ -471,6 +471,13 @@ bdb_write_config(svn_fs_t *fs)
}
static svn_error_t *
+base_bdb_refresh_revision(svn_fs_t *fs,
+ apr_pool_t *scratch_pool)
+{
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
base_bdb_info_format(int *fs_format,
svn_version_t **supports_version,
svn_fs_t *fs,
@@ -545,6 +552,7 @@ base_bdb_freeze(svn_fs_t *fs,
static fs_vtable_t fs_vtable = {
svn_fs_base__youngest_rev,
+ base_bdb_refresh_revision,
svn_fs_base__revision_prop,
svn_fs_base__revision_proplist,
svn_fs_base__change_rev_prop,
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_base/revs-txns.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_base/revs-txns.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_base/revs-txns.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_base/revs-txns.c Mon Oct 12 10:22:26 2015
@@ -194,7 +194,9 @@ svn_error_t *
svn_fs_base__revision_proplist(apr_hash_t **table_p,
svn_fs_t *fs,
svn_revnum_t rev,
- apr_pool_t *pool)
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
struct revision_proplist_args args;
apr_hash_t *table;
@@ -204,9 +206,9 @@ svn_fs_base__revision_proplist(apr_hash_
args.table_p = &table;
args.rev = rev;
SVN_ERR(svn_fs_base__retry_txn(fs, txn_body_revision_proplist, &args,
- FALSE, pool));
+ FALSE, result_pool));
- *table_p = table ? table : apr_hash_make(pool);
+ *table_p = table ? table : apr_hash_make(result_pool);
return SVN_NO_ERROR;
}
@@ -216,7 +218,9 @@ svn_fs_base__revision_prop(svn_string_t
svn_fs_t *fs,
svn_revnum_t rev,
const char *propname,
- apr_pool_t *pool)
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
struct revision_proplist_args args;
apr_hash_t *table;
@@ -227,7 +231,7 @@ svn_fs_base__revision_prop(svn_string_t
args.table_p = &table;
args.rev = rev;
SVN_ERR(svn_fs_base__retry_txn(fs, txn_body_revision_proplist, &args,
- FALSE, pool));
+ FALSE, result_pool));
/* And then the prop from that list (if there was a list). */
*value_p = svn_hash_gets(table, propname);
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_base/revs-txns.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_base/revs-txns.h?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_base/revs-txns.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_base/revs-txns.h Mon Oct 12 10:22:26 2015
@@ -172,12 +172,16 @@ svn_error_t *svn_fs_base__youngest_rev(s
svn_error_t *svn_fs_base__revision_prop(svn_string_t **value_p, svn_fs_t *fs,
svn_revnum_t rev,
const char *propname,
- apr_pool_t *pool);
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
svn_error_t *svn_fs_base__revision_proplist(apr_hash_t **table_p,
svn_fs_t *fs,
svn_revnum_t rev,
- apr_pool_t *pool);
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
svn_error_t *svn_fs_base__change_rev_prop(svn_fs_t *fs, svn_revnum_t rev,
const char *name,
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/caching.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/caching.c Mon Oct 12 10:22:26 2015
@@ -506,6 +506,21 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
no_handler,
fs->pool, pool));
+ /* if enabled, cache revprops */
+ SVN_ERR(create_cache(&(ffd->revprop_cache),
+ NULL,
+ membuffer,
+ 0, 0, /* Do not use inprocess cache */
+ svn_fs_fs__serialize_revprops,
+ svn_fs_fs__deserialize_revprops,
+ APR_HASH_KEY_STRING,
+ apr_pstrcat(pool, prefix, "REVPROP", SVN_VA_NULL),
+ SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY,
+ TRUE, /* contents is short-lived */
+ fs,
+ no_handler,
+ fs->pool, pool));
+
/* if enabled, cache fulltext and other derived information */
if (cache_fulltexts)
{
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.c Mon Oct 12 10:22:26 2015
@@ -148,6 +148,15 @@ svn_fs_fs__initialize_shared_data(svn_fs
+static svn_error_t *
+fs_refresh_revprops(svn_fs_t *fs,
+ apr_pool_t *scratch_pool)
+{
+ svn_fs_fs__reset_revprop_cache(fs);
+
+ return SVN_NO_ERROR;
+}
+
/* This function is provided for Subversion 1.0.x compatibility. It
has no effect for fsfs backed Subversion filesystems. It conforms
to the fs_library_vtable_t.bdb_set_errcall() API. */
@@ -249,6 +258,7 @@ fs_set_uuid(svn_fs_t *fs,
/* The vtable associated with a specific open filesystem. */
static fs_vtable_t fs_vtable = {
svn_fs_fs__youngest_rev,
+ fs_refresh_revprops,
svn_fs_fs__revision_prop,
svn_fs_fs__get_revision_proplist,
svn_fs_fs__change_rev_prop,
@@ -281,6 +291,7 @@ initialize_fs_struct(svn_fs_t *fs)
{
fs_fs_data_t *ffd = apr_pcalloc(fs->pool, sizeof(*ffd));
ffd->use_log_addressing = FALSE;
+ ffd->revprop_prefix = svn_stringbuf_create_empty(fs->pool);
fs->vtable = &fs_vtable;
fs->fsap_data = ffd;
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.h?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.h Mon Oct 12 10:22:26 2015
@@ -351,6 +351,15 @@ typedef struct fs_fs_data_t
rep key (revision/offset) to svn_stringbuf_t. */
svn_cache__t *fulltext_cache;
+ /* The current prefix to be used for revprop cache entries.
+ If this string is empty, a new unique prefix must be chosen. */
+ svn_stringbuf_t *revprop_prefix;
+
+ /* Revision property cache. Maps from (rev,prefix) to apr_hash_t.
+ Unparsed svn_string_t representations of the serialized hash
+ will be written to the cache but the getter returns apr_hash_t. */
+ svn_cache__t *revprop_cache;
+
/* Node properties cache. Maps from rep key to apr_hash_t. */
svn_cache__t *properties_cache;
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c Mon Oct 12 10:22:26 2015
@@ -2058,14 +2058,17 @@ svn_fs_fs__revision_prop(svn_string_t **
svn_fs_t *fs,
svn_revnum_t rev,
const char *propname,
- apr_pool_t *pool)
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
apr_hash_t *table;
SVN_ERR(svn_fs__check_fs(fs, TRUE));
- SVN_ERR(svn_fs_fs__get_revision_proplist(&table, fs, rev, pool));
+ SVN_ERR(svn_fs_fs__get_revision_proplist(&table, fs, rev, refresh,
+ scratch_pool, scratch_pool));
- *value_p = svn_hash_gets(table, propname);
+ *value_p = svn_string_dup(svn_hash_gets(table, propname), result_pool);
return SVN_NO_ERROR;
}
@@ -2090,7 +2093,10 @@ change_rev_prop_body(void *baton, apr_po
apr_hash_t *table;
const svn_string_t *present_value;
- SVN_ERR(svn_fs_fs__get_revision_proplist(&table, cb->fs, cb->rev, pool));
+ /* We always need to read the current revprops from disk.
+ * Hence, always "refresh" here. */
+ SVN_ERR(svn_fs_fs__get_revision_proplist(&table, cb->fs, cb->rev, TRUE,
+ pool, pool));
present_value = svn_hash_gets(table, cb->name);
if (cb->old_value_p)
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.h?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.h Mon Oct 12 10:22:26 2015
@@ -224,13 +224,16 @@ svn_fs_fs__with_all_locks(svn_fs_t *fs,
void *baton,
apr_pool_t *pool);
-/* Find the value of the property named PROPNAME in transaction TXN.
+/* Find the value of the property named PROPNAME in revision REV.
Return the contents in *VALUE_P. The contents will be allocated
- from POOL. */
+ from RESULT_POOL and SCRATCH_POOL is used for temporaries.
+ Invalidate any revprop cache is REFRESH is set. */
svn_error_t *svn_fs_fs__revision_prop(svn_string_t **value_p, svn_fs_t *fs,
svn_revnum_t rev,
const char *propname,
- apr_pool_t *pool);
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Change, add, or delete a property on a revision REV in filesystem
FS. NAME gives the name of the property, and value, if non-NULL,
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/pack.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/pack.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/pack.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/pack.c Mon Oct 12 10:22:26 2015
@@ -851,13 +851,13 @@ classify_nodes(path_order_t **path_order
*/
static void
sort_reps_range(pack_context_t *context,
- const path_order_t **path_order,
- const path_order_t **temp,
+ path_order_t **path_order,
+ path_order_t **temp,
int first,
int last)
{
const svn_prefix_string__t *path;
- int i, dest, best;
+ int i, dest;
svn_fs_fs__id_part_t rep_id;
fs_fs_data_t *ffd = context->fs->fsap_data;
@@ -874,49 +874,47 @@ sort_reps_range(pack_context_t *context,
* We simply pick & chose from the existing path, rev order.
*/
dest = first;
- path = path_order[first]->path;
- best = first;
- /* (1) For each path, pick the "roundest" representation and put it in
- * front of all other nodes in the pack file. The "roundest" rep is
- * the one most likely to be referenced from future pack files, i.e. we
- * concentrate those potential "foreign link targets" in one section of
- * the pack file.
+ /* (1) There are two classes of representations that are likely to be
+ * referenced from future shards. These form a "hot zone" of mostly
+ * relevant data, i.e. we try to include as many reps as possible that
+ * are needed for future checkouts while trying to exclude as many as
+ * possible that are likely not needed in future checkouts.
*
- * And we only apply this to reps outside the linear deltification
- * sections because references *into* linear deltification ranges are
- * much less likely.
+ * First, "very round" representations from frequently changing nodes.
+ * That excludes many in-between representations not accessed from HEAD.
+ *
+ * The second class are infrequently changing nodes. Because they are
+ * unlikely to change often in the future, they will remain relevant for
+ * HEAD even over long spans of revisions. They are most likely the only
+ * thing we need from very old pack files.
*/
for (i = first; i < last; ++i)
{
- /* Investigated all nodes for the current path? */
- if (svn_prefix_string__compare(path, path_order[i]->path))
- {
- /* next path */
- path = path_order[i]->path;
-
- /* Pick roundest non-linear deltified node. */
- if (roundness(path_order[best]->predecessor_count)
- >= ffd->max_linear_deltification)
- {
- temp[dest++] = path_order[best];
- path_order[best] = NULL;
- best = i;
- }
- }
+ int round = roundness(path_order[i]->predecessor_count);
- /* next entry */
- if ( roundness(path_order[best]->predecessor_count)
- < roundness(path_order[i]->predecessor_count))
- best = i;
- }
+ /* Class 1:
+ * Pretty round _and_ a significant stop in the node's delta chain.
+ * This may pick up more than one representation from the same chain
+ * but that's rare not a problem. Prefer simple checks here. */
+ svn_boolean_t likely_target
+ = (round >= ffd->max_linear_deltification)
+ && (4 * round >= path_order[i]->predecessor_count);
+
+ /* Class 2:
+ * Anything from short node chains. The default of 16 is generous
+ * but we'd rather include to many than to few nodes here to keep
+ * seeks between different regions of this pack file at a minimum. */
+ svn_boolean_t likely_head
+ = path_order[i]->predecessor_count
+ < ffd->max_linear_deltification;
- /* Treat the last path the same as all others. */
- if (roundness(path_order[best]->predecessor_count)
- >= ffd->max_linear_deltification)
- {
- temp[dest++] = path_order[best];
- path_order[best] = NULL;
+ /* Pick any node that from either class. */
+ if (likely_target || likely_head)
+ {
+ temp[dest++] = path_order[i];
+ path_order[i] = NULL;
+ }
}
/* (2) For each (remaining) path, pick the nodes along the delta chain
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/revprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/revprops.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/revprops.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/revprops.c Mon Oct 12 10:22:26 2015
@@ -28,6 +28,7 @@
#include "fs_fs.h"
#include "revprops.h"
+#include "temp_serializer.h"
#include "util.h"
#include "private/svn_subr_private.h"
@@ -139,9 +140,6 @@ typedef struct packed_revprops_t
/* revision number to read (not necessarily the first in the pack) */
svn_revnum_t revision;
- /* current revprop generation. Used when populating the revprop cache */
- apr_int64_t generation;
-
/* the actual revision properties */
apr_hash_t *properties;
@@ -184,35 +182,72 @@ typedef struct packed_revprops_t
/* Parse the serialized revprops in CONTENT and return them in *PROPERTIES.
* Also, put them into the revprop cache, if activated, for future use.
- * Three more parameters are being used to update the revprop cache: FS is
- * our file system, the revprops belong to REVISION and the global revprop
- * GENERATION is used as well.
*
- * The returned hash will be allocated in POOL, SCRATCH_POOL is being used
- * for temporary allocations.
+ * The returned hash will be allocated in RESULT_POOL, SCRATCH_POOL is being
+ * used for temporary allocations.
*/
static svn_error_t *
parse_revprop(apr_hash_t **properties,
svn_fs_t *fs,
svn_revnum_t revision,
- apr_int64_t generation,
svn_string_t *content,
- apr_pool_t *pool,
+ apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
svn_stream_t *stream = svn_stream_from_string(content, scratch_pool);
- *properties = apr_hash_make(pool);
+ *properties = apr_hash_make(result_pool);
- SVN_ERR_W(svn_hash_read2(*properties, stream, SVN_HASH_TERMINATOR, pool),
+ SVN_ERR_W(svn_hash_read2(*properties, stream, SVN_HASH_TERMINATOR,
+ result_pool),
apr_psprintf(scratch_pool, "Failed to parse revprops for r%ld.",
revision));
return SVN_NO_ERROR;
}
+void
+svn_fs_fs__reset_revprop_cache(svn_fs_t *fs)
+{
+ fs_fs_data_t *ffd = fs->fsap_data;
+ svn_stringbuf_setempty(ffd->revprop_prefix);
+}
+
+/* If FS has not a revprop cache prefix set, generate one.
+ * Always call this before accessing the revprop cache.
+ */
+static void
+prepare_revprop_cache(svn_fs_t *fs,
+ apr_pool_t *scratch_pool)
+{
+ fs_fs_data_t *ffd = fs->fsap_data;
+ if (svn_stringbuf_isempty(ffd->revprop_prefix))
+ svn_stringbuf_set(ffd->revprop_prefix, svn_uuid_generate(scratch_pool));
+}
+
+/* Store the unparsed revprop hash CONTENT for REVISION in FS's revprop
+ * cache. Use SCRATCH_POOL for temporary allocations. */
+static svn_error_t *
+cache_revprops(svn_fs_t *fs,
+ svn_revnum_t revision,
+ svn_string_t *content,
+ apr_pool_t *scratch_pool)
+{
+ fs_fs_data_t *ffd = fs->fsap_data;
+ const char *key;
+
+ /* Make sure prepare_revprop_cache() has been called. */
+ SVN_ERR_ASSERT(!svn_stringbuf_isempty(ffd->revprop_prefix));
+ key = svn_fs_fs__combine_number_and_string(revision,
+ ffd->revprop_prefix->data,
+ scratch_pool);
+
+ SVN_ERR(svn_cache__set(ffd->revprop_cache, key, content, scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
/* Read the non-packed revprops for revision REV in FS, put them into the
- * revprop cache if activated and return them in *PROPERTIES. GENERATION
- * is the current revprop generation.
+ * revprop cache if PROPULATE_CACHE is set and return them in *PROPERTIES.
*
* If the data could not be read due to an otherwise recoverable error,
* leave *PROPERTIES unchanged. No error will be returned in that case.
@@ -223,7 +258,7 @@ static svn_error_t *
read_non_packed_revprop(apr_hash_t **properties,
svn_fs_t *fs,
svn_revnum_t rev,
- apr_int64_t generation,
+ svn_boolean_t populate_cache,
apr_pool_t *pool)
{
svn_stringbuf_t *content = NULL;
@@ -244,9 +279,13 @@ read_non_packed_revprop(apr_hash_t **pro
}
if (content)
- SVN_ERR(parse_revprop(properties, fs, rev, generation,
- svn_stringbuf__morph_into_string(content),
- pool, iterpool));
+ {
+ svn_string_t *as_string = svn_stringbuf__morph_into_string(content);
+ SVN_ERR(parse_revprop(properties, fs, rev, as_string, pool, iterpool));
+
+ if (populate_cache)
+ SVN_ERR(cache_revprops(fs, rev, as_string, iterpool));
+ }
svn_pool_clear(iterpool);
@@ -267,12 +306,13 @@ get_min_filename_len(packed_revprops_t *
}
/* Given FS and REVPROPS->REVISION, fill the FILENAME, FOLDER and MANIFEST
- * members. Use POOL for allocating results and SCRATCH_POOL for temporaries.
+ * members. Use RESULT_POOL for allocating results and SCRATCH_POOL for
+ * temporaries.
*/
static svn_error_t *
get_revprop_packname(svn_fs_t *fs,
packed_revprops_t *revprops,
- apr_pool_t *pool,
+ apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
fs_fs_data_t *ffd = fs->fsap_data;
@@ -293,18 +333,20 @@ get_revprop_packname(svn_fs_t *fs,
--rev_count;
}
- revprops->manifest = apr_array_make(pool, rev_count, sizeof(const char*));
+ revprops->manifest = apr_array_make(result_pool, rev_count,
+ sizeof(const char*));
/* No line in the file can be less than this number of chars long. */
min_filename_len = get_min_filename_len(revprops);
/* Read the content of the manifest file */
revprops->folder
- = svn_fs_fs__path_revprops_pack_shard(fs, revprops->revision, pool);
+ = svn_fs_fs__path_revprops_pack_shard(fs, revprops->revision,
+ result_pool);
manifest_file_path
- = svn_dirent_join(revprops->folder, PATH_MANIFEST, pool);
+ = svn_dirent_join(revprops->folder, PATH_MANIFEST, result_pool);
- SVN_ERR(svn_fs_fs__read_content(&content, manifest_file_path, pool));
+ SVN_ERR(svn_fs_fs__read_content(&content, manifest_file_path, result_pool));
/* There CONTENT must have a certain minimal size and there no
* unterminated lines at the end of the file. Both guarantees also
@@ -387,7 +429,8 @@ same_shard(svn_fs_t *fs,
/* Given FS and the full packed file content in REVPROPS->PACKED_REVPROPS,
* fill the START_REVISION member, and make PACKED_REVPROPS point to the
* first serialized revprop. If READ_ALL is set, initialize the SIZES
- * and OFFSETS members as well.
+ * and OFFSETS members as well. If POPULATE_CACHE is set, cache all
+ * revprops found in this pack.
*
* Parse the revprops for REVPROPS->REVISION and set the PROPERTIES as
* well as the SERIALIZED_SIZE member. If revprop caching has been
@@ -397,7 +440,8 @@ static svn_error_t *
parse_packed_revprops(svn_fs_t *fs,
packed_revprops_t *revprops,
svn_boolean_t read_all,
- apr_pool_t *pool,
+ svn_boolean_t populate_cache,
+ apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
svn_stream_t *stream;
@@ -409,7 +453,7 @@ parse_packed_revprops(svn_fs_t *fs,
/* decompress (even if the data is only "stored", there is still a
* length header to remove) */
svn_stringbuf_t *compressed = revprops->packed_revprops;
- svn_stringbuf_t *uncompressed = svn_stringbuf_create_empty(pool);
+ svn_stringbuf_t *uncompressed = svn_stringbuf_create_empty(result_pool);
SVN_ERR(svn__decompress(compressed->data, compressed->len,
uncompressed, APR_SIZE_MAX));
@@ -449,18 +493,21 @@ parse_packed_revprops(svn_fs_t *fs,
offset = header_end - uncompressed->data + 2;
- revprops->packed_revprops = svn_stringbuf_create_empty(pool);
+ revprops->packed_revprops = svn_stringbuf_create_empty(result_pool);
revprops->packed_revprops->data = uncompressed->data + offset;
revprops->packed_revprops->len = (apr_size_t)(uncompressed->len - offset);
- revprops->packed_revprops->blocksize = (apr_size_t)(uncompressed->blocksize - offset);
+ revprops->packed_revprops->blocksize = (apr_size_t)(uncompressed->blocksize
+ - offset);
/* STREAM still points to the first entry in the sizes list. */
revprops->start_revision = (svn_revnum_t)first_rev;
if (read_all)
{
/* Init / construct REVPROPS members. */
- revprops->sizes = apr_array_make(pool, (int)count, sizeof(offset));
- revprops->offsets = apr_array_make(pool, (int)count, sizeof(offset));
+ revprops->sizes = apr_array_make(result_pool, (int)count,
+ sizeof(offset));
+ revprops->offsets = apr_array_make(result_pool, (int)count,
+ sizeof(offset));
}
/* Now parse, revision by revision, the size and content of each
@@ -485,16 +532,19 @@ parse_packed_revprops(svn_fs_t *fs,
if (revision == revprops->revision)
{
+ /* Parse (and possibly cache) the one revprop list we care about. */
SVN_ERR(parse_revprop(&revprops->properties, fs, revision,
- revprops->generation, &serialized,
- pool, iterpool));
+ &serialized, result_pool, iterpool));
revprops->serialized_size = serialized.len;
/* If we only wanted the revprops for REVISION then we are done. */
- if (!read_all)
+ if (!read_all && !populate_cache)
break;
}
+ if (populate_cache)
+ SVN_ERR(cache_revprops(fs, revision, &serialized, iterpool));
+
if (read_all)
{
/* fill REVPROPS data structures */
@@ -510,7 +560,7 @@ parse_packed_revprops(svn_fs_t *fs,
}
/* In filesystem FS, read the packed revprops for revision REV into
- * *REVPROPS. Use GENERATION to populate the revprop cache, if enabled.
+ * *REVPROPS. Populate the revprop cache, if POPULATE_CACHE is set.
* If you want to modify revprop contents / update REVPROPS, READ_ALL
* must be set. Otherwise, only the properties of REV are being provided.
* Allocate data in POOL.
@@ -519,8 +569,8 @@ static svn_error_t *
read_pack_revprop(packed_revprops_t **revprops,
svn_fs_t *fs,
svn_revnum_t rev,
- apr_int64_t generation,
svn_boolean_t read_all,
+ svn_boolean_t populate_cache,
apr_pool_t *pool)
{
apr_pool_t *iterpool = svn_pool_create(pool);
@@ -540,7 +590,6 @@ read_pack_revprop(packed_revprops_t **re
/* initialize the result data structure */
result = apr_pcalloc(pool, sizeof(*result));
result->revision = rev;
- result->generation = generation;
/* try to read the packed revprops. This may require retries if we have
* concurrent writers. */
@@ -571,7 +620,8 @@ read_pack_revprop(packed_revprops_t **re
_("Failed to read revprop pack file for r%ld"), rev);
/* parse it. RESULT will be complete afterwards. */
- err = parse_packed_revprops(fs, result, read_all, pool, iterpool);
+ err = parse_packed_revprops(fs, result, read_all, populate_cache, pool,
+ iterpool);
svn_pool_destroy(iterpool);
if (err)
return svn_error_createf(SVN_ERR_FS_CORRUPT, err,
@@ -590,16 +640,49 @@ svn_error_t *
svn_fs_fs__get_revision_proplist(apr_hash_t **proplist_p,
svn_fs_t *fs,
svn_revnum_t rev,
- apr_pool_t *pool)
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
fs_fs_data_t *ffd = fs->fsap_data;
- apr_int64_t generation = 0;
+
+ /* Only populate the cache if we did not just cross a sync barrier.
+ * This is to eliminate overhead from code that always sets REFRESH.
+ * For callers that want caching, the caching kicks in on read "later". */
+ svn_boolean_t populate_cache = !refresh;
/* not found, yet */
*proplist_p = NULL;
/* should they be available at all? */
- SVN_ERR(svn_fs_fs__ensure_revision_exists(rev, fs, pool));
+ SVN_ERR(svn_fs_fs__ensure_revision_exists(rev, fs, scratch_pool));
+
+ if (refresh)
+ {
+ /* Previous cache contents is invalid now. */
+ svn_fs_fs__reset_revprop_cache(fs);
+ }
+ else
+ {
+ /* Try cache lookup first. */
+ svn_boolean_t is_cached;
+ const char *key;
+
+ /* Auto-alloc prefix and construct the key. */
+ prepare_revprop_cache(fs, scratch_pool);
+ key = svn_fs_fs__combine_number_and_string(rev,
+ ffd->revprop_prefix->data,
+ scratch_pool);
+
+ /* The only way that this might error out is due to parser error. */
+ SVN_ERR_W(svn_cache__get((void **) proplist_p, &is_cached,
+ ffd->revprop_cache, key, result_pool),
+ apr_psprintf(scratch_pool,
+ "Failed to parse revprops for r%ld.",
+ rev));
+ if (is_cached)
+ return SVN_NO_ERROR;
+ }
/* if REV had not been packed when we began, try reading it from the
* non-packed shard. If that fails, we will fall through to packed
@@ -607,7 +690,7 @@ svn_fs_fs__get_revision_proplist(apr_has
if (!svn_fs_fs__is_packed_revprop(fs, rev))
{
svn_error_t *err = read_non_packed_revprop(proplist_p, fs, rev,
- generation, pool);
+ populate_cache, result_pool);
if (err)
{
if (!APR_STATUS_IS_ENOENT(err->apr_err)
@@ -625,7 +708,8 @@ svn_fs_fs__get_revision_proplist(apr_has
if (ffd->format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT && !*proplist_p)
{
packed_revprops_t *revprops;
- SVN_ERR(read_pack_revprop(&revprops, fs, rev, generation, FALSE, pool));
+ SVN_ERR(read_pack_revprop(&revprops, fs, rev, FALSE, populate_cache,
+ result_pool));
*proplist_p = revprops->properties;
}
@@ -903,7 +987,6 @@ write_packed_revprop(const char **final_
{
fs_fs_data_t *ffd = fs->fsap_data;
packed_revprops_t *revprops;
- apr_int64_t generation = 0;
svn_stream_t *stream;
apr_file_t *file;
svn_stringbuf_t *serialized;
@@ -911,7 +994,7 @@ write_packed_revprop(const char **final_
int changed_index;
/* read contents of the current pack file */
- SVN_ERR(read_pack_revprop(&revprops, fs, rev, generation, TRUE, pool));
+ SVN_ERR(read_pack_revprop(&revprops, fs, rev, TRUE, FALSE, pool));
/* serialize the new revprops */
serialized = svn_stringbuf_create_empty(pool);
@@ -1063,6 +1146,9 @@ svn_fs_fs__set_revision_proplist(svn_fs_
SVN_ERR(write_non_packed_revprop(&final_path, &tmp_path,
fs, rev, proplist, pool));
+ /* Previous cache contents is invalid now. */
+ svn_fs_fs__reset_revprop_cache(fs);
+
/* We use the rev file of this revision as the perms reference,
* because when setting revprops for the first time, the revprop
* file won't exist and therefore can't serve as its own reference.
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/revprops.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/revprops.h?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/revprops.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/revprops.h Mon Oct 12 10:22:26 2015
@@ -58,15 +58,23 @@ svn_fs_fs__upgrade_cleanup_pack_revprops
void *cancel_baton,
apr_pool_t *scratch_pool);
+/* Invalidate the revprop cache in FS. */
+void
+svn_fs_fs__reset_revprop_cache(svn_fs_t *fs);
+
/* Read the revprops for revision REV in FS and return them in *PROPERTIES_P.
+ * If REFRESH is set, clear the revprop cache before accessing the data.
*
- * Allocations will be done in POOL.
+ * The result will be allocated in RESULT_POOL; SCRATCH_POOL is used for
+ * temporaries.
*/
svn_error_t *
svn_fs_fs__get_revision_proplist(apr_hash_t **proplist_p,
svn_fs_t *fs,
svn_revnum_t rev,
- apr_pool_t *pool);
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Set the revision property list of revision REV in filesystem FS to
PROPLIST. Use POOL for temporary allocations. */
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/temp_serializer.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/temp_serializer.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/temp_serializer.c Mon Oct 12 10:22:26 2015
@@ -663,6 +663,44 @@ svn_fs_fs__deserialize_properties(void *
}
svn_error_t *
+svn_fs_fs__serialize_revprops(void **data,
+ apr_size_t *data_len,
+ void *in,
+ apr_pool_t *pool)
+{
+ svn_string_t *buffer = in;
+
+ *data = (void *)buffer->data;
+ *data_len = buffer->len;
+
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_fs_fs__deserialize_revprops(void **out,
+ void *data,
+ apr_size_t data_len,
+ apr_pool_t *pool)
+{
+ apr_hash_t *properties;
+ svn_stream_t *stream;
+
+ svn_string_t buffer;
+ buffer.data = data;
+ buffer.len = data_len;
+
+ stream = svn_stream_from_string(&buffer, pool);
+ properties = svn_hash__make(pool);
+
+ SVN_ERR(svn_hash_read2(properties, stream, SVN_HASH_TERMINATOR, pool));
+
+ /* done */
+ *out = properties;
+
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
svn_fs_fs__serialize_id(void **data,
apr_size_t *data_len,
void *in,
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/temp_serializer.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/temp_serializer.h?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/temp_serializer.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/temp_serializer.h Mon Oct 12 10:22:26 2015
@@ -156,6 +156,26 @@ svn_fs_fs__deserialize_properties(void *
apr_pool_t *pool);
/**
+ * Implements #svn_cache__serialize_func_t for a properties hash
+ * (@a in is an #apr_hash_t of svn_string_t elements, keyed by const char*).
+ */
+svn_error_t *
+svn_fs_fs__serialize_revprops(void **data,
+ apr_size_t *data_len,
+ void *in,
+ apr_pool_t *pool);
+
+/**
+ * Implements #svn_cache__deserialize_func_t for a properties hash
+ * (@a *out is an #apr_hash_t of svn_string_t elements, keyed by const char*).
+ */
+svn_error_t *
+svn_fs_fs__deserialize_revprops(void **out,
+ void *data,
+ apr_size_t data_len,
+ apr_pool_t *pool);
+
+/**
* Implements #svn_cache__serialize_func_t for #svn_fs_id_t
*/
svn_error_t *
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/transaction.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/transaction.c Mon Oct 12 10:22:26 2015
@@ -1565,7 +1565,6 @@ svn_fs_fs__set_entry(svn_fs_t *fs,
const char *key
= svn_fs_fs__id_unparse(parent_noderev->id, subpool)->data;
svn_fs_fs__dir_data_t dir_data;
- svn_filesize_t filesize;
/* Flush APR buffers. */
SVN_ERR(svn_io_file_flush(file, subpool));
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/verify.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/verify.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/verify.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/verify.c Mon Oct 12 10:22:26 2015
@@ -30,6 +30,7 @@
#include "cached_data.h"
#include "rep-cache.h"
+#include "revprops.h"
#include "util.h"
#include "index.h"
@@ -721,6 +722,10 @@ verify_revprops(svn_fs_t *fs,
svn_revnum_t revision;
apr_pool_t *iterpool = svn_pool_create(pool);
+ /* Invalidate the revprop cache once.
+ * Use the cache inside the loop to speed up packed revprop access. */
+ svn_fs_fs__reset_revprop_cache(fs);
+
for (revision = start; revision < end; ++revision)
{
svn_string_t *date;
@@ -731,7 +736,8 @@ verify_revprops(svn_fs_t *fs,
/* Access the svn:date revprop.
* This implies parsing all revprops for that revision. */
SVN_ERR(svn_fs_fs__revision_prop(&date, fs, revision,
- SVN_PROP_REVISION_DATE, iterpool));
+ SVN_PROP_REVISION_DATE, FALSE,
+ iterpool, iterpool));
/* The time stamp is the only revprop that, if given, needs to
* have a valid content. */
Propchange: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 12 10:22:26 2015
@@ -94,4 +94,4 @@
/subversion/branches/verify-keep-going/subversion/libsvn_fs_x:1439280-1492639,1546002-1546110
/subversion/branches/wc-collate-path/subversion/libsvn_fs_x:1402685-1480384
/subversion/trunk/subversion/libsvn_fs_fs:1415133-1596500,1596567,1597414,1597989,1598273,1599140,1600872,1601633,1603485-1603487,1603499,1603605,1604128,1604188,1604413-1604414,1604416-1604417,1604421,1604442,1604700,1604717,1604720,1604726,1604755,1604794,1604802,1604824,1604836,1604844,1604902-1604903,1604911,1604925,1604933,1604947,1605059-1605060,1605064-1605065,1605068,1605071-1605073,1605075,1605123,1605188-1605189,1605191,1605197,1605444,1605633,1606132,1606142,1606144,1606514,1606526,1606528,1606551,1606554,1606564,1606598-1606599,1606656,1606658,1606662,1606744,1606840,1607085,1607572,1612407,1612810,1613339,1613872,1614611,1615348,1615351-1615352,1615356,1616338-1616339,1616613,1617586,1617688,1618138,1618151,1618153,1618226,1618641,1618653,1618662,1619068,1619358,1619413,1619769,1619774,1620602,1620909,1620912,1620928,1620930,1621275,1621635,1622931,1622937,1622942,1622946,1622959-1622960,1622963,1622987,1623007,1623368,1623373,1623377,1623379,1623381,1623398,1623402,162
4011,1624265,1624512,1626246,1626871,1626873,1626886,1627497-1627498,1627502,1627947-1627949,1627966,1628083,1628093,1628158-1628159,1628161,1628392-1628393,1628415,1628427,1628676,1628738,1628762,1628764,1629854-1629855,1629857,1629865,1629873,1629875,1629879,1630067,1630070,1631049-1631051,1631075,1631115,1631171,1631180,1631185-1631186,1631196-1631197,1631239-1631240,1631548,1631550,1631563,1631567,1631588,1631598,1632646,1632776,1632849,1632851-1632853,1632856-1632857,1632868,1632908,1632926,1633232,1633617-1633618,1634872,1634875,1634879-1634880,1634920,1636478,1636483,1636629,1636644,1637184,1637186,1637330,1637358,1637363,1637393,1639319,1639322,1639335,1639348,1639352,1639355,1639358,1639414,1639419,1639426,1639430,1639436,1639440,1639549,1640061-1640062,1640197,1640915,1640966,1641013,1643139,1643233,1645567,1646021,1646712,1646716,1647537,1647540-1647541,1647820,1647905,1648230,1648238,1648241-1648243,1648253,1648272,1648532,1648537-1648539,1648542,1648591,1648612,1653608,
1658482
-/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1606692-1705711
+/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1606692-1708078
Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_x/fs.c Mon Oct 12 10:22:26 2015
@@ -218,6 +218,13 @@ x_info(const void **fsx_info,
return SVN_NO_ERROR;
}
+static svn_error_t *
+x_refresh_revprops(svn_fs_t *fs,
+ apr_pool_t *scratch_pool)
+{
+ return SVN_NO_ERROR;
+}
+
/* Wrapper around svn_fs_x__revision_prop() adapting between function
signatures. */
static svn_error_t *
@@ -225,12 +232,12 @@ x_revision_prop(svn_string_t **value_p,
svn_fs_t *fs,
svn_revnum_t rev,
const char *propname,
- apr_pool_t *pool)
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
- apr_pool_t *scratch_pool = svn_pool_create(pool);
- SVN_ERR(svn_fs_x__revision_prop(value_p, fs, rev, propname, pool,
+ SVN_ERR(svn_fs_x__revision_prop(value_p, fs, rev, propname, result_pool,
scratch_pool));
- svn_pool_destroy(scratch_pool);
return SVN_NO_ERROR;
}
@@ -241,14 +248,13 @@ static svn_error_t *
x_revision_proplist(apr_hash_t **proplist_p,
svn_fs_t *fs,
svn_revnum_t rev,
- apr_pool_t *pool)
+ svn_boolean_t refresh,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
- apr_pool_t *scratch_pool = svn_pool_create(pool);
-
/* No need to bypass the caches for r/o access to revprops. */
SVN_ERR(svn_fs_x__get_revision_proplist(proplist_p, fs, rev, FALSE,
- pool, scratch_pool));
- svn_pool_destroy(scratch_pool);
+ result_pool, scratch_pool));
return SVN_NO_ERROR;
}
@@ -285,6 +291,7 @@ x_begin_txn(svn_fs_txn_t **txn_p,
/* The vtable associated with a specific open filesystem. */
static fs_vtable_t fs_vtable = {
svn_fs_x__youngest_rev,
+ x_refresh_revprops,
x_revision_prop,
x_revision_proplist,
svn_fs_x__change_rev_prop,
Modified: subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/multistatus.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/multistatus.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/multistatus.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/multistatus.c Mon Oct 12 10:22:26 2015
@@ -707,7 +707,16 @@ svn_ra_serf__handle_server_error(svn_ra_
clear the error and return - allowing serf to wait for more data.
*/
if (!err || SERF_BUCKET_READ_ERROR(err->apr_err))
- return svn_error_trace(err);
+ {
+ /* Perhaps we already parsed some server generated message. Let's pass
+ all information we can get.*/
+ if (err)
+ err = svn_error_compose_create(
+ svn_ra_serf__server_error_create(handler, scratch_pool),
+ err);
+
+ return svn_error_trace(err);
+ }
if (!APR_STATUS_IS_EOF(err->apr_err))
{
Modified: subversion/branches/move-tracking-2/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_repos/commit.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_repos/commit.c Mon Oct 12 10:22:26 2015
@@ -214,11 +214,11 @@ invoke_commit_cb(svn_commit_callback2_t
if (commit_cb == NULL)
return SVN_NO_ERROR;
- SVN_ERR(svn_fs_revision_prop(&date, fs, revision, SVN_PROP_REVISION_DATE,
- scratch_pool));
- SVN_ERR(svn_fs_revision_prop(&author, fs, revision,
- SVN_PROP_REVISION_AUTHOR,
- scratch_pool));
+ SVN_ERR(svn_fs_revision_prop2(&date, fs, revision, SVN_PROP_REVISION_DATE,
+ TRUE, scratch_pool, scratch_pool));
+ SVN_ERR(svn_fs_revision_prop2(&author, fs, revision,
+ SVN_PROP_REVISION_AUTHOR,
+ TRUE, scratch_pool, scratch_pool));
commit_info = svn_create_commit_info(scratch_pool);
Modified: subversion/branches/move-tracking-2/subversion/libsvn_repos/delta.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_repos/delta.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_repos/delta.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_repos/delta.c Mon Oct 12 10:22:26 2015
@@ -266,6 +266,13 @@ svn_repos_dir_delta2(svn_fs_root_t *src_
_("Invalid editor anchoring; at least one of the "
"input paths is not a directory and there was no source entry"));
+ /* Don't report / compare stale revprops. However, revprop changes that
+ * are made by a 3rd party outside this delta operation, may not be
+ * detected as per our visibility guarantees. Reset the revprop caches
+ * for both roots in case they belong to different svn_fs_t instances. */
+ SVN_ERR(svn_fs_refresh_revision_props(svn_fs_root_fs(tgt_root), pool));
+ SVN_ERR(svn_fs_refresh_revision_props(svn_fs_root_fs(src_root), pool));
+
/* Set the global target revision if one can be determined. */
if (svn_fs_is_revision_root(tgt_root))
{
@@ -491,8 +498,8 @@ delta_proplists(struct context *c,
SVN_ERR(change_fn(c, object, SVN_PROP_ENTRY_COMMITTED_REV,
cr_str, subpool));
- SVN_ERR(svn_fs_revision_proplist(&r_props, fs, committed_rev,
- pool));
+ SVN_ERR(svn_fs_revision_proplist2(&r_props, fs, committed_rev,
+ FALSE, pool, subpool));
/* Transmit the committed-date. */
committed_date = svn_hash_gets(r_props, SVN_PROP_REVISION_DATE);
Modified: subversion/branches/move-tracking-2/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_repos/dump.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_repos/dump.c Mon Oct 12 10:22:26 2015
@@ -1934,7 +1934,7 @@ write_revision_record(svn_stream_t *stre
if (include_revprops)
{
- SVN_ERR(svn_fs_revision_proplist(&props, fs, rev, pool));
+ SVN_ERR(svn_fs_revision_proplist2(&props, fs, rev, FALSE, pool, pool));
/* Run revision date properties through the time conversion to
canonicalize them. */
@@ -1991,6 +1991,10 @@ svn_repos_dump_fs4(svn_repos_t *repos,
svn_boolean_t found_old_mergeinfo = FALSE;
svn_repos_notify_t *notify;
+ /* Make sure we catch up on the latest revprop changes. This is the only
+ * time we will refresh the revprop data in this query. */
+ SVN_ERR(svn_fs_refresh_revision_props(fs, pool));
+
/* Determine the current youngest revision of the filesystem. */
SVN_ERR(svn_fs_youngest_rev(&youngest, fs, pool));
@@ -2325,7 +2329,8 @@ verify_one_revision(svn_fs_t *fs,
do this for completeness. */
SVN_ERR(cancel_editor->close_edit(cancel_edit_baton, scratch_pool));
- SVN_ERR(svn_fs_revision_proplist(&props, fs, rev, scratch_pool));
+ SVN_ERR(svn_fs_revision_proplist2(&props, fs, rev, FALSE, scratch_pool,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -2405,6 +2410,10 @@ svn_repos_verify_fs3(svn_repos_t *repos,
struct verify_fs_notify_func_baton_t *verify_notify_baton = NULL;
svn_error_t *err;
+ /* Make sure we catch up on the latest revprop changes. This is the only
+ * time we will refresh the revprop data in this query. */
+ SVN_ERR(svn_fs_refresh_revision_props(fs, pool));
+
/* Determine the current youngest revision of the filesystem. */
SVN_ERR(svn_fs_youngest_rev(&youngest, fs, pool));
Modified: subversion/branches/move-tracking-2/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_repos/fs-wrap.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_repos/fs-wrap.c Mon Oct 12 10:22:26 2015
@@ -378,7 +378,8 @@ svn_repos_fs_change_rev_prop4(svn_repos_
* to the hooks to be accurate. */
svn_string_t *old_value2;
- SVN_ERR(svn_fs_revision_prop(&old_value2, repos->fs, rev, name, pool));
+ SVN_ERR(svn_fs_revision_prop2(&old_value2, repos->fs, rev, name,
+ TRUE, pool, pool));
old_value = old_value2;
}
@@ -448,12 +449,13 @@ svn_repos_fs_revision_prop(svn_string_t
*value_p = NULL;
else
- SVN_ERR(svn_fs_revision_prop(value_p, repos->fs,
- rev, propname, pool));
+ SVN_ERR(svn_fs_revision_prop2(value_p, repos->fs,
+ rev, propname, TRUE, pool, pool));
}
else /* wholly readable revision */
{
- SVN_ERR(svn_fs_revision_prop(value_p, repos->fs, rev, propname, pool));
+ SVN_ERR(svn_fs_revision_prop2(value_p, repos->fs, rev, propname, TRUE,
+ pool, pool));
}
return SVN_NO_ERROR;
@@ -486,7 +488,8 @@ svn_repos_fs_revision_proplist(apr_hash_
svn_string_t *value;
/* Produce two property hashtables, both in POOL. */
- SVN_ERR(svn_fs_revision_proplist(&tmphash, repos->fs, rev, pool));
+ SVN_ERR(svn_fs_revision_proplist2(&tmphash, repos->fs, rev, TRUE,
+ pool, pool));
*table_p = apr_hash_make(pool);
/* If they exist, we only copy svn:author and svn:date into the
@@ -501,7 +504,8 @@ svn_repos_fs_revision_proplist(apr_hash_
}
else /* wholly readable revision */
{
- SVN_ERR(svn_fs_revision_proplist(table_p, repos->fs, rev, pool));
+ SVN_ERR(svn_fs_revision_proplist2(table_p, repos->fs, rev, TRUE,
+ pool, pool));
}
return SVN_NO_ERROR;
Modified: subversion/branches/move-tracking-2/subversion/libsvn_repos/load-fs-vtable.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_repos/load-fs-vtable.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_repos/load-fs-vtable.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_repos/load-fs-vtable.c Mon Oct 12 10:22:26 2015
@@ -1014,7 +1014,8 @@ close_revision(void *baton)
apr_array_header_t *diff;
int i;
- SVN_ERR(svn_fs_revision_proplist(&orig_props, pb->fs, 0, rb->pool));
+ SVN_ERR(svn_fs_revision_proplist2(&orig_props, pb->fs, 0, TRUE,
+ rb->pool, rb->pool));
new_props = svn_prop_array_to_hash(rb->revprops, rb->pool);
SVN_ERR(svn_prop_diffs(&diff, new_props, orig_props, rb->pool));
@@ -1334,7 +1335,8 @@ revprops_close_revision(void *baton)
prop->value = NULL;
}
- SVN_ERR(svn_fs_revision_proplist(&orig_props, pb->fs, rb->rev, rb->pool));
+ SVN_ERR(svn_fs_revision_proplist2(&orig_props, pb->fs, rb->rev, TRUE,
+ rb->pool, rb->pool));
new_props = svn_prop_array_to_hash(rb->revprops, rb->pool);
SVN_ERR(svn_prop_diffs(&diff, new_props, orig_props, rb->pool));
Modified: subversion/branches/move-tracking-2/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_repos/log.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_repos/log.c Mon Oct 12 10:22:26 2015
@@ -1122,7 +1122,8 @@ fill_log_entry(svn_log_entry_t *log_entr
if (get_revprops && want_revprops)
{
/* User is allowed to see at least some revprops. */
- SVN_ERR(svn_fs_revision_proplist(&r_props, fs, rev, pool));
+ SVN_ERR(svn_fs_revision_proplist2(&r_props, fs, rev, FALSE, pool,
+ pool));
if (revprops == NULL)
{
/* Requested all revprops... */
@@ -2340,6 +2341,10 @@ svn_repos_get_logs4(svn_repos_t *repos,
revprops = new_revprops;
}
+ /* Make sure we catch up on the latest revprop changes. This is the only
+ * time we will refresh the revprop data in this query. */
+ SVN_ERR(svn_fs_refresh_revision_props(fs, pool));
+
/* Setup log range. */
SVN_ERR(svn_fs_youngest_rev(&head, fs, pool));
Modified: subversion/branches/move-tracking-2/subversion/libsvn_repos/reporter.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_repos/reporter.c?rev=1708080&r1=1708079&r2=1708080&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_repos/reporter.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_repos/reporter.c Mon Oct 12 10:22:26 2015
@@ -481,10 +481,12 @@ get_revision_info(report_baton_t *b,
{
/* Info is not available, yet.
Get all revprops. */
- SVN_ERR(svn_fs_revision_proplist(&r_props,
- b->repos->fs,
- rev,
- scratch_pool));
+ SVN_ERR(svn_fs_revision_proplist2(&r_props,
+ b->repos->fs,
+ rev,
+ FALSE,
+ scratch_pool,
+ scratch_pool));
/* Extract the committed-date. */
cdate = svn_hash_gets(r_props, SVN_PROP_REVISION_DATE);
@@ -1548,6 +1550,7 @@ svn_repos_finish_report(void *baton, apr
{
report_baton_t *b = baton;
+ SVN_ERR(svn_fs_refresh_revision_props(svn_repos_fs(b->repos), pool));
return svn_error_trace(finish_report(b, pool));
}