You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by as...@apache.org on 2012/04/14 14:37:28 UTC
svn commit: r1326097 [1/3] - in /subversion/branches/compressed-pristines:
./ contrib/client-side/vim/ subversion/include/ subversion/include/private/
subversion/libsvn_client/ subversion/libsvn_delta/ subversion/libsvn_fs_fs/
subversion/libsvn_ra_neon...
Author: ashod
Date: Sat Apr 14 12:37:25 2012
New Revision: 1326097
URL: http://svn.apache.org/viewvc?rev=1326097&view=rev
Log:
Catching up with trunk.
Removed:
subversion/branches/compressed-pristines/contrib/client-side/vim/svn.vim
Modified:
subversion/branches/compressed-pristines/ (props changed)
subversion/branches/compressed-pristines/CHANGES
subversion/branches/compressed-pristines/subversion/include/private/svn_client_private.h
subversion/branches/compressed-pristines/subversion/include/private/svn_string_private.h
subversion/branches/compressed-pristines/subversion/include/private/svn_temp_serializer.h
subversion/branches/compressed-pristines/subversion/include/svn_config.h
subversion/branches/compressed-pristines/subversion/include/svn_delta.h
subversion/branches/compressed-pristines/subversion/include/svn_editor.h
subversion/branches/compressed-pristines/subversion/include/svn_pools.h
subversion/branches/compressed-pristines/subversion/libsvn_client/copy.c
subversion/branches/compressed-pristines/subversion/libsvn_client/diff.c
subversion/branches/compressed-pristines/subversion/libsvn_client/export.c
subversion/branches/compressed-pristines/subversion/libsvn_client/merge.c
subversion/branches/compressed-pristines/subversion/libsvn_client/mergeinfo.c
subversion/branches/compressed-pristines/subversion/libsvn_client/prop_commands.c
subversion/branches/compressed-pristines/subversion/libsvn_client/repos_diff.c
subversion/branches/compressed-pristines/subversion/libsvn_client/util.c
subversion/branches/compressed-pristines/subversion/libsvn_delta/compat.c
subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/caching.c
subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/dag.c
subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs.h
subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs_fs.c
subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/id.c
subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/temp_serializer.c
subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/temp_serializer.h
subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/tree.c
subversion/branches/compressed-pristines/subversion/libsvn_ra_neon/commit.c
subversion/branches/compressed-pristines/subversion/libsvn_ra_neon/fetch.c
subversion/branches/compressed-pristines/subversion/libsvn_ra_serf/commit.c
subversion/branches/compressed-pristines/subversion/libsvn_ra_serf/ra_serf.h
subversion/branches/compressed-pristines/subversion/libsvn_ra_serf/serf.c
subversion/branches/compressed-pristines/subversion/libsvn_ra_svn/editorp.c
subversion/branches/compressed-pristines/subversion/libsvn_ra_svn/marshal.c
subversion/branches/compressed-pristines/subversion/libsvn_ra_svn/ra_svn.h
subversion/branches/compressed-pristines/subversion/libsvn_repos/commit.c
subversion/branches/compressed-pristines/subversion/libsvn_repos/dump.c
subversion/branches/compressed-pristines/subversion/libsvn_subr/cache-membuffer.c
subversion/branches/compressed-pristines/subversion/libsvn_subr/config.c
subversion/branches/compressed-pristines/subversion/libsvn_subr/config_file.c
subversion/branches/compressed-pristines/subversion/libsvn_subr/crypto.c
subversion/branches/compressed-pristines/subversion/libsvn_subr/crypto.h
subversion/branches/compressed-pristines/subversion/libsvn_subr/gpg_agent.c
subversion/branches/compressed-pristines/subversion/libsvn_subr/mergeinfo.c
subversion/branches/compressed-pristines/subversion/libsvn_subr/pool.c
subversion/branches/compressed-pristines/subversion/libsvn_subr/skel.c
subversion/branches/compressed-pristines/subversion/libsvn_subr/stream.c
subversion/branches/compressed-pristines/subversion/libsvn_subr/svn_string.c
subversion/branches/compressed-pristines/subversion/libsvn_subr/svn_temp_serializer.c
subversion/branches/compressed-pristines/subversion/libsvn_wc/adm_crawler.c
subversion/branches/compressed-pristines/subversion/libsvn_wc/ambient_depth_filter_editor.c
subversion/branches/compressed-pristines/subversion/libsvn_wc/diff_editor.c
subversion/branches/compressed-pristines/subversion/libsvn_wc/entries.c
subversion/branches/compressed-pristines/subversion/libsvn_wc/node.c
subversion/branches/compressed-pristines/subversion/libsvn_wc/status.c
subversion/branches/compressed-pristines/subversion/libsvn_wc/update_editor.c
subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db.c
subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db.h
subversion/branches/compressed-pristines/subversion/svn/diff-cmd.c
subversion/branches/compressed-pristines/subversion/svn/main.c
subversion/branches/compressed-pristines/subversion/svnadmin/main.c
subversion/branches/compressed-pristines/subversion/svndumpfilter/main.c
subversion/branches/compressed-pristines/subversion/svnlook/main.c
subversion/branches/compressed-pristines/subversion/svnrdump/dump_editor.c
subversion/branches/compressed-pristines/subversion/svnrdump/svnrdump.c
subversion/branches/compressed-pristines/subversion/svnserve/main.c
subversion/branches/compressed-pristines/subversion/svnsync/main.c
subversion/branches/compressed-pristines/subversion/svnversion/main.c
subversion/branches/compressed-pristines/subversion/tests/cmdline/diff_tests.py
subversion/branches/compressed-pristines/subversion/tests/cmdline/stat_tests.py
subversion/branches/compressed-pristines/subversion/tests/cmdline/svnadmin_tests.py
subversion/branches/compressed-pristines/subversion/tests/cmdline/svnlook_tests.py
subversion/branches/compressed-pristines/subversion/tests/cmdline/trans_tests.py
subversion/branches/compressed-pristines/subversion/tests/cmdline/update_tests.py
subversion/branches/compressed-pristines/subversion/tests/cmdline/upgrade_tests.py
subversion/branches/compressed-pristines/subversion/tests/libsvn_fs/fs-test.c
subversion/branches/compressed-pristines/subversion/tests/libsvn_subr/crypto-test.c
subversion/branches/compressed-pristines/subversion/tests/libsvn_subr/string-test.c
subversion/branches/compressed-pristines/subversion/tests/libsvn_wc/op-depth-test.c
subversion/branches/compressed-pristines/subversion/tests/svn_test_main.c
subversion/branches/compressed-pristines/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd
subversion/branches/compressed-pristines/tools/client-side/svnmucc/svnmucc.c
subversion/branches/compressed-pristines/tools/dev/merge-graph.py
subversion/branches/compressed-pristines/tools/dev/mergegraph/mergegraph.py
subversion/branches/compressed-pristines/tools/dev/svnraisetreeconflict/main.c
subversion/branches/compressed-pristines/tools/server-side/svn-rep-sharing-stats.c
Propchange: subversion/branches/compressed-pristines/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1310974-1326089
Modified: subversion/branches/compressed-pristines/CHANGES
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/CHANGES?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/CHANGES (original)
+++ subversion/branches/compressed-pristines/CHANGES Sat Apr 14 12:37:25 2012
@@ -21,6 +21,7 @@ http://svn.apache.org/repos/asf/subversi
* new --ignore-properties option for 'svn diff' (r1239553. -617)
* new --patch-compatible option for 'svn diff' (r1239561)
* new SvnPubSub distributed commit hooks (tools/server-side/svnpubsub)
+ * 'svn diff' can compare arbitrary files and directories (r1310291, et al)
- Client-side bugfixes:
*
@@ -42,6 +43,27 @@ http://svn.apache.org/repos/asf/subversi
*
+Version 1.7.5
+(26 Apr 2012, from /branches/1.7.x)
+http://svn.apache.org/repos/asf/subversion/tags/1.7.5
+
+ User-visible changes:
+ * avoid potential segfault when canonicalizing properties (r1296369)
+ * fix non-fatal FSFS corruption bug with concurrent commits (issue #4129)
+ * improve memory and file-handle management with externals (issue #4130)
+ * ra_serf: convert assertions to errors: MERGE fails (r1302417)
+ * mod_dav_svn: error on MERGE of non-existent resource (r1298343)
+ * fix undefined behaviour during multi-segment reverse merges (issue #4144)
+ * fix potential pool lifetime problem in the diff code (r1311935)
+ * libsvn_wc: reduce resources use while looking for the wc root (r1306334)
+ * cmdline: fix segfault during 'svn diff' argument processing (r1311702)
+ * fix regression with deep commit followed by depthy update (issue #4136)
+
+ Developer-visible changes:
+ * swig-py tests: avoid FAILs on APR hash order (r1296137, r1292248)
+ * swig-rb tests: avoid FAILs on APR hash order (r1310535, r1310594)
+
+
Version 1.7.4
(08 Mar 2012, from /branches/1.7.x)
http://svn.apache.org/repos/asf/subversion/tags/1.7.4
Modified: subversion/branches/compressed-pristines/subversion/include/private/svn_client_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/include/private/svn_client_private.h?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/include/private/svn_client_private.h (original)
+++ subversion/branches/compressed-pristines/subversion/include/private/svn_client_private.h Sat Apr 14 12:37:25 2012
@@ -146,10 +146,7 @@ svn_client__youngest_common_ancestor(con
/* Set *ORIGIN_P to the origin of the WC node at WC_ABSPATH. If the node
* is a local copy, give the copy-from location. If the node is locally
- * added or deleted, set the REV and URL fields to SVN_INVALID_REVNUM and
- * NULL respectively, but still give the correct repository root URL and
- * UUID.
- */
+ * added or deleted, set *ORIGIN_P to NULL. */
svn_error_t *
svn_client__wc_node_get_origin(svn_client__pathrev_t **origin_p,
const char *wc_abspath,
Modified: subversion/branches/compressed-pristines/subversion/include/private/svn_string_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/include/private/svn_string_private.h?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/include/private/svn_string_private.h (original)
+++ subversion/branches/compressed-pristines/subversion/include/private/svn_string_private.h Sat Apr 14 12:37:25 2012
@@ -58,6 +58,26 @@ svn_stringbuf__morph_into_string(svn_str
* with APR 0.9 */
apr_status_t
svn__strtoff(apr_off_t *offset, const char *buf, char **end, int base);
+
+/** Number of chars needed to represent signed (19 places + sign + NUL) or
+ * unsigned (20 places + NUL) integers as strings.
+ */
+#define SVN_INT64_BUFFER_SIZE 21
+
+/** Writes the @a number as string into @a dest. The latter must provide
+ * space for at least #SVN_INT64_BUFFER_SIZE characters. Returns the number
+ * chars written excluding the terminating NUL.
+ */
+apr_size_t
+svn__ui64toa(char * dest, apr_uint64_t number);
+
+/** Writes the @a number as string into @a dest. The latter must provide
+ * space for at least #SVN_INT64_BUFFER_SIZE characters. Returns the number
+ * chars written excluding the terminating NUL.
+ */
+apr_size_t
+svn__i64toa(char * dest, apr_int64_t number);
+
/** @} */
/** @} */
Modified: subversion/branches/compressed-pristines/subversion/include/private/svn_temp_serializer.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/include/private/svn_temp_serializer.h?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/include/private/svn_temp_serializer.h (original)
+++ subversion/branches/compressed-pristines/subversion/include/private/svn_temp_serializer.h Sat Apr 14 12:37:25 2012
@@ -188,10 +188,10 @@ svn_temp_deserializer__resolve(void *buf
/**
* Similar to svn_temp_deserializer__resolve() but instead of modifying
* the buffer content, the resulting pointer is passed back to the caller
- * a the return value.
+ * as the return value.
*/
const void *
-svn_temp_deserializer__ptr(const void *buffer, const void **ptr);
+svn_temp_deserializer__ptr(const void *buffer, const void *const *ptr);
#ifdef __cplusplus
}
Modified: subversion/branches/compressed-pristines/subversion/include/svn_config.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/include/svn_config.h?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/include/svn_config.h (original)
+++ subversion/branches/compressed-pristines/subversion/include/svn_config.h Sat Apr 14 12:37:25 2012
@@ -303,6 +303,32 @@ svn_config_set_bool(svn_config_t *cfg,
const char *option,
svn_boolean_t value);
+/** Like svn_config_get(), but for 64 bit signed integers.
+ *
+ * Parses the option as an integer value. Returns an error if the option
+ * could not be converted to an integer.
+ *
+ * @since New in 1.8
+ */
+svn_error_t *
+svn_config_get_int64(svn_config_t *cfg,
+ apr_int64_t *valuep,
+ const char *section,
+ const char *option,
+ apr_int64_t default_value);
+
+/** Like svn_config_set(), but for 64 bit signed integers.
+ *
+ * Sets the option to the signed decimal @a value.
+ *
+ * @since New in 1.8
+ */
+void
+svn_config_set_int64(svn_config_t *cfg,
+ const char *section,
+ const char *option,
+ apr_int64_t value);
+
/** Like svn_config_get(), but only for yes/no/ask values.
*
* Parse @a option in @a section and set @a *valuep to one of
Modified: subversion/branches/compressed-pristines/subversion/include/svn_delta.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/include/svn_delta.h?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/include/svn_delta.h (original)
+++ subversion/branches/compressed-pristines/subversion/include/svn_delta.h Sat Apr 14 12:37:25 2012
@@ -1170,6 +1170,8 @@ svn_editor__insert_shims(const svn_delta
void **dedit_baton_out,
const svn_delta_editor_t *deditor_in,
void *dedit_baton_in,
+ const char *repos_root,
+ const char *base_dir,
svn_delta_shim_callbacks_t *shim_callbacks,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
Modified: subversion/branches/compressed-pristines/subversion/include/svn_editor.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/include/svn_editor.h?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/include/svn_editor.h (original)
+++ subversion/branches/compressed-pristines/subversion/include/svn_editor.h Sat Apr 14 12:37:25 2012
@@ -866,9 +866,10 @@ svn_editor_add_absent(svn_editor_t *edit
/** Drive @a editor's #svn_editor_cb_alter_directory_t callback.
*
- * Alter the properties of the directory at @a relpath. @a revision
- * specifies the expected revision of the directory. This is used to
- * catched attempts at altering out-of-date directories. If the
+ * Alter the properties of the directory at @a relpath.
+ *
+ * @a revision specifies the expected revision of the directory and is
+ * used to catch attempts at altering out-of-date directories. If the
* directory does not have a corresponding revision in the repository
* (e.g. it has not yet been committed), then @a revision should be
* #SVN_INVALID_REVNUM.
Modified: subversion/branches/compressed-pristines/subversion/include/svn_pools.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/include/svn_pools.h?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/include/svn_pools.h (original)
+++ subversion/branches/compressed-pristines/subversion/include/svn_pools.h Sat Apr 14 12:37:25 2012
@@ -30,7 +30,7 @@
#ifndef SVN_POOLS_H
#define SVN_POOLS_H
-#include <apr_pools.h>
+#include "svn_types.h"
#ifdef __cplusplus
extern "C" {
@@ -86,6 +86,23 @@ svn_pool_create_ex_debug(pool, allocator
*/
#define svn_pool_destroy apr_pool_destroy
+/** Return a new allocator. This function limits the unused memory in the
+ * new allocator to @ref SVN_ALLOCATOR_RECOMMENDED_MAX_FREE and ensures
+ * proper synchronization if the allocator is used by multiple threads.
+ *
+ * If your application uses multiple threads, creating a separate allocator
+ * for each of these threads may not be feasible. Set the @a thread_safe
+ * parameter to @c TRUE in that case. Pools will still not thread-safe, i.e.
+ * access to them may require explicit serialization. Set the parameter to
+ * @c FALSE, otherwise, to maximize performance.
+ *
+ * To access the owner pool, which can also serve as the root pool for your
+ * sub-pools, call @c apr_allocator_get_owner().
+ *
+ * @since: New in 1.8
+ */
+apr_allocator_t *
+svn_pool_create_allocator(svn_boolean_t thread_safe);
#ifdef __cplusplus
}
Modified: subversion/branches/compressed-pristines/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_client/copy.c?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_client/copy.c Sat Apr 14 12:37:25 2012
@@ -70,56 +70,6 @@
/*** Code. ***/
-/* Obtain the implied mergeinfo and the existing mergeinfo of the
- source path, combine them and return the result in
- *TARGET_MERGEINFO. One of LOCAL_ABSPATH and SRC_URL must be valid,
- the other must be NULL. */
-static svn_error_t *
-calculate_target_mergeinfo(svn_ra_session_t *ra_session,
- apr_hash_t **target_mergeinfo,
- const char *local_abspath,
- const char *src_url,
- svn_revnum_t src_revnum,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool)
-{
- svn_boolean_t locally_added = FALSE;
- apr_hash_t *src_mergeinfo = NULL;
-
- SVN_ERR_ASSERT((local_abspath && !src_url) || (!local_abspath && src_url));
-
- /* If we have a schedule-add WC path (which was not copied from
- elsewhere), it doesn't have any repository mergeinfo, so don't
- bother checking. */
- if (local_abspath)
- {
- svn_client__pathrev_t *origin;
-
- SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-
- SVN_ERR(svn_client__wc_node_get_origin(&origin,
- local_abspath, ctx,
- pool, pool));
- src_revnum = origin->rev;
- src_url = origin->url;
-
- if (! src_url)
- locally_added = TRUE;
- }
-
- if (! locally_added)
- {
- /* Fetch any existing (explicit) mergeinfo. */
- SVN_ERR(svn_client__get_repos_mergeinfo(&src_mergeinfo, ra_session,
- src_url, src_revnum,
- svn_mergeinfo_inherited,
- TRUE, pool));
- }
-
- *target_mergeinfo = src_mergeinfo;
- return SVN_NO_ERROR;
-}
-
/* Extend the mergeinfo for the single WC path TARGET_WCPATH, adding
MERGEINFO to any mergeinfo pre-existing in the WC. */
static svn_error_t *
@@ -747,7 +697,6 @@ repos_to_repos_copy(const apr_array_head
apr_array_header_t *path_infos;
const char *top_url, *top_url_all, *top_url_dst;
const char *message, *repos_root;
- svn_revnum_t youngest = SVN_INVALID_REVNUM;
svn_ra_session_t *ra_session = NULL;
const svn_delta_editor_t *editor;
void *edit_baton;
@@ -803,9 +752,10 @@ repos_to_repos_copy(const apr_array_head
/* Go ahead and grab mergeinfo from the source, too. */
SVN_ERR(svn_ra_reparent(ra_session, pair->src_abspath_or_url, pool));
- SVN_ERR(calculate_target_mergeinfo(ra_session, &mergeinfo, NULL,
- pair->src_abspath_or_url,
- pair->src_revnum, ctx, pool));
+ SVN_ERR(svn_client__get_repos_mergeinfo(
+ &mergeinfo, ra_session,
+ pair->src_abspath_or_url, pair->src_revnum,
+ svn_mergeinfo_inherited, TRUE /*squelch_incapable*/, pool));
if (mergeinfo)
SVN_ERR(svn_mergeinfo_to_string(&info->mergeinfo, mergeinfo, pool));
@@ -1000,7 +950,7 @@ repos_to_repos_copy(const apr_array_head
/* Figure out the basename that will result from this operation,
and ensure that we aren't trying to overwrite existing paths. */
dst_rel = svn_uri_skip_ancestor(top_url, pair->dst_abspath_or_url, pool);
- SVN_ERR(svn_ra_check_path(ra_session, dst_rel, youngest,
+ SVN_ERR(svn_ra_check_path(ra_session, dst_rel, SVN_INVALID_REVNUM,
&dst_kind, pool));
if (dst_kind != svn_node_none)
return svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL,
@@ -1116,7 +1066,7 @@ repos_to_repos_copy(const apr_array_head
cb_baton.is_move = is_move;
/* Call the path-based editor driver. */
- err = svn_delta_path_driver(editor, edit_baton, youngest, paths,
+ err = svn_delta_path_driver(editor, edit_baton, SVN_INVALID_REVNUM, paths,
path_driver_cb_func, &cb_baton, pool);
if (err)
{
@@ -1165,7 +1115,8 @@ check_url_kind(void *baton,
/* ### Copy ...
* COMMIT_INFO_P is ...
- * COPY_PAIRS is ...
+ * COPY_PAIRS is ... such that each 'src_abspath_or_url' is a local abspath
+ * and each 'dst_abspath_or_url' is a URL.
* MAKE_PARENTS is ...
* REVPROP_TABLE is ...
* CTX is ... */
@@ -1205,7 +1156,9 @@ wc_to_repos_copy(const apr_array_header_
/* Verify that all the source paths exist, are versioned, etc.
We'll do so by querying the base revisions of those things (which
- we'll need to know later anyway). */
+ we'll need to know later anyway).
+ ### Should we use the 'origin' revision instead of 'base'?
+ */
for (i = 0; i < copy_pairs->nelts; i++)
{
svn_client__copy_pair_t *pair = APR_ARRAY_IDX(copy_pairs, i,
@@ -1366,17 +1319,26 @@ wc_to_repos_copy(const apr_array_header_
svn_client__copy_pair_t *);
svn_client_commit_item3_t *item =
APR_ARRAY_IDX(commit_items, i, svn_client_commit_item3_t *);
+ svn_client__pathrev_t *src_origin;
svn_pool_clear(iterpool);
+ SVN_ERR(svn_client__wc_node_get_origin(&src_origin,
+ pair->src_abspath_or_url,
+ ctx, iterpool, iterpool));
+
/* Set the mergeinfo for the destination to the combined merge
info known to the WC and the repository. */
item->outgoing_prop_changes = apr_array_make(pool, 1,
sizeof(svn_prop_t *));
- SVN_ERR(calculate_target_mergeinfo(ra_session, &mergeinfo,
- pair->src_abspath_or_url,
- NULL, SVN_INVALID_REVNUM,
- ctx, iterpool));
+ /* Repository mergeinfo (or NULL if it's locally added)... */
+ if (src_origin)
+ SVN_ERR(svn_client__get_repos_mergeinfo(
+ &mergeinfo, ra_session, src_origin->url, src_origin->rev,
+ svn_mergeinfo_inherited, TRUE /*sqelch_inc.*/, iterpool));
+ else
+ mergeinfo = NULL;
+ /* ... and WC mergeinfo. */
SVN_ERR(svn_client__parse_mergeinfo(&wc_mergeinfo, ctx->wc_ctx,
pair->src_abspath_or_url,
iterpool, iterpool));
@@ -1409,7 +1371,7 @@ wc_to_repos_copy(const apr_array_header_
SVN_ERR(svn_client__condense_commit_items(&top_dst_url,
commit_items, pool));
-#if ENABLE_EV2_SHIMS
+#ifdef ENABLE_EV2_SHIMS
for (i = 0; !common_wc_abspath && i < commit_items->nelts; i++)
{
common_wc_abspath = APR_ARRAY_IDX(commit_items, i,
@@ -1619,9 +1581,10 @@ repos_to_wc_copy_single(svn_client__copy
/* Record the implied mergeinfo (before the notification callback
is invoked for the root node). */
- SVN_ERR(calculate_target_mergeinfo(ra_session, &src_mergeinfo, NULL,
- pair->src_abspath_or_url,
- pair->src_revnum, ctx, pool));
+ SVN_ERR(svn_client__get_repos_mergeinfo(
+ &src_mergeinfo, ra_session,
+ pair->src_abspath_or_url, pair->src_revnum,
+ svn_mergeinfo_inherited, TRUE /*squelch_incapable*/, pool));
SVN_ERR(extend_wc_mergeinfo(dst_abspath, src_mergeinfo, ctx, pool));
/* Do our own notification for the root node, even if we could possibly
Modified: subversion/branches/compressed-pristines/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_client/diff.c?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_client/diff.c Sat Apr 14 12:37:25 2012
@@ -805,6 +805,17 @@ struct diff_cmd_baton {
};
+/* A helper function that marks a path as visited. It copies PATH
+ * into the correct pool before referencing it from the hash table. */
+static void
+mark_path_as_visited(struct diff_cmd_baton *diff_cmd_baton, const char *path)
+{
+ const char *p;
+
+ p = apr_pstrdup(apr_hash_pool_get(diff_cmd_baton->visited_paths), path);
+ apr_hash_set(diff_cmd_baton->visited_paths, p, APR_HASH_KEY_STRING, p);
+}
+
/* An helper for diff_dir_props_changed, diff_file_changed and diff_file_added
*/
static svn_error_t *
@@ -855,8 +866,7 @@ diff_props_changed(svn_wc_notify_state_t
/* We've printed the diff header so now we can mark the path as
* visited. */
if (show_diff_header)
- apr_hash_set(diff_cmd_baton->visited_paths, path,
- APR_HASH_KEY_STRING, path);
+ mark_path_as_visited(diff_cmd_baton, path);
}
if (state)
@@ -1072,9 +1082,7 @@ diff_content_changed(const char *path,
subpool));
/* We have a printed a diff for this path, mark it as visited. */
- apr_hash_set(diff_cmd_baton->visited_paths, path,
- APR_HASH_KEY_STRING, path);
-
+ mark_path_as_visited(diff_cmd_baton, path);
}
}
@@ -1773,17 +1781,54 @@ unsupported_diff_error(svn_error_t *chil
"that is not yet supported"));
}
+/* Try to get properties for LOCAL_ABSPATH and return them in the property
+ * hash *PROPS. If there are no properties because LOCAL_ABSPATH is not
+ * versioned, return an empty property hash. */
+static svn_error_t *
+get_props(apr_hash_t **props,
+ const char *local_abspath,
+ svn_wc_context_t *wc_ctx,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_error_t *err;
+
+ err = svn_wc_prop_list2(props, wc_ctx, local_abspath, result_pool,
+ scratch_pool);
+ if (err)
+ {
+ if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND ||
+ err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY ||
+ err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED)
+ {
+ svn_error_clear(err);
+ *props = apr_hash_make(result_pool);
+ }
+ else
+ return svn_error_trace(err);
+ }
+
+ return SVN_NO_ERROR;
+}
+
/* Produce a diff between two arbitrary files at LOCAL_ABSPATH1 and
* LOCAL_ABSPATH2, using the diff callbacks from CALLBACKS.
* Use PATH as the name passed to diff callbacks.
* FILE1_IS_EMPTY and FILE2_IS_EMPTY are used as hints which diff callback
- * function to use to compare the files (added/deleted/changed). */
+ * function to use to compare the files (added/deleted/changed).
+ *
+ * If ORIGINAL_PROPS_OVERRIDE is not NULL, use it as original properties
+ * instead of reading properties from LOCAL_ABSPATH1. This is required when
+ * a file replaces a directory, where LOCAL_ABSPATH1 is an empty file that
+ * file content must be diffed against, but properties to diff against come
+ * from the replaced directory. */
static svn_error_t *
do_arbitrary_files_diff(const char *local_abspath1,
const char *local_abspath2,
const char *path,
svn_boolean_t file1_is_empty,
svn_boolean_t file2_is_empty,
+ apr_hash_t *original_props_override,
const svn_wc_diff_callbacks4_t *callbacks,
struct diff_cmd_baton *diff_cmd_baton,
svn_client_ctx_t *ctx,
@@ -1794,7 +1839,9 @@ do_arbitrary_files_diff(const char *loca
apr_array_header_t *prop_changes;
svn_string_t *original_mime_type = NULL;
svn_string_t *modified_mime_type = NULL;
- svn_error_t *err;
+
+ if (ctx->cancel_func)
+ SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
if (diff_cmd_baton->ignore_prop_diff)
{
@@ -1805,28 +1852,13 @@ do_arbitrary_files_diff(const char *loca
{
/* Try to get properties from either file. It's OK if the files do not
* have properties, or if they are unversioned. */
- err = svn_wc_prop_list2(&original_props, ctx->wc_ctx, local_abspath1,
- scratch_pool, scratch_pool);
- if (err && (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND ||
- err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY ||
- err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED))
- {
- svn_error_clear(err);
- original_props = apr_hash_make(scratch_pool);
- }
- else
- SVN_ERR(err);
- err = svn_wc_prop_list2(&modified_props, ctx->wc_ctx, local_abspath2,
- scratch_pool, scratch_pool);
- if (err && (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND ||
- err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY ||
- err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED))
- {
- svn_error_clear(err);
- modified_props = apr_hash_make(scratch_pool);
- }
+ if (original_props_override)
+ original_props = original_props_override;
else
- SVN_ERR(err);
+ SVN_ERR(get_props(&original_props, local_abspath1, ctx->wc_ctx,
+ scratch_pool, scratch_pool));
+ SVN_ERR(get_props(&modified_props, local_abspath2, ctx->wc_ctx,
+ scratch_pool, scratch_pool));
}
SVN_ERR(svn_prop_diffs(&prop_changes, modified_props, original_props,
@@ -1905,22 +1937,30 @@ struct arbitrary_diff_walker_baton {
const char *root1_abspath;
const char *root2_abspath;
- /* TRUE if recursing withing an added subtree of root2_abspath that
+ /* TRUE if recursing within an added subtree of root2_abspath that
* does not exist in root1_abspath. */
svn_boolean_t recursing_within_added_subtree;
+ /* TRUE if recursing within an administrative (.i.e. .svn) directory. */
+ svn_boolean_t recursing_within_adm_dir;
+
+ /* The absolute path of the adm dir if RECURSING_WITHIN_ADM_DIR is TRUE.
+ * Else this is NULL.*/
+ const char *adm_dir_abspath;
+
/* A path to an empty file used for diffs that add/delete files. */
const char *empty_file_abspath;
const svn_wc_diff_callbacks4_t *callbacks;
struct diff_cmd_baton *callback_baton;
svn_client_ctx_t *ctx;
+ apr_pool_t *pool;
} arbitrary_diff_walker_baton;
/* Forward declaration needed because this function has a cyclic
* dependency with do_arbitrary_dirs_diff(). */
static svn_error_t *
-arbitrary_diff_walker(void *baton, const char *local_abspath1,
+arbitrary_diff_walker(void *baton, const char *local_abspath,
const apr_finfo_t *finfo,
apr_pool_t *scratch_pool);
@@ -1957,9 +1997,12 @@ do_arbitrary_dirs_diff(const char *local
b.root1_abspath = root_abspath1 ? root_abspath1 : local_abspath1;
b.root2_abspath = root_abspath2 ? root_abspath2 : local_abspath2;
+ b.recursing_within_adm_dir = FALSE;
+ b.adm_dir_abspath = NULL;
b.callbacks = callbacks;
b.callback_baton = callback_baton;
b.ctx = ctx;
+ b.pool = scratch_pool;
SVN_ERR(svn_io_open_unique_file3(&empty_file, &b.empty_file_abspath,
NULL, svn_io_file_del_on_pool_cleanup,
@@ -1972,14 +2015,18 @@ do_arbitrary_dirs_diff(const char *local
return SVN_NO_ERROR;
}
-/* An implementation of svn_io_walk_func_t. */
+/* An implementation of svn_io_walk_func_t.
+ * Note: LOCAL_ABSPATH is the path being crawled and can be on either side
+ * of the diff depending on baton->recursing_within_added_subtree. */
static svn_error_t *
-arbitrary_diff_walker(void *baton, const char *local_abspath1,
+arbitrary_diff_walker(void *baton, const char *local_abspath,
const apr_finfo_t *finfo,
apr_pool_t *scratch_pool)
{
struct arbitrary_diff_walker_baton *b = baton;
+ const char *local_abspath1;
const char *local_abspath2;
+ svn_node_kind_t kind1;
svn_node_kind_t kind2;
const char *child_relpath;
apr_hash_t *dirents1;
@@ -1989,46 +2036,78 @@ arbitrary_diff_walker(void *baton, const
int i;
apr_pool_t *iterpool;
+ if (b->ctx->cancel_func)
+ SVN_ERR(b->ctx->cancel_func(b->ctx->cancel_baton));
+
if (finfo->filetype != APR_DIR)
return SVN_NO_ERROR;
- if (b->recursing_within_added_subtree)
- child_relpath = svn_dirent_skip_ancestor(b->root2_abspath, local_abspath1);
- else
- child_relpath = svn_dirent_skip_ancestor(b->root1_abspath, local_abspath1);
- if (!child_relpath)
+ if (b->recursing_within_adm_dir)
+ {
+ if (svn_dirent_skip_ancestor(b->adm_dir_abspath, local_abspath))
+ return SVN_NO_ERROR;
+ else
+ {
+ b->recursing_within_adm_dir = FALSE;
+ b->adm_dir_abspath = NULL;
+ }
+ }
+ else if (strcmp(svn_dirent_basename(local_abspath, scratch_pool),
+ SVN_WC_ADM_DIR_NAME) == 0)
+ {
+ b->recursing_within_adm_dir = TRUE;
+ b->adm_dir_abspath = apr_pstrdup(b->pool, local_abspath);
return SVN_NO_ERROR;
+ }
if (b->recursing_within_added_subtree)
- dirents1 = apr_hash_make(scratch_pool);
+ child_relpath = svn_dirent_skip_ancestor(b->root2_abspath, local_abspath);
else
- SVN_ERR(svn_io_get_dirents3(&dirents1, local_abspath1,
- TRUE, /* only_check_type */
- scratch_pool, scratch_pool));
+ child_relpath = svn_dirent_skip_ancestor(b->root1_abspath, local_abspath);
+ if (!child_relpath)
+ return SVN_NO_ERROR;
+
+ local_abspath1 = svn_dirent_join(b->root1_abspath, child_relpath,
+ scratch_pool);
+ SVN_ERR(svn_io_check_resolved_path(local_abspath1, &kind1, scratch_pool));
local_abspath2 = svn_dirent_join(b->root2_abspath, child_relpath,
scratch_pool);
SVN_ERR(svn_io_check_resolved_path(local_abspath2, &kind2, scratch_pool));
- if (kind2 == svn_node_file)
- {
- /* Show file as deleted (being replaced by a directory). */
- SVN_ERR(do_arbitrary_files_diff(local_abspath2, b->empty_file_abspath,
- svn_dirent_skip_ancestor(
- b->root2_abspath,
- local_abspath2),
- FALSE, TRUE,
- b->callbacks, b->callback_baton,
- b->ctx, scratch_pool));
- dirents2 = apr_hash_make(scratch_pool);
- }
-
- if (kind2 == svn_node_none)
- dirents2 = apr_hash_make(scratch_pool);
- if (kind2 == svn_node_dir)
- SVN_ERR(svn_io_get_dirents3(&dirents2, local_abspath2,
+ if (kind1 == svn_node_dir)
+ SVN_ERR(svn_io_get_dirents3(&dirents1, local_abspath1,
TRUE, /* only_check_type */
scratch_pool, scratch_pool));
+ else
+ dirents1 = apr_hash_make(scratch_pool);
+
+ if (kind2 == svn_node_dir)
+ {
+ apr_hash_t *original_props;
+ apr_hash_t *modified_props;
+ apr_array_header_t *prop_changes;
+
+ /* Show any property changes for this directory. */
+ SVN_ERR(get_props(&original_props, local_abspath1, b->ctx->wc_ctx,
+ scratch_pool, scratch_pool));
+ SVN_ERR(get_props(&modified_props, local_abspath2, b->ctx->wc_ctx,
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_prop_diffs(&prop_changes, modified_props, original_props,
+ scratch_pool));
+ if (prop_changes->nelts > 0)
+ SVN_ERR(diff_props_changed(NULL, NULL, child_relpath,
+ b->recursing_within_added_subtree,
+ prop_changes, original_props,
+ b->callback_baton, scratch_pool));
+
+ /* Read directory entries. */
+ SVN_ERR(svn_io_get_dirents3(&dirents2, local_abspath2,
+ TRUE, /* only_check_type */
+ scratch_pool, scratch_pool));
+ }
+ else
+ dirents2 = apr_hash_make(scratch_pool);
/* Compare dirents1 to dirents2 and show added/deleted/changed files. */
merged_dirents = apr_hash_merge(scratch_pool, dirents1, dirents2,
@@ -2048,6 +2127,12 @@ arbitrary_diff_walker(void *baton, const
svn_pool_clear(iterpool);
+ if (b->ctx->cancel_func)
+ SVN_ERR(b->ctx->cancel_func(b->ctx->cancel_baton));
+
+ if (strcmp(name, SVN_WC_ADM_DIR_NAME) == 0)
+ continue;
+
dirent1 = apr_hash_get(dirents1, name, APR_HASH_KEY_STRING);
if (!dirent1)
{
@@ -2081,26 +2166,32 @@ arbitrary_diff_walker(void *baton, const
SVN_ERR(do_arbitrary_files_diff(child1_abspath, b->empty_file_abspath,
svn_relpath_join(child_relpath, name,
iterpool),
- FALSE, TRUE,
+ FALSE, TRUE, NULL,
b->callbacks, b->callback_baton,
b->ctx, iterpool));
/* Files that exist only in dirents2. */
if (dirent2->kind == svn_node_file &&
(dirent1->kind == svn_node_dir || dirent1->kind == svn_node_none))
- SVN_ERR(do_arbitrary_files_diff(b->empty_file_abspath, child2_abspath,
- svn_relpath_join(child_relpath, name,
- iterpool),
- TRUE, FALSE,
- b->callbacks, b->callback_baton,
- b->ctx, iterpool));
+ {
+ apr_hash_t *original_props;
+
+ SVN_ERR(get_props(&original_props, child1_abspath, b->ctx->wc_ctx,
+ scratch_pool, scratch_pool));
+ SVN_ERR(do_arbitrary_files_diff(b->empty_file_abspath, child2_abspath,
+ svn_relpath_join(child_relpath, name,
+ iterpool),
+ TRUE, FALSE, original_props,
+ b->callbacks, b->callback_baton,
+ b->ctx, iterpool));
+ }
/* Files that exist in dirents1 and dirents2. */
if (dirent1->kind == svn_node_file && dirent2->kind == svn_node_file)
SVN_ERR(do_arbitrary_files_diff(child1_abspath, child2_abspath,
svn_relpath_join(child_relpath, name,
iterpool),
- FALSE, FALSE,
+ FALSE, FALSE, NULL,
b->callbacks, b->callback_baton,
b->ctx, scratch_pool));
@@ -2146,7 +2237,7 @@ do_arbitrary_nodes_diff(const char *loca
SVN_ERR(do_arbitrary_files_diff(local_abspath1, local_abspath2,
svn_dirent_basename(local_abspath2,
scratch_pool),
- FALSE, FALSE,
+ FALSE, FALSE, NULL,
callbacks, callback_baton,
ctx, scratch_pool));
else if (kind1 == svn_node_dir)
Modified: subversion/branches/compressed-pristines/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_client/export.c?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_client/export.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_client/export.c Sat Apr 14 12:37:25 2012
@@ -1236,7 +1236,8 @@ svn_client_export5(svn_revnum_t *result_
SVN_ERR(svn_editor__insert_shims(&export_editor, &edit_baton,
export_editor, edit_baton,
- shim_callbacks, pool, pool));
+ NULL, NULL, shim_callbacks,
+ pool, pool));
/* Manufacture a basic 'report' to the update reporter. */
SVN_ERR(svn_ra_do_update2(ra_session,
Modified: subversion/branches/compressed-pristines/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_client/merge.c?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_client/merge.c Sat Apr 14 12:37:25 2012
@@ -893,8 +893,8 @@ filter_self_referential_mergeinfo(apr_ar
if (is_added)
return SVN_NO_ERROR;
- SVN_ERR(svn_client_url_from_path2(&target_base.url, target_abspath,
- ctx, pool, pool));
+ SVN_ERR(svn_wc__node_get_url(&target_base.url, ctx->wc_ctx, target_abspath,
+ pool, pool));
SVN_ERR(svn_wc__node_get_base_rev(&target_base.rev, ctx->wc_ctx,
target_abspath, pool));
SVN_ERR(svn_wc__node_get_repos_info(&target_base.repos_root_url,
@@ -3529,7 +3529,7 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
SVN_ERR(svn_client__wc_node_get_origin(&target, target_abspath, ctx,
scratch_pool, scratch_pool));
- if (! target->url)
+ if (! target)
{
/* We've been asked to operate on a locally added target, so its
* implicit mergeinfo is empty. */
@@ -6234,7 +6234,7 @@ combine_range_with_segments(apr_array_he
{
svn_location_segment_t *segment =
APR_ARRAY_IDX(segments, i, svn_location_segment_t *);
- svn_client__pathrev_t loc1, loc2;
+ svn_client__pathrev_t *loc1, *loc2;
merge_source_t *merge_source;
const char *path1 = NULL;
svn_revnum_t rev1;
@@ -6282,25 +6282,17 @@ combine_range_with_segments(apr_array_he
continue;
/* Build our merge source structure. */
- loc1.repos_root_url = source_loc->repos_root_url;
- loc1.repos_uuid = source_loc->repos_uuid;
- loc1.rev = rev1;
- loc1.url = svn_path_url_add_component2(source_loc->repos_root_url,
- path1, pool);
- loc2.repos_root_url = source_loc->repos_root_url;
- loc2.repos_uuid = source_loc->repos_uuid;
- loc2.rev = MIN(segment->range_end, maxrev);
- loc2.url = svn_path_url_add_component2(source_loc->repos_root_url,
- segment->path, pool);
- merge_source = merge_source_create(&loc1, &loc2, pool);
-
+ loc1 = svn_client__pathrev_create_with_relpath(
+ source_loc->repos_root_url, source_loc->repos_uuid,
+ rev1, path1, pool);
+ loc2 = svn_client__pathrev_create_with_relpath(
+ source_loc->repos_root_url, source_loc->repos_uuid,
+ MIN(segment->range_end, maxrev), segment->path, pool);
/* If this is subtractive, reverse the whole calculation. */
if (subtractive)
- {
- const svn_client__pathrev_t *tmploc = merge_source->loc1;
- merge_source->loc1 = merge_source->loc2;
- merge_source->loc2 = tmploc;
- }
+ merge_source = merge_source_create(loc2, loc1, pool);
+ else
+ merge_source = merge_source_create(loc1, loc2, pool);
APR_ARRAY_PUSH(merge_source_ts, merge_source_t *) = merge_source;
}
@@ -9300,7 +9292,25 @@ open_target_wc(merge_target_t **target_p
scratch_pool));
SVN_ERR(svn_client__wc_node_get_origin(&origin, wc_abspath, ctx,
result_pool, scratch_pool));
- target->loc = *origin;
+ if (origin)
+ {
+ target->loc = *origin;
+ }
+ else
+ {
+ /* The node has no location in the repository. It's unversioned or
+ * locally added or locally deleted.
+ *
+ * If it's locally added or deleted, find the repository root
+ * URL and UUID anyway, and leave the node URL and revision as NULL
+ * and INVALID. If it's unversioned, this will throw an error. */
+ SVN_ERR(svn_wc__node_get_repos_info(&target->loc.repos_root_url,
+ &target->loc.repos_uuid,
+ ctx->wc_ctx, wc_abspath,
+ result_pool, scratch_pool));
+ target->loc.rev = SVN_INVALID_REVNUM;
+ target->loc.url = NULL;
+ }
SVN_ERR(ensure_wc_is_suitable_merge_target(
wc_abspath, ctx,
@@ -9728,7 +9738,7 @@ log_find_operative_revs(void *baton,
if (!in_catalog)
{
svn_mergeinfo_t unmerged_for_key;
- const char *missing_path;
+ const char *suffix, *missing_path;
/* If there is no mergeinfo on the source tree we'll say
the "subtree" missing this revision is the root of the
@@ -9736,12 +9746,10 @@ log_find_operative_revs(void *baton,
if (!subtree_missing_this_rev)
subtree_missing_this_rev = log_baton->source_repos_rel_path;
- if (subtree_missing_this_rev
- && strcmp(subtree_missing_this_rev, source_rel_path))
+ suffix = svn_relpath_skip_ancestor(subtree_missing_this_rev,
+ source_rel_path);
+ if (suffix)
{
- const char *suffix =
- svn_relpath_skip_ancestor(subtree_missing_this_rev,
- source_rel_path);
missing_path = apr_pstrmemdup(pool, path,
strlen(path) - strlen(suffix) - 1);
}
Modified: subversion/branches/compressed-pristines/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_client/mergeinfo.c?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_client/mergeinfo.c Sat Apr 14 12:37:25 2012
@@ -1070,8 +1070,8 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
SVN_ERR(svn_client__wc_node_get_origin(&origin, local_abspath, ctx,
scratch_pool, scratch_pool));
- rev = origin->rev;
- if (!origin->url
+ rev = origin ? origin->rev : SVN_INVALID_REVNUM;
+ if (!origin
|| strcmp(origin->url, url) != 0
|| peg_rev != rev)
{
Modified: subversion/branches/compressed-pristines/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_client/prop_commands.c?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_client/prop_commands.c Sat Apr 14 12:37:25 2012
@@ -344,7 +344,7 @@ svn_client_propset_local(const char *pro
iterpool);
if ((err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
- || kind == svn_node_unknown || kind == svn_node_none)
+ || (!err && (kind == svn_node_unknown || kind == svn_node_none)))
{
if (ctx->notify_func2)
{
Modified: subversion/branches/compressed-pristines/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_client/repos_diff.c?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_client/repos_diff.c Sat Apr 14 12:37:25 2012
@@ -1464,7 +1464,7 @@ svn_client__get_diff_editor(const svn_de
shim_callbacks->fetch_baton = eb;
SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
- shim_callbacks,
+ NULL, NULL, shim_callbacks,
result_pool, result_pool));
return SVN_NO_ERROR;
Modified: subversion/branches/compressed-pristines/subversion/libsvn_client/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_client/util.c?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_client/util.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_client/util.c Sat Apr 14 12:37:25 2012
@@ -257,22 +257,8 @@ svn_client__wc_node_get_origin(svn_clien
}
else
{
- /* The node has no location in the repository. It's unversioned or
- * locally added or locally deleted.
- *
- * If it's locally added or deleted, find the repository root
- * URL and UUID anyway, and leave the node URL and revision as NULL
- * and INVALID. If it's unversioned, this will throw an error. */
- SVN_ERR(svn_wc__node_get_repos_info(&(*origin_p)->repos_root_url,
- &(*origin_p)->repos_uuid,
- ctx->wc_ctx, wc_abspath,
- result_pool, scratch_pool));
- (*origin_p)->rev = SVN_INVALID_REVNUM;
- (*origin_p)->url = NULL;
+ *origin_p = NULL;
}
-
- SVN_ERR_ASSERT((*origin_p)->repos_root_url);
- SVN_ERR_ASSERT((*origin_p)->repos_uuid);
return SVN_NO_ERROR;
}
Modified: subversion/branches/compressed-pristines/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_delta/compat.c?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_delta/compat.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_delta/compat.c Sat Apr 14 12:37:25 2012
@@ -138,6 +138,10 @@ struct ev2_edit_baton
apr_array_header_t *path_order;
int paths_processed;
+ /* For calculating relpaths from Ev1 copyfrom urls. */
+ const char *repos_root;
+ const char *base_relpath;
+
apr_pool_t *edit_pool;
struct extra_baton *exb;
svn_boolean_t closed;
@@ -161,7 +165,7 @@ struct ev2_dir_baton
const char *path;
svn_revnum_t base_revision;
- const char *copyfrom_path;
+ const char *copyfrom_relpath;
svn_revnum_t copyfrom_rev;
};
@@ -595,38 +599,21 @@ run_ev2_actions(struct ev2_edit_baton *e
static const char *
-map_to_relpath(struct ev2_edit_baton *eb,
- const char *path_or_url,
- apr_pool_t *result_pool)
-{
- if (svn_relpath_is_canonical(path_or_url))
- return apr_pstrdup(result_pool, path_or_url);
-
-#ifdef SVN_DEBUG
- SVN_DBG(("path='%s'\n", path_or_url));
-#endif
-
- /* ### do something here */
-
- return path_or_url;
-}
-
-
-static const char *
map_to_repos_relpath(struct ev2_edit_baton *eb,
const char *path_or_url,
apr_pool_t *result_pool)
{
- if (svn_relpath_is_canonical(path_or_url))
- return apr_pstrdup(result_pool, path_or_url);
-
-#ifdef SVN_DEBUG
- SVN_DBG(("repos_path='%s'\n", path_or_url));
-#endif
-
- /* ### do something here */
-
- return path_or_url;
+ if (svn_path_is_url(path_or_url))
+ {
+ return svn_uri_skip_ancestor(eb->repos_root, path_or_url, result_pool);
+ }
+ else
+ {
+ return svn_relpath_join(eb->base_relpath,
+ path_or_url[0] == '/'
+ ? path_or_url + 1 : path_or_url,
+ result_pool);
+ }
}
@@ -654,7 +641,7 @@ ev2_open_root(void *edit_baton,
struct ev2_edit_baton *eb = edit_baton;
db->eb = eb;
- db->path = "";
+ db->path = apr_pstrdup(eb->edit_pool, eb->base_relpath);
db->base_revision = base_revision;
*root_baton = db;
@@ -673,7 +660,7 @@ ev2_delete_entry(const char *path,
{
struct ev2_dir_baton *pb = parent_baton;
svn_revnum_t *revnum = apr_palloc(pb->eb->edit_pool, sizeof(*revnum));
- const char *relpath = map_to_relpath(pb->eb, path, scratch_pool);
+ const char *relpath = map_to_repos_relpath(pb->eb, path, scratch_pool);
struct change_node *change = locate_change(pb->eb, relpath);
if (SVN_IS_VALID_REVNUM(revision))
@@ -712,7 +699,7 @@ ev2_add_directory(const char *path,
apr_pool_t *scratch_pool = result_pool;
struct ev2_dir_baton *pb = parent_baton;
struct ev2_dir_baton *cb = apr_pcalloc(result_pool, sizeof(*cb));
- const char *relpath = map_to_relpath(pb->eb, path, scratch_pool);
+ const char *relpath = map_to_repos_relpath(pb->eb, path, scratch_pool);
struct change_node *change = locate_change(pb->eb, relpath);
/* ### assert that RESTRUCTURE is NONE or DELETE? */
@@ -731,11 +718,11 @@ ev2_add_directory(const char *path,
*kind = svn_kind_dir;
SVN_ERR(add_action(pb->eb, relpath, ACTION_ADD, kind));
- if (pb->copyfrom_path)
+ if (pb->copyfrom_relpath)
{
const char *name = svn_relpath_basename(relpath, scratch_pool);
- cb->copyfrom_path = apr_pstrcat(result_pool, pb->copyfrom_path,
- "/", name, NULL);
+ cb->copyfrom_relpath = svn_relpath_join(pb->copyfrom_relpath, name,
+ result_pool);
cb->copyfrom_rev = pb->copyfrom_rev;
}
}
@@ -752,7 +739,7 @@ ev2_add_directory(const char *path,
args->copyfrom_rev = change->copyfrom_rev;
SVN_ERR(add_action(pb->eb, relpath, ACTION_COPY, args));
- cb->copyfrom_path = change->copyfrom_path;
+ cb->copyfrom_relpath = change->copyfrom_path;
cb->copyfrom_rev = change->copyfrom_rev;
}
@@ -770,19 +757,19 @@ ev2_open_directory(const char *path,
apr_pool_t *scratch_pool = result_pool;
struct ev2_dir_baton *pb = parent_baton;
struct ev2_dir_baton *db = apr_pcalloc(result_pool, sizeof(*db));
- const char *relpath = map_to_relpath(pb->eb, path, scratch_pool);
+ const char *relpath = map_to_repos_relpath(pb->eb, path, scratch_pool);
db->eb = pb->eb;
db->path = apr_pstrdup(result_pool, relpath);
db->base_revision = base_revision;
- if (pb->copyfrom_path)
+ if (pb->copyfrom_relpath)
{
/* We are inside a copy. */
const char *name = svn_relpath_basename(relpath, scratch_pool);
- db->copyfrom_path = apr_pstrcat(result_pool, pb->copyfrom_path,
- "/", name, NULL);
+ db->copyfrom_relpath = svn_relpath_join(pb->copyfrom_relpath, name,
+ result_pool);
db->copyfrom_rev = pb->copyfrom_rev;
}
@@ -818,7 +805,7 @@ ev2_absent_directory(const char *path,
{
struct ev2_dir_baton *pb = parent_baton;
svn_kind_t *kind = apr_palloc(pb->eb->edit_pool, sizeof(*kind));
- const char *relpath = map_to_relpath(pb->eb, path, scratch_pool);
+ const char *relpath = map_to_repos_relpath(pb->eb, path, scratch_pool);
*kind = svn_kind_dir;
SVN_ERR(add_action(pb->eb, relpath, ACTION_ADD_ABSENT, kind));
@@ -838,7 +825,7 @@ ev2_add_file(const char *path,
apr_pool_t *scratch_pool = result_pool;
struct ev2_file_baton *fb = apr_pcalloc(result_pool, sizeof(*fb));
struct ev2_dir_baton *pb = parent_baton;
- const char *relpath = map_to_relpath(pb->eb, path, scratch_pool);
+ const char *relpath = map_to_repos_relpath(pb->eb, path, scratch_pool);
struct change_node *change = locate_change(pb->eb, relpath);
/* ### assert that RESTRUCTURE is NONE or DELETE? */
@@ -894,23 +881,24 @@ ev2_open_file(const char *path,
apr_pool_t *scratch_pool = result_pool;
struct ev2_file_baton *fb = apr_pcalloc(result_pool, sizeof(*fb));
struct ev2_dir_baton *pb = parent_baton;
- const char *relpath = map_to_relpath(pb->eb, path, scratch_pool);
+ const char *relpath = map_to_repos_relpath(pb->eb, path, scratch_pool);
fb->eb = pb->eb;
fb->path = apr_pstrdup(result_pool, relpath);
fb->base_revision = base_revision;
- if (pb->copyfrom_path)
+ if (pb->copyfrom_relpath)
{
/* We're in a copied directory, so the delta base is going to be
based up on the copy source. */
const char *name = svn_relpath_basename(relpath, scratch_pool);
- const char *copyfrom_path = apr_pstrcat(result_pool, pb->copyfrom_path,
- "/", name, NULL);
+ const char *copyfrom_relpath = svn_relpath_join(pb->copyfrom_relpath,
+ name,
+ scratch_pool);
SVN_ERR(fb->eb->fetch_base_func(&fb->delta_base,
fb->eb->fetch_base_baton,
- copyfrom_path, pb->copyfrom_rev,
+ copyfrom_relpath, pb->copyfrom_rev,
result_pool, scratch_pool));
}
else
@@ -1031,7 +1019,7 @@ ev2_absent_file(const char *path,
{
struct ev2_dir_baton *pb = parent_baton;
svn_kind_t *kind = apr_palloc(pb->eb->edit_pool, sizeof(*kind));
- const char *relpath = map_to_relpath(pb->eb, path, scratch_pool);
+ const char *relpath = map_to_repos_relpath(pb->eb, path, scratch_pool);
*kind = svn_kind_file;
SVN_ERR(add_action(pb->eb, relpath, ACTION_ADD_ABSENT, kind));
@@ -1090,6 +1078,8 @@ delta_from_editor(const svn_delta_editor
unlock_func_t unlock_func,
void *unlock_baton,
svn_boolean_t *found_abs_paths,
+ const char *repos_root,
+ const char *base_relpath,
svn_delta_fetch_props_func_t fetch_props_func,
void *fetch_props_baton,
svn_delta_fetch_base_func_t fetch_base_func,
@@ -1126,6 +1116,8 @@ delta_from_editor(const svn_delta_editor
eb->found_abs_paths = found_abs_paths;
*eb->found_abs_paths = FALSE;
eb->exb = exb;
+ eb->repos_root = apr_pstrdup(pool, repos_root);
+ eb->base_relpath = apr_pstrdup(pool, base_relpath);
eb->fetch_props_func = fetch_props_func;
eb->fetch_props_baton = fetch_props_baton;
@@ -1184,6 +1176,8 @@ struct editor_baton
struct operation root;
svn_boolean_t *make_abs_paths;
+ const char *repos_root;
+ const char *base_relpath;
apr_hash_t *paths;
apr_pool_t *edit_pool;
@@ -1253,7 +1247,7 @@ build(struct editor_baton *eb,
svn_revnum_t head,
apr_pool_t *scratch_pool)
{
- apr_array_header_t *path_bits = svn_path_decompose(relpath, scratch_pool);
+ apr_array_header_t *path_bits;
const char *path_so_far = "";
struct operation *operation = &eb->root;
int i;
@@ -1262,10 +1256,13 @@ build(struct editor_baton *eb,
SVN_ERR_ASSERT((props && action == ACTION_PROPSET)
|| (!props && action != ACTION_PROPSET) );
+ relpath = svn_relpath_skip_ancestor(eb->base_relpath, relpath);
+
/* Look for any previous operations we've recognized for PATH. If
any of PATH's ancestors have not yet been traversed, we'll be
creating OP_OPEN operations for them as we walk down PATH's path
components. */
+ path_bits = svn_path_decompose(relpath, scratch_pool);
for (i = 0; i < path_bits->nelts; ++i)
{
const char *path_bit = APR_ARRAY_IDX(path_bits, i, const char *);
@@ -1284,13 +1281,27 @@ build(struct editor_baton *eb,
if (operation->operation == OP_REPLACE)
current_props = apr_hash_make(scratch_pool);
else if (operation->copyfrom_url)
- SVN_ERR(eb->fetch_props_func(¤t_props, eb->fetch_props_baton,
- operation->copyfrom_url,
- operation->copyfrom_revision,
- scratch_pool, scratch_pool));
+ {
+ const char *copyfrom_relpath;
+
+ if (eb->repos_root)
+ copyfrom_relpath = svn_uri_skip_ancestor(eb->repos_root,
+ operation->copyfrom_url,
+ scratch_pool);
+ else
+ copyfrom_relpath = operation->copyfrom_url;
+
+ SVN_ERR(eb->fetch_props_func(¤t_props, eb->fetch_props_baton,
+ copyfrom_relpath,
+ operation->copyfrom_revision,
+ scratch_pool, scratch_pool));
+ }
else
SVN_ERR(eb->fetch_props_func(¤t_props, eb->fetch_props_baton,
- relpath, rev, scratch_pool,
+ svn_relpath_join(eb->base_relpath,
+ relpath,
+ scratch_pool),
+ rev, scratch_pool,
scratch_pool));
SVN_ERR(svn_prop_diffs(&propdiffs, props, current_props, scratch_pool));
@@ -1343,8 +1354,15 @@ build(struct editor_baton *eb,
url, rev, scratch_pool));
else
operation->kind = kind;
- operation->copyfrom_url = url;
+
operation->copyfrom_revision = rev;
+
+ if (eb->repos_root)
+ operation->copyfrom_url = svn_path_url_add_component2(eb->repos_root,
+ url,
+ eb->edit_pool);
+ else
+ operation->copyfrom_url = apr_pstrcat(eb->edit_pool, "/", url, NULL);
}
/* Handle mkdir operations (which can be adds or replacements). */
else if (action == ACTION_MKDIR)
@@ -1991,6 +2009,8 @@ editor_from_delta(svn_editor_t **editor_
const svn_delta_editor_t *deditor,
void *dedit_baton,
svn_boolean_t *send_abs_paths,
+ const char *repos_root,
+ const char *base_relpath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
svn_delta_fetch_kind_func_t fetch_kind_func,
@@ -2024,6 +2044,8 @@ editor_from_delta(svn_editor_t **editor_
eb->dedit_baton = dedit_baton;
eb->edit_pool = result_pool;
eb->paths = apr_hash_make(result_pool);
+ eb->repos_root = apr_pstrdup(result_pool, repos_root);
+ eb->base_relpath = apr_pstrdup(result_pool, base_relpath);
eb->fetch_kind_func = fetch_kind_func;
eb->fetch_kind_baton = fetch_kind_baton;
@@ -2075,6 +2097,8 @@ svn_editor__insert_shims(const svn_delta
void **dedit_baton_out,
const svn_delta_editor_t *deditor_in,
void *dedit_baton_in,
+ const char *repos_root,
+ const char *base_relpath,
svn_delta_shim_callbacks_t *shim_callbacks,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
@@ -2108,9 +2132,15 @@ svn_editor__insert_shims(const svn_delta
SVN_ERR_ASSERT(shim_callbacks->fetch_props_func != NULL);
SVN_ERR_ASSERT(shim_callbacks->fetch_base_func != NULL);
+ if (!base_relpath)
+ base_relpath = "";
+ else if (base_relpath[0] == '/')
+ base_relpath += 1;
+
SVN_ERR(editor_from_delta(&editor, &exb, &unlock_func, &unlock_baton,
deditor_in, dedit_baton_in,
- found_abs_paths, NULL, NULL,
+ found_abs_paths, repos_root, base_relpath,
+ NULL, NULL,
shim_callbacks->fetch_kind_func,
shim_callbacks->fetch_baton,
shim_callbacks->fetch_props_func,
@@ -2119,6 +2149,7 @@ svn_editor__insert_shims(const svn_delta
SVN_ERR(delta_from_editor(deditor_out, dedit_baton_out, editor,
unlock_func, unlock_baton,
found_abs_paths,
+ repos_root, base_relpath,
shim_callbacks->fetch_props_func,
shim_callbacks->fetch_baton,
shim_callbacks->fetch_base_func,
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/caching.c?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/caching.c Sat Apr 14 12:37:25 2012
@@ -330,7 +330,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
memcache,
membuffer,
0, 0, /* Do not use inprocess cache */
- /* Values are svn_string_t */
+ /* Values are svn_stringbuf_t */
NULL, NULL,
APR_HASH_KEY_STRING,
apr_pstrcat(pool, prefix, "TEXT", (char *)NULL),
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/dag.c?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/dag.c Sat Apr 14 12:37:25 2012
@@ -155,11 +155,11 @@ static svn_error_t *
get_node_revision(node_revision_t **noderev_p,
dag_node_t *node)
{
- node_revision_t *noderev;
-
/* If we've already got a copy, there's no need to read it in. */
if (! node->node_revision)
{
+ node_revision_t *noderev;
+
SVN_ERR(svn_fs_fs__get_node_revision(&noderev, node->fs,
node->id, node->node_pool));
node->node_revision = noderev;
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs.h?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs.h Sat Apr 14 12:37:25 2012
@@ -82,6 +82,11 @@ extern "C" {
#define CONFIG_OPTION_FAIL_STOP "fail-stop"
#define CONFIG_SECTION_REP_SHARING "rep-sharing"
#define CONFIG_OPTION_ENABLE_REP_SHARING "enable-rep-sharing"
+#define CONFIG_SECTION_DELTIFICATION "deltification"
+#define CONFIG_OPTION_ENABLE_DIR_DELTIFICATION "enable-dir-deltification"
+#define CONFIG_OPTION_ENABLE_PROPS_DELTIFICATION "enable-props-deltification"
+#define CONFIG_OPTION_MAX_DELTIFICATION_WALK "max-deltification-walk"
+#define CONFIG_OPTION_MAX_LINEAR_DELTIFICATION "max-linear-deltification"
/* The format number of this filesystem.
This is independent of the repository format number, and
@@ -118,6 +123,10 @@ extern "C" {
/* The minimum format number that stores node kinds in changed-paths lists. */
#define SVN_FS_FS__MIN_KIND_IN_CHANGED_FORMAT 4
+/* 1.8 deltification options should work with any FSFS repo but to avoid
+ * issues with very old servers, restrict those options to the 1.6+ format*/
+#define SVN_FS_FS__MIN_DELTIFICATION_FORMAT 4
+
/* The 1.7-dev format, never released, that packed revprops into SQLite
revprops.db . */
#define SVN_FS_FS__PACKED_REVPROP_SQLITE_DEV_FORMAT 5
@@ -275,6 +284,19 @@ typedef struct fs_fs_data_t
/* Whether rep-sharing is supported by the filesystem
* and allowed by the configuration. */
svn_boolean_t rep_sharing_allowed;
+
+ /* Whether directory nodes shall be deltified just like file nodes. */
+ svn_boolean_t deltify_directories;
+
+ /* Whether nodes properties shall be deltified. */
+ svn_boolean_t deltify_properties;
+
+ /* Restart deltification histories after each multiple of this value */
+ apr_int64_t max_deltification_walk;
+
+ /* Maximum number of length of the linear part at the top of the
+ * deltification history after which skip deltas will be used. */
+ apr_int64_t max_linear_deltification;
} fs_fs_data_t;
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs_fs.c?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs_fs.c Sat Apr 14 12:37:25 2012
@@ -1082,6 +1082,34 @@ read_config(svn_fs_t *fs,
else
ffd->rep_sharing_allowed = FALSE;
+ /* Initialize ffd->deltify_directories. */
+ if (ffd->format >= SVN_FS_FS__MIN_DELTIFICATION_FORMAT)
+ {
+ SVN_ERR(svn_config_get_bool(ffd->config, &ffd->deltify_directories,
+ CONFIG_SECTION_DELTIFICATION,
+ CONFIG_OPTION_ENABLE_DIR_DELTIFICATION,
+ FALSE));
+ SVN_ERR(svn_config_get_bool(ffd->config, &ffd->deltify_properties,
+ CONFIG_SECTION_DELTIFICATION,
+ CONFIG_OPTION_ENABLE_PROPS_DELTIFICATION,
+ FALSE));
+ SVN_ERR(svn_config_get_int64(ffd->config, &ffd->max_deltification_walk,
+ CONFIG_SECTION_DELTIFICATION,
+ CONFIG_OPTION_MAX_DELTIFICATION_WALK,
+ SVN_FS_FS_MAX_DELTIFICATION_WALK));
+ SVN_ERR(svn_config_get_int64(ffd->config, &ffd->max_linear_deltification,
+ CONFIG_SECTION_DELTIFICATION,
+ CONFIG_OPTION_MAX_LINEAR_DELTIFICATION,
+ SVN_FS_FS_MAX_LINEAR_DELTIFICATION));
+ }
+ else
+ {
+ ffd->deltify_directories = FALSE;
+ ffd->deltify_properties = FALSE;
+ ffd->max_deltification_walk = SVN_FS_FS_MAX_DELTIFICATION_WALK;
+ ffd->max_linear_deltification = SVN_FS_FS_MAX_LINEAR_DELTIFICATION;
+ }
+
return SVN_NO_ERROR;
}
@@ -1130,7 +1158,67 @@ write_config(svn_fs_t *fs,
"### 'svnadmin verify' will check the rep-cache regardless of this setting." NL
"### rep-sharing is enabled by default." NL
"# " CONFIG_OPTION_ENABLE_REP_SHARING " = true" NL
-
+"" NL
+"[" CONFIG_SECTION_DELTIFICATION "]" NL
+"### To conserve space, the filesystem stores data as differences against" NL
+"### existing representations. This comes at a slight cost in performance," NL
+"### as calculating differences can increase commit times. Reading data" NL
+"### will also create higher CPU load and the data will be fragmented." NL
+"### Since deltification tends to save significant amounts of disk space," NL
+"### the overall I/O load can actually be lower." NL
+"###" NL
+"### The options in this section allow for tuning the deltification" NL
+"### strategy. Their effects on data size and server performance may vary" NL
+"### from one repository to another. Versions prior to 1.8 will ignore" NL
+"### this section." NL
+"###" NL
+"### The following parameter enables deltification for directories. It can" NL
+"### be switched on and off at will, but for best space-saving results" NL
+"### should be enabled consistently over the life of the repository." NL
+"### Repositories containing large directories will benefit greatly." NL
+"### In rarely read repositories, the I/O overhead may be significant as" NL
+"### cache hit rates will most likely be low" NL
+"### directory deltification is disabled by default." NL
+"# " CONFIG_OPTION_ENABLE_DIR_DELTIFICATION " = true" NL
+"###" NL
+"### The following parameter enables deltification for properties on files" NL
+"### and directories. Overall, this is a minor tuning option but can save" NL
+"### some disk space if frequently merge or if you frequently change node" NL
+"### properties. You should not activate this if rep-sharing has been" NL
+"### disabled." NL
+"### property deltification is disabled by default." NL
+"# " CONFIG_OPTION_ENABLE_PROPS_DELTIFICATION " = true" NL
+"###" NL
+"### During commit, the server may need to walk the whole change history of" NL
+"### of a given node to find a suitable deltification base. This linear" NL
+"### process can impact commit times, svnadmin load and similar operations." NL
+"### This setting limits the depth of the deltification history. If the" NL
+"### threshold has been reached, the node will be stored as fulltext and a" NL
+"### new deltification history begins." NL
+"### Note, this is unrelated to svn log." NL
+"### Very large values rarely provide significant additional savings but" NL
+"### can impact performance greatly - in particular if directory" NL
+"### deltification has been activated. Very small values may be useful in" NL
+"### repositories that are dominated by large, changing binaries." NL
+"### Should be a power of two minus 1. A value of 0 will effectively" NL
+"### disable deltification." NL
+"### For 1.8, the default value is 1023; earlier versions have no limit." NL
+"# " CONFIG_OPTION_MAX_DELTIFICATION_WALK " = 1023" NL
+"###" NL
+"### The skip-delta scheme used by FSFS tends to repeatably store redundant" NL
+"### delta information where a simple delta against the latest version is" NL
+"### often smaller. By default, 1.8+ will therefore use skip deltas only" NL
+"### after the linear chain of deltas has grown beyond the threshold" NL
+"### specified by this setting." NL
+"### Values up to 64 can result in some reduction in repository size for" NL
+"### the cost of quickly increasing I/O and CPU costs. Similarly, smaller" NL
+"### numbers can reduce those costs at the cost of more disk space. For" NL
+"### rarely read repositories or those containing larger binaries, this may" NL
+"### present a better trade-off." NL
+"### Should be a power of two. A value of 1 or smaller will cause the" NL
+"### exclusive use of skip-deltas (as in pre-1.8)." NL
+"### For 1.8, the default value is 16; earlier versions use 1." NL
+"# " CONFIG_OPTION_MAX_LINEAR_DELTIFICATION " = 16" NL
;
#undef NL
return svn_io_file_create(svn_dirent_join(fs->path, PATH_CONFIG, pool),
@@ -3536,8 +3624,9 @@ read_representation(svn_stream_t **conte
{
svn_stringbuf_t *fulltext;
svn_boolean_t is_cached;
- fulltext_cache_key = apr_psprintf(pool, "%ld/%" APR_OFF_T_FMT,
- rep->revision, rep->offset);
+ fulltext_cache_key = svn_fs_fs__combine_two_numbers(rep->revision,
+ rep->offset,
+ pool);
SVN_ERR(svn_cache__get((void **) &fulltext, &is_cached,
ffd->fulltext_cache, fulltext_cache_key,
pool));
@@ -5265,6 +5354,7 @@ choose_delta_base(representation_t **rep
int count;
int walk;
node_revision_t *base;
+ fs_fs_data_t *ffd = fs->fsap_data;
/* If we have no predecessors, then use the empty stream as a
base. */
@@ -5285,14 +5375,14 @@ choose_delta_base(representation_t **rep
along very long node histories. Close to HEAD however, we create
a linear history to minimize delta size. */
walk = noderev->predecessor_count - count;
- if (walk < SVN_FS_FS_MAX_LINEAR_DELTIFICATION)
+ if (walk < (int)ffd->max_linear_deltification)
count = noderev->predecessor_count - 1;
/* Finding the delta base over a very long distance can become extremely
expensive for very deep histories, possibly causing client timeouts etc.
OTOH, this is a rare operation and its gains are minimal. Lets simply
start deltification anew close every other 1000 changes or so. */
- if (walk > SVN_FS_FS_MAX_DELTIFICATION_WALK)
+ if (walk > (int)ffd->max_deltification_walk)
{
*rep = NULL;
return SVN_NO_ERROR;
@@ -5772,7 +5862,6 @@ write_hash_rep(representation_t *rep,
earlier reps with the same content. When such existing reps can be found,
we will truncate the one just written from the file and return the existing
rep. Perform temporary allocations in POOL. */
-#ifdef SVN_FS_FS_DELTIFY_DIRECTORIES
static svn_error_t *
write_hash_delta_rep(representation_t *rep,
apr_file_t *file,
@@ -5873,7 +5962,6 @@ write_hash_delta_rep(representation_t *r
return SVN_NO_ERROR;
}
-#endif
/* Sanity check ROOT_NODEREV, a candidate for being the root node-revision
of (not yet committed) revision REV in FS. Use POOL for temporary
@@ -6026,14 +6114,13 @@ write_final_rev(const svn_fs_id_t **new_
noderev->data_rep->txn_id = NULL;
noderev->data_rep->revision = rev;
-#ifdef SVN_FS_FS_DELTIFY_DIRECTORIES
- SVN_ERR(write_hash_delta_rep(noderev->data_rep, file,
- str_entries, fs, noderev, NULL,
- pool));
-#else
- SVN_ERR(write_hash_rep(noderev->data_rep, file, str_entries,
- fs, NULL, pool));
-#endif
+ if (ffd->deltify_directories)
+ SVN_ERR(write_hash_delta_rep(noderev->data_rep, file,
+ str_entries, fs, noderev, NULL,
+ pool));
+ else
+ SVN_ERR(write_hash_rep(noderev->data_rep, file, str_entries,
+ fs, NULL, pool));
}
}
else
@@ -6066,14 +6153,13 @@ write_final_rev(const svn_fs_id_t **new_
noderev->prop_rep->txn_id = NULL;
noderev->prop_rep->revision = rev;
-#ifdef SVN_FS_FS_DELTIFY_PROPS
- SVN_ERR(write_hash_delta_rep(noderev->prop_rep, file,
- proplist, fs, noderev, reps_hash,
- pool));
-#else
- SVN_ERR(write_hash_rep(noderev->prop_rep, file, proplist,
- fs, reps_hash, pool));
-#endif
+ if (ffd->deltify_properties)
+ SVN_ERR(write_hash_delta_rep(noderev->prop_rep, file,
+ proplist, fs, noderev, reps_hash,
+ pool));
+ else
+ SVN_ERR(write_hash_rep(noderev->prop_rep, file, proplist,
+ fs, reps_hash, pool));
}
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/id.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/id.c?rev=1326097&r1=1326096&r2=1326097&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/id.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/id.c Sat Apr 14 12:37:25 2012
@@ -26,6 +26,7 @@
#include "id.h"
#include "../libsvn_fs/fs-loader.h"
#include "private/svn_temp_serializer.h"
+#include "private/svn_string_private.h"
typedef struct id_private_t {
@@ -88,22 +89,25 @@ svn_string_t *
svn_fs_fs__id_unparse(const svn_fs_id_t *id,
apr_pool_t *pool)
{
- const char *txn_rev_id;
id_private_t *pvt = id->fsap_data;
if ((! pvt->txn_id))
{
- txn_rev_id = apr_psprintf(pool, "%ld/%"
- APR_OFF_T_FMT, pvt->rev, pvt->offset);
+ char rev_string[SVN_INT64_BUFFER_SIZE];
+ char offset_string[SVN_INT64_BUFFER_SIZE];
+
+ svn__i64toa(rev_string, pvt->rev);
+ svn__i64toa(offset_string, pvt->offset);
+ return svn_string_createf(pool, "%s.%s.r%s/%s",
+ pvt->node_id, pvt->copy_id,
+ rev_string, offset_string);
}
else
{
- txn_rev_id = pvt->txn_id;
+ return svn_string_createf(pool, "%s.%s.t%s",
+ pvt->node_id, pvt->copy_id,
+ pvt->txn_id);
}
- return svn_string_createf(pool, "%s.%s.%c%s",
- pvt->node_id, pvt->copy_id,
- (pvt->txn_id ? 't' : 'r'),
- txn_rev_id);
}