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 2011/10/25 17:37:43 UTC
svn commit: r1188722 [1/2] - in /subversion/branches/showing-merge-info: ./
build/generator/ build/generator/templates/ subversion/include/
subversion/include/private/ subversion/libsvn_client/
subversion/libsvn_delta/ subversion/libsvn_fs/ subversion/...
Author: julianfoad
Date: Tue Oct 25 15:37:42 2011
New Revision: 1188722
URL: http://svn.apache.org/viewvc?rev=1188722&view=rev
Log:
On the 'showing-merge-info' branch: Catch up to trunk@1188631.
Modified:
subversion/branches/showing-merge-info/ (props changed)
subversion/branches/showing-merge-info/build/generator/gen_win.py
subversion/branches/showing-merge-info/build/generator/templates/vcnet_vcproj.ezt
subversion/branches/showing-merge-info/build/generator/templates/vcnet_vcxproj.ezt
subversion/branches/showing-merge-info/subversion/include/private/svn_mergeinfo_private.h
subversion/branches/showing-merge-info/subversion/include/svn_delta.h
subversion/branches/showing-merge-info/subversion/include/svn_fs.h
subversion/branches/showing-merge-info/subversion/libsvn_client/diff.c
subversion/branches/showing-merge-info/subversion/libsvn_client/export.c
subversion/branches/showing-merge-info/subversion/libsvn_client/merge.c
subversion/branches/showing-merge-info/subversion/libsvn_client/mergeinfo.c
subversion/branches/showing-merge-info/subversion/libsvn_client/mergeinfo.h
subversion/branches/showing-merge-info/subversion/libsvn_client/repos_diff.c
subversion/branches/showing-merge-info/subversion/libsvn_delta/compat.c
subversion/branches/showing-merge-info/subversion/libsvn_fs/fs-loader.c
subversion/branches/showing-merge-info/subversion/libsvn_fs/fs-loader.h
subversion/branches/showing-merge-info/subversion/libsvn_fs_base/tree.c
subversion/branches/showing-merge-info/subversion/libsvn_fs_fs/tree.c
subversion/branches/showing-merge-info/subversion/libsvn_ra_neon/commit.c
subversion/branches/showing-merge-info/subversion/libsvn_ra_serf/commit.c
subversion/branches/showing-merge-info/subversion/libsvn_ra_svn/editorp.c
subversion/branches/showing-merge-info/subversion/libsvn_repos/commit.c
subversion/branches/showing-merge-info/subversion/libsvn_repos/dump.c
subversion/branches/showing-merge-info/subversion/libsvn_repos/log.c
subversion/branches/showing-merge-info/subversion/libsvn_subr/mergeinfo.c
subversion/branches/showing-merge-info/subversion/libsvn_wc/diff_editor.c
subversion/branches/showing-merge-info/subversion/libsvn_wc/status.c
subversion/branches/showing-merge-info/subversion/libsvn_wc/update_editor.c
subversion/branches/showing-merge-info/subversion/svnrdump/dump_editor.c
subversion/branches/showing-merge-info/subversion/svnsync/main.c
subversion/branches/showing-merge-info/subversion/tests/cmdline/log_tests.py
subversion/branches/showing-merge-info/subversion/tests/libsvn_delta/editor-test.c
Propchange: subversion/branches/showing-merge-info/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 25 15:37:42 2011
@@ -56,4 +56,4 @@
/subversion/branches/tree-conflicts:868291-873154
/subversion/branches/tree-conflicts-notify:873926-874008
/subversion/branches/uris-as-urls:1060426-1064427
-/subversion/trunk:1177607-1188105
+/subversion/trunk:1177607-1188631
Modified: subversion/branches/showing-merge-info/build/generator/gen_win.py
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/build/generator/gen_win.py?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/build/generator/gen_win.py (original)
+++ subversion/branches/showing-merge-info/build/generator/gen_win.py Tue Oct 25 15:37:42 2011
@@ -834,7 +834,8 @@ class WinGeneratorBase(GeneratorBase):
fakedefines = ["WIN32","_WINDOWS","alloca=_alloca",
"_CRT_SECURE_NO_DEPRECATE=",
- "_CRT_NONSTDC_NO_DEPRECATE="]
+ "_CRT_NONSTDC_NO_DEPRECATE=",
+ "_CRT_SECURE_NO_WARNINGS="]
if self.sqlite_inline:
fakedefines.append("SVN_SQLITE_INLINE")
Modified: subversion/branches/showing-merge-info/build/generator/templates/vcnet_vcproj.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/build/generator/templates/vcnet_vcproj.ezt?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/build/generator/templates/vcnet_vcproj.ezt (original)
+++ subversion/branches/showing-merge-info/build/generator/templates/vcnet_vcproj.ezt Tue Oct 25 15:37:42 2011
@@ -46,7 +46,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="TRUE"
[end] AdditionalIncludeDirectories="[for includes][includes][if-index includes last][else];[end][end]"
- PreprocessorDefinitions="[if-any instrument_apr_pools]APR_POOL_DEBUG=[instrument_apr_pools];[end][for configs.defines][configs.defines][if-index configs.defines last][else];[end][end];_CRT_SECURE_NO_WARNINGS"
+ PreprocessorDefinitions="[if-any instrument_apr_pools]APR_POOL_DEBUG=[instrument_apr_pools];[end][is platforms "x64"]WIN64;[end][for configs.defines][configs.defines][if-index configs.defines last][else];[end][end];_CRT_SECURE_NO_WARNINGS"
[is configs.name "Debug"] MinimalRebuild="TRUE"
RuntimeLibrary="3"
BasicRuntimeChecks="3"
Modified: subversion/branches/showing-merge-info/build/generator/templates/vcnet_vcxproj.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/build/generator/templates/vcnet_vcxproj.ezt?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/build/generator/templates/vcnet_vcxproj.ezt (original)
+++ subversion/branches/showing-merge-info/build/generator/templates/vcnet_vcxproj.ezt Tue Oct 25 15:37:42 2011
@@ -56,7 +56,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<StringPooling>true</StringPooling>
[end] <AdditionalIncludeDirectories>[for includes][includes];[end]%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>[if-any instrument_apr_pools]APR_POOL_DEBUG=[instrument_apr_pools];[end][for configs.defines][configs.defines];[end]_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>[if-any instrument_apr_pools]APR_POOL_DEBUG=[instrument_apr_pools];[end][is platforms "x64"]WIN64;[end][for configs.defines][configs.defines];[end]%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<BrowseInformation>true</BrowseInformation>
Modified: subversion/branches/showing-merge-info/subversion/include/private/svn_mergeinfo_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/include/private/svn_mergeinfo_private.h?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/include/private/svn_mergeinfo_private.h (original)
+++ subversion/branches/showing-merge-info/subversion/include/private/svn_mergeinfo_private.h Tue Oct 25 15:37:42 2011
@@ -124,11 +124,25 @@ svn_mergeinfo__add_prefix_to_catalog(svn
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Set *OUT_MERGEINFO to a deep copy of MERGEINFO with the relpath
+/* Set *OUT_MERGEINFO to a shallow copy of MERGEINFO with each source path
+ converted to a (URI-encoded) URL based on REPOS_ROOT_URL. *OUT_MERGEINFO
+ is declared as 'apr_hash_t *' because its key do not obey the rules of
+ 'svn_mergeinfo_t'.
+
+ Allocate *OUT_MERGEINFO and the new keys in RESULT_POOL. Use
+ SCRATCH_POOL for any temporary allocations. */
+svn_error_t *
+svn_mergeinfo__relpaths_to_urls(apr_hash_t **out_mergeinfo,
+ svn_mergeinfo_t mergeinfo,
+ const char *repos_root_url,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Set *OUT_MERGEINFO to a shallow copy of MERGEINFO with the relpath
SUFFIX_RELPATH added to the end of each key path.
- Allocate *OUT_MERGEINFO in RESULT_POOL. Use SCRATCH_POOL for any
- temporary allocations. */
+ Allocate *OUT_MERGEINFO and the new keys in RESULT_POOL. Use
+ SCRATCH_POOL for any temporary allocations. */
svn_error_t *
svn_mergeinfo__add_suffix_to_mergeinfo(svn_mergeinfo_t *out_mergeinfo,
svn_mergeinfo_t mergeinfo,
Modified: subversion/branches/showing-merge-info/subversion/include/svn_delta.h
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/include/svn_delta.h?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/include/svn_delta.h (original)
+++ subversion/branches/showing-merge-info/subversion/include/svn_delta.h Tue Oct 25 15:37:42 2011
@@ -1111,43 +1111,27 @@ typedef svn_error_t *(*svn_delta_fetch_k
apr_pool_t *scratch_pool
);
-/* Return a delta editor and baton which will forward calls to @a editor,
- * allocated in @a pool.
- *
- * @note: Since the semantics behind the two editors are different, calls
- * the timing of calls forwarded to @a editor may be imprecise. That is,
- * the memory and computational overhead in using this forwarding
- * mechanism may be large.
+/** Collection of callbacks used for the shim code. To enable this struct
+ * to grow, always use svn_delta_shim_callbacks_default()
+ * to allocate new instances of it.
*
* @since New in 1.8.
*/
-svn_error_t *
-svn_delta_from_editor(const svn_delta_editor_t **deditor,
- void **dedit_baton,
- svn_editor_t *editor,
- svn_delta_fetch_props_func_t fetch_props_func,
- void *fetch_props_baton,
- apr_pool_t *pool);
+typedef struct svn_delta_shim_callbacks_t
+{
+ svn_delta_fetch_props_func_t fetch_props_func;
+ void *fetch_props_baton;
+ svn_delta_fetch_kind_func_t fetch_kind_func;
+ void *fetch_kind_baton;
+} svn_delta_shim_callbacks_t;
-/* Return an editor allocated in @a result_pool which will forward calls
- * to @a deditor using @a dedit_baton.
- *
- * @note Since the sematics behind the two editors are different, the
- * timing of calls forwarded to the @a editor may be imprecise, and the
- * overhead large.
+/** Return a collection of default shim functions in @a result_pool.
*
* @since New in 1.8.
*/
-svn_error_t *
-svn_editor_from_delta(svn_editor_t **editor,
- const svn_delta_editor_t *deditor,
- void *dedit_baton,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
- svn_delta_fetch_kind_func_t fetch_kind_func,
- void *fetch_kind_baton,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
+svn_delta_shim_callbacks_t *
+svn_delta_shim_callbacks_default(apr_pool_t *result_pool);
+
/** A temporary API which conditionally inserts a double editor shim
* into the chain of delta editors. Used for testing Editor v2.
@@ -1166,10 +1150,7 @@ svn_editor__insert_shims(const svn_delta
void **dedit_baton_out,
const svn_delta_editor_t *deditor_in,
void *dedit_baton_in,
- svn_delta_fetch_props_func_t fetch_props_func,
- void *fetch_props_baton,
- svn_delta_fetch_kind_func_t fetch_kind_func,
- void *fetch_kind_baton,
+ svn_delta_shim_callbacks_t *shim_callbacks,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
Modified: subversion/branches/showing-merge-info/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/include/svn_fs.h?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/include/svn_fs.h (original)
+++ subversion/branches/showing-merge-info/subversion/include/svn_fs.h Tue Oct 25 15:37:42 2011
@@ -1501,6 +1501,15 @@ svn_fs_closest_copy(svn_fs_root_t **root
* @a inherit indicates whether to retrieve explicit,
* explicit-or-inherited, or only inherited mergeinfo.
*
+ * If @a adjust_inherited_mergeinfo is TRUE, then any inherited
+ * mergeinfo returned in @a *catalog is normalized to represent the
+ * inherited mergeinfo on the path doing the inheriting. If
+ * @a adjust_inherited_mergeinfo is FALSE, then any inherited
+ * mergeinfo is the raw explicit mergeinfo from the nearest parent
+ * of the path with explicit mergeinfo, unadjusted for the path-wise
+ * difference between the path and its parent. This may include
+ * non-inheritable mergeinfo.
+ *
* If @a include_descendants is TRUE, then additionally return the
* mergeinfo for any descendant of any element of @a paths which has
* the #SVN_PROP_MERGEINFO property explicitly set on it. (Note
@@ -1508,11 +1517,29 @@ svn_fs_closest_copy(svn_fs_root_t **root
* paths; descendants of the elements in @a paths which get their
* mergeinfo via inheritance are not included in @a *catalog.)
*
- * Do any necessary temporary allocation in @a pool.
+ * Allocate @a *catalog in result_pool. Do any necessary temporary
+ * allocations in @a scratch_pool.
*
- * @since New in 1.5.
+ * @since New in 1.8.
*/
svn_error_t *
+svn_fs_get_mergeinfo2(svn_mergeinfo_catalog_t *catalog,
+ svn_fs_root_t *root,
+ const apr_array_header_t *paths,
+ svn_mergeinfo_inheritance_t inherit,
+ svn_boolean_t include_descendants,
+ svn_boolean_t adjust_inherited_mergeinfo,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/**
+ * Same as svn_fs_get_mergeinfo2(), but with @a adjust_inherited_mergeinfo
+ * set always set to TRUE and only one pool.
+ *
+ * @deprecated Provided for backward compatibility with the 1.5 API.
+ */
+SVN_DEPRECATED
+svn_error_t *
svn_fs_get_mergeinfo(svn_mergeinfo_catalog_t *catalog,
svn_fs_root_t *root,
const apr_array_header_t *paths,
Modified: subversion/branches/showing-merge-info/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_client/diff.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_client/diff.c Tue Oct 25 15:37:42 2011
@@ -82,6 +82,7 @@ display_mergeinfo_diff(const char *old_m
apr_pool_t *pool)
{
apr_hash_t *old_mergeinfo_hash, *new_mergeinfo_hash, *added, *deleted;
+ apr_pool_t *iterpool = svn_pool_create(pool);
apr_hash_index_t *hi;
if (old_mergeinfo_val)
@@ -94,9 +95,9 @@ display_mergeinfo_diff(const char *old_m
else
new_mergeinfo_hash = NULL;
- SVN_ERR(svn_mergeinfo_diff(&deleted, &added, old_mergeinfo_hash,
- new_mergeinfo_hash,
- TRUE, pool));
+ SVN_ERR(svn_mergeinfo_diff2(&deleted, &added, old_mergeinfo_hash,
+ new_mergeinfo_hash,
+ TRUE, pool, pool));
for (hi = apr_hash_first(pool, deleted);
hi; hi = apr_hash_next(hi))
@@ -105,9 +106,11 @@ display_mergeinfo_diff(const char *old_m
apr_array_header_t *merge_revarray = svn__apr_hash_index_val(hi);
svn_string_t *merge_revstr;
- SVN_ERR(svn_rangelist_to_string(&merge_revstr, merge_revarray, pool));
+ svn_pool_clear(iterpool);
+ SVN_ERR(svn_rangelist_to_string(&merge_revstr, merge_revarray,
+ iterpool));
- SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, pool,
+ SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, iterpool,
_(" Reverse-merged %s:r%s%s"),
from_path, merge_revstr->data,
APR_EOL_STR));
@@ -120,14 +123,17 @@ display_mergeinfo_diff(const char *old_m
apr_array_header_t *merge_revarray = svn__apr_hash_index_val(hi);
svn_string_t *merge_revstr;
- SVN_ERR(svn_rangelist_to_string(&merge_revstr, merge_revarray, pool));
+ svn_pool_clear(iterpool);
+ SVN_ERR(svn_rangelist_to_string(&merge_revstr, merge_revarray,
+ iterpool));
- SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, pool,
+ SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, iterpool,
_(" Merged %s:r%s%s"),
from_path, merge_revstr->data,
APR_EOL_STR));
}
+ svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/showing-merge-info/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_client/export.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_client/export.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_client/export.c Tue Oct 25 15:37:42 2011
@@ -1160,6 +1160,8 @@ svn_client_export5(svn_revnum_t *result_
void *report_baton;
svn_delta_editor_t *editor = svn_delta_default_editor(pool);
svn_boolean_t use_sleep = FALSE;
+ svn_delta_shim_callbacks_t *shim_callbacks =
+ svn_delta_shim_callbacks_default(pool);
editor->set_target_revision = set_target_revision;
editor->open_root = open_root;
@@ -1180,8 +1182,7 @@ svn_client_export5(svn_revnum_t *result_
SVN_ERR(svn_editor__insert_shims(&export_editor, &edit_baton,
export_editor, edit_baton,
- NULL, NULL, NULL, NULL,
- pool, pool));
+ shim_callbacks, pool, pool));
/* Manufacture a basic 'report' to the update reporter. */
SVN_ERR(svn_ra_do_update2(ra_session,
Modified: subversion/branches/showing-merge-info/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_client/merge.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_client/merge.c Tue Oct 25 15:37:42 2011
@@ -457,21 +457,13 @@ make_conflict_versions(const svn_wc_conf
/* Construct the source URLs of the victim. */
{
- const char *child = svn_dirent_is_child(merge_b->target_abspath,
- victim_abspath,
- merge_b->pool);
- if (child != NULL)
- {
- left_url = svn_path_url_add_component2(merge_b->merge_source.url1,
- child, merge_b->pool);
- right_url = svn_path_url_add_component2(merge_b->merge_source.url2,
- child, merge_b->pool);
- }
- else
- {
- left_url = merge_b->merge_source.url1;
- right_url = merge_b->merge_source.url2;
- }
+ const char *child = svn_dirent_skip_ancestor(merge_b->target_abspath,
+ victim_abspath);
+ SVN_ERR_ASSERT(child != NULL);
+ left_url = svn_path_url_add_component2(merge_b->merge_source.url1,
+ child, merge_b->pool);
+ right_url = svn_path_url_add_component2(merge_b->merge_source.url2,
+ child, merge_b->pool);
}
*left = svn_wc_conflict_version_create(
@@ -1756,14 +1748,12 @@ merge_file_added(svn_wc_notify_state_t *
if (merge_b->same_repos)
{
const char *child =
- svn_dirent_is_child(merge_b->target_abspath, mine_abspath,
- scratch_pool);
- if (child != NULL)
- copyfrom_url = svn_path_url_add_component2(
- merge_b->merge_source.url2,
- child, scratch_pool);
- else
- copyfrom_url = merge_b->merge_source.url2;
+ svn_dirent_skip_ancestor(merge_b->target_abspath,
+ mine_abspath);
+ SVN_ERR_ASSERT(child != NULL);
+ copyfrom_url = svn_path_url_add_component2(
+ merge_b->merge_source.url2,
+ child, scratch_pool);
copyfrom_rev = rev2;
SVN_ERR(check_repos_match(merge_b, mine_abspath, copyfrom_url,
scratch_pool));
@@ -3520,7 +3510,7 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
Set CHILD->IMPLICIT_MERGEINFO to the mergeinfo inherited from
PARENT->IMPLICIT_MERGEINFO. CHILD->IMPLICIT_MERGEINFO is allocated
- in POOL.
+ in RESULT_POOL.
*/
static svn_error_t *
inherit_implicit_mergeinfo_from_parent(svn_client__merge_path_t *parent,
@@ -3549,17 +3539,17 @@ inherit_implicit_mergeinfo_from_parent(s
ctx, result_pool, scratch_pool));
/* Let CHILD inherit PARENT's implicit mergeinfo. */
- child->implicit_mergeinfo = apr_hash_make(result_pool);
path_diff = svn_dirent_is_child(parent->abspath, child->abspath,
scratch_pool);
-
/* PARENT->PATH better be an ancestor of CHILD->ABSPATH! */
SVN_ERR_ASSERT(path_diff);
- SVN_ERR(svn_client__adjust_mergeinfo_source_paths(
- child->implicit_mergeinfo, path_diff,
- parent->implicit_mergeinfo, result_pool));
+ SVN_ERR(svn_mergeinfo__add_suffix_to_mergeinfo(
+ &child->implicit_mergeinfo, parent->implicit_mergeinfo,
+ path_diff, result_pool, scratch_pool));
+ child->implicit_mergeinfo = svn_mergeinfo_dup(child->implicit_mergeinfo,
+ result_pool);
return SVN_NO_ERROR;
}
@@ -4320,11 +4310,9 @@ populate_remaining_ranges(apr_array_head
svn_pool_clear(iterpool);
- child_repos_path = svn_dirent_is_child(merge_b->target_abspath,
- child->abspath, iterpool);
- if (!child_repos_path)
- child_repos_path = "";
-
+ child_repos_path = svn_dirent_skip_ancestor(merge_b->target_abspath,
+ child->abspath);
+ SVN_ERR_ASSERT(child_repos_path != NULL);
child_url1 = svn_path_url_add_component2(url1, child_repos_path,
iterpool);
child_url2 = svn_path_url_add_component2(url2, child_repos_path,
@@ -4526,7 +4514,7 @@ calculate_merge_inheritance(apr_array_he
/* Calculate the new mergeinfo for the target tree rooted at TARGET_ABSPATH
based on MERGES (a mapping of absolute WC paths to rangelists representing
- a merge from the source REPOS_REL_PATH).
+ a merge from the source SOURCE_FSPATH).
If RESULT_CATALOG is NULL, then record the new mergeinfo in the WC (at,
and possibly below, TARGET_ABSPATH).
@@ -4539,7 +4527,7 @@ calculate_merge_inheritance(apr_array_he
static svn_error_t *
update_wc_mergeinfo(svn_mergeinfo_catalog_t result_catalog,
const char *target_abspath,
- const char *repos_rel_path,
+ const char *source_fspath,
apr_hash_t *merges,
svn_boolean_t is_rollback,
svn_client_ctx_t *ctx,
@@ -4557,7 +4545,7 @@ update_wc_mergeinfo(svn_mergeinfo_catalo
apr_array_header_t *rangelist;
svn_error_t *err;
const char *local_abspath_rel_to_target;
- const char *rel_path;
+ const char *fspath;
svn_mergeinfo_t mergeinfo;
svn_pool_clear(iterpool);
@@ -4599,16 +4587,13 @@ update_wc_mergeinfo(svn_mergeinfo_catalo
if (mergeinfo == NULL)
mergeinfo = apr_hash_make(iterpool);
- local_abspath_rel_to_target = svn_dirent_is_child(target_abspath,
- local_abspath,
- iterpool);
- if (local_abspath_rel_to_target)
- rel_path = svn_dirent_join(repos_rel_path,
- local_abspath_rel_to_target,
- iterpool);
- else
- rel_path = repos_rel_path;
- rangelist = apr_hash_get(mergeinfo, rel_path, APR_HASH_KEY_STRING);
+ local_abspath_rel_to_target = svn_dirent_skip_ancestor(target_abspath,
+ local_abspath);
+ SVN_ERR_ASSERT(local_abspath_rel_to_target != NULL);
+ fspath = svn_fspath__join(source_fspath,
+ local_abspath_rel_to_target,
+ iterpool);
+ rangelist = apr_hash_get(mergeinfo, fspath, APR_HASH_KEY_STRING);
if (rangelist == NULL)
rangelist = apr_array_make(iterpool, 0, sizeof(svn_merge_range_t *));
@@ -4625,7 +4610,7 @@ update_wc_mergeinfo(svn_mergeinfo_catalo
SVN_ERR(svn_rangelist_merge2(rangelist, ranges, iterpool, iterpool));
}
/* Update the mergeinfo by adjusting the path's rangelist. */
- apr_hash_set(mergeinfo, rel_path, APR_HASH_KEY_STRING, rangelist);
+ apr_hash_set(mergeinfo, fspath, APR_HASH_KEY_STRING, rangelist);
if (is_rollback && apr_hash_count(mergeinfo) == 0)
mergeinfo = NULL;
@@ -7357,11 +7342,11 @@ log_find_operative_subtree_revs(void *ba
interesting from a merge tracking perspective, see the global comment
'THE CHILDREN_WITH_MERGEINFO ARRAY'.
- MERGE_SOURCE_REPOS_ABSPATH is the absolute repository path of the merge
+ MERGE_SOURCE_FSPATH is the absolute repository path of the merge
source. OLDEST_REV and YOUNGEST_REV are the revisions merged from
- MERGE_SOURCE_REPOS_ABSPATH to MERGE_TARGET_ABSPATH.
+ MERGE_SOURCE_FSPATH to MERGE_TARGET_ABSPATH.
- RA_SESSION points to MERGE_SOURCE_REPOS_ABSPATH.
+ RA_SESSION points to MERGE_SOURCE_FSPATH.
Set *IMMEDIATE_CHILDREN to a hash (mapping const char * WC absolute
paths to const char * repos absolute paths) containing all the
@@ -7377,7 +7362,7 @@ log_find_operative_subtree_revs(void *ba
static svn_error_t *
get_inoperative_immediate_children(apr_hash_t **immediate_children,
apr_array_header_t *children_with_mergeinfo,
- const char *merge_source_repos_abspath,
+ const char *merge_source_fspath,
svn_revnum_t oldest_rev,
svn_revnum_t youngest_rev,
const char *merge_target_abspath,
@@ -7408,7 +7393,7 @@ get_inoperative_immediate_children(apr_h
apr_hash_set(*immediate_children,
apr_pstrdup(result_pool, child->abspath),
APR_HASH_KEY_STRING,
- svn_fspath__join(merge_source_repos_abspath,
+ svn_fspath__join(merge_source_fspath,
svn_dirent_is_child(merge_target_abspath,
child->abspath,
iterpool),
@@ -7437,7 +7422,7 @@ get_inoperative_immediate_children(apr_h
If RESULT_CATALOG is NULL then record mergeinfo describing a merge of
MERGED_RANGE->START:MERGED_RANGE->END from the repository relative path
- MERGEINFO_PATH to the merge target (and possibly its subtrees) described
+ MERGEINFO_FSPATH to the merge target (and possibly its subtrees) described
by NOTIFY_B->CHILDREN_WITH_MERGEINFO -- see the global comment
'THE CHILDREN_WITH_MERGEINFO ARRAY'. Obviously this should only
be called if recording mergeinfo -- see doc string for RECORD_MERGEINFO().
@@ -7454,7 +7439,7 @@ get_inoperative_immediate_children(apr_h
static svn_error_t *
record_mergeinfo_for_dir_merge(svn_mergeinfo_catalog_t result_catalog,
const svn_merge_range_t *merged_range,
- const char *mergeinfo_path,
+ const char *mergeinfo_fspath,
svn_depth_t depth,
svn_boolean_t squelch_mergeinfo_notifications,
notification_receiver_baton_t *notify_b,
@@ -7512,7 +7497,7 @@ record_mergeinfo_for_dir_merge(svn_merge
SVN_ERR(get_inoperative_immediate_children(
&inoperative_immediate_children,
notify_b->children_with_mergeinfo,
- mergeinfo_path, range.start + 1, range.end,
+ mergeinfo_fspath, range.start + 1, range.end,
merge_b->target_abspath, merge_b->ra_session1,
pool, iterpool));
@@ -7522,7 +7507,7 @@ record_mergeinfo_for_dir_merge(svn_merge
for (i = 0; i < notify_b->children_with_mergeinfo->nelts; i++)
{
const char *child_repos_path;
- const char *child_merge_src_canon_path;
+ const char *child_merge_src_fspath;
apr_array_header_t *child_merge_rangelist;
apr_hash_t *child_merges;
svn_client__merge_path_t *child =
@@ -7584,18 +7569,16 @@ record_mergeinfo_for_dir_merge(svn_merge
APR_HASH_KEY_STRING))
continue;
- child_repos_path = svn_dirent_is_child(merge_b->target_abspath,
- child->abspath, iterpool);
- if (!child_repos_path)
- child_repos_path = "";
-
- child_merge_src_canon_path = svn_fspath__join(mergeinfo_path,
- child_repos_path,
- iterpool);
+ child_repos_path = svn_dirent_skip_ancestor(merge_b->target_abspath,
+ child->abspath);
+ SVN_ERR_ASSERT(child_repos_path != NULL);
+ child_merge_src_fspath = svn_fspath__join(mergeinfo_fspath,
+ child_repos_path,
+ iterpool);
/* Filter any ranges from each child's natural history before
setting mergeinfo describing the merge. */
SVN_ERR(filter_natural_history_from_mergeinfo(
- &child_merge_rangelist, child_merge_src_canon_path,
+ &child_merge_rangelist, child_merge_src_fspath,
child->implicit_mergeinfo, &range, iterpool));
if (child_merge_rangelist->nelts == 0)
@@ -7621,7 +7604,7 @@ record_mergeinfo_for_dir_merge(svn_merge
it. The earlier call to record_skips will already have taken
care of this. */
if (i == 0)
- SVN_ERR(record_skips(mergeinfo_path,
+ SVN_ERR(record_skips(mergeinfo_fspath,
child_merge_rangelist,
is_rollback, notify_b, merge_b, iterpool));
else if (notify_b->skipped_abspaths
@@ -7705,7 +7688,7 @@ record_mergeinfo_for_dir_merge(svn_merge
const char *old_session_url;
const char *subtree_mergeinfo_url =
svn_path_url_add_component2(merge_b->repos_root_url,
- child_merge_src_canon_path + 1,
+ child_merge_src_fspath + 1,
iterpool);
/* Confirm that the naive mergeinfo we want to set on
@@ -7738,7 +7721,7 @@ record_mergeinfo_for_dir_merge(svn_merge
{
child_merge_src_rangelist = apr_hash_get(
subtree_history_as_mergeinfo,
- child_merge_src_canon_path,
+ child_merge_src_fspath,
APR_HASH_KEY_STRING);
SVN_ERR(svn_rangelist_intersect(&child_merge_rangelist,
child_merge_rangelist,
@@ -7758,7 +7741,7 @@ record_mergeinfo_for_dir_merge(svn_merge
child_merge_rangelist);
SVN_ERR(update_wc_mergeinfo(result_catalog,
child->abspath,
- child_merge_src_canon_path,
+ child_merge_src_fspath,
child_merges, is_rollback,
merge_b->ctx, iterpool));
}
@@ -7809,7 +7792,7 @@ record_mergeinfo_for_dir_merge(svn_merge
Record mergeinfo describing a merge of
MERGED_RANGE->START:MERGED_RANGE->END from the repository relative path
- MERGEINFO_PATH to each path in NOTIFY_B->ADDED_ABSPATHS which has explicit
+ MERGEINFO_FSPATH to each path in NOTIFY_B->ADDED_ABSPATHS which has explicit
mergeinfo or is the immediate child of a parent with explicit
non-inheritable mergeinfo.
@@ -7822,7 +7805,7 @@ record_mergeinfo_for_dir_merge(svn_merge
static svn_error_t *
record_mergeinfo_for_added_subtrees(
svn_merge_range_t *merged_range,
- const char *mergeinfo_path,
+ const char *mergeinfo_fspath,
svn_depth_t depth,
svn_boolean_t squelch_mergeinfo_notifications,
notification_receiver_baton_t *notify_b,
@@ -7878,7 +7861,7 @@ record_mergeinfo_for_added_subtrees(
svn_mergeinfo_t adds_history_as_mergeinfo;
apr_array_header_t *rangelist;
const char *rel_added_path;
- const char *added_path_mergeinfo_path;
+ const char *added_path_mergeinfo_fspath;
const char *old_session_url;
const char *added_path_mergeinfo_url;
@@ -7906,10 +7889,10 @@ record_mergeinfo_for_added_subtrees(
rel_added_path = svn_dirent_is_child(target_merge_path->abspath,
added_abspath, iterpool);
SVN_ERR_ASSERT(rel_added_path);
- added_path_mergeinfo_path = svn_dirent_join(mergeinfo_path,
- rel_added_path,
- iterpool);
- apr_hash_set(merge_mergeinfo, added_path_mergeinfo_path,
+ added_path_mergeinfo_fspath = svn_fspath__join(mergeinfo_fspath,
+ rel_added_path,
+ iterpool);
+ apr_hash_set(merge_mergeinfo, added_path_mergeinfo_fspath,
APR_HASH_KEY_STRING, rangelist);
/* Don't add new mergeinfo to describe the merge if that mergeinfo
@@ -7926,7 +7909,7 @@ record_mergeinfo_for_added_subtrees(
MERGEINFO_PATH/rel_added_path's history. */
added_path_mergeinfo_url =
svn_path_url_add_component2(merge_b->repos_root_url,
- added_path_mergeinfo_path + 1,
+ added_path_mergeinfo_fspath + 1,
iterpool);
SVN_ERR(svn_client__ensure_ra_session_url(
&old_session_url, merge_b->ra_session2,
@@ -7972,11 +7955,11 @@ typedef struct log_noop_baton_t
apr_array_header_t *children_with_mergeinfo;
/* Absolute repository path of MERGE_B->TARGET_ABSPATH. */
- const char *target_repos_abs;
+ const char *target_fspath;
/* Absolute repository path of younger of the two merge sources
being diffed. */
- const char *source_repos_abs;
+ const char *source_fspath;
/* Initially empty rangelists allocated in POOL. The rangelists are
* populated across multiple invocations of log_noop_revs(). */
@@ -8066,51 +8049,52 @@ log_noop_revs(void *baton,
hi;
hi = apr_hash_next(hi))
{
- const char *path = svn__apr_hash_index_key(hi);
+ const char *fspath = svn__apr_hash_index_key(hi);
const char *rel_path;
- const char *cwmi_path;
+ const char *cwmi_abspath;
apr_array_header_t *paths_explicit_rangelist = NULL;
svn_boolean_t mergeinfo_inherited = FALSE;
/* Adjust REL_PATH so it is relative to the merge source then use it to
calculate what path in the merge target would be affected by this
revision. */
- rel_path = svn_fspath__skip_ancestor(log_gap_baton->source_repos_abs, path);
+ rel_path = svn_fspath__skip_ancestor(log_gap_baton->source_fspath,
+ fspath);
/* Is PATH even within the merge target? If it isn't we
can disregard it altogether. */
if (rel_path == NULL)
continue;
- cwmi_path = svn_dirent_join(log_gap_baton->merge_b->target_abspath,
- rel_path, scratch_pool);
+ cwmi_abspath = svn_dirent_join(log_gap_baton->merge_b->target_abspath,
+ rel_path, scratch_pool);
/* Find any explicit or inherited mergeinfo for PATH. */
while (!log_entry_rev_required)
{
svn_client__merge_path_t *child = get_child_with_mergeinfo(
- log_gap_baton->children_with_mergeinfo, cwmi_path);
+ log_gap_baton->children_with_mergeinfo, cwmi_abspath);
if (child && child->pre_merge_mergeinfo)
{
/* Found some explicit mergeinfo, grab any ranges
for PATH. */
paths_explicit_rangelist =
- apr_hash_get(child->pre_merge_mergeinfo, path,
+ apr_hash_get(child->pre_merge_mergeinfo, fspath,
APR_HASH_KEY_STRING);
break;
}
- if (cwmi_path[0] == '\0'
- || svn_dirent_is_root(cwmi_path, strlen(cwmi_path))
+ if (cwmi_abspath[0] == '\0'
+ || svn_dirent_is_root(cwmi_abspath, strlen(cwmi_abspath))
|| svn_path_compare_paths(log_gap_baton->merge_b->target_abspath,
- cwmi_path) == 0)
+ cwmi_abspath) == 0)
{
/* Can't crawl any higher. */
break;
}
/* Didn't find anything so crawl up to the parent. */
- cwmi_path = svn_dirent_dirname(cwmi_path, scratch_pool);
- path = svn_dirent_dirname(path, scratch_pool);
+ cwmi_abspath = svn_dirent_dirname(cwmi_abspath, scratch_pool);
+ fspath = svn_fspath__dirname(fspath, scratch_pool);
/* At this point *if* we find mergeinfo it will be inherited. */
mergeinfo_inherited = TRUE;
@@ -8265,11 +8249,11 @@ remove_noop_subtree_ranges(const char *u
log_gap_baton.merge_b = merge_b;
log_gap_baton.children_with_mergeinfo = notify_b->children_with_mergeinfo;
SVN_ERR(svn_client__path_relative_to_root(
- &(log_gap_baton.target_repos_abs), merge_b->ctx->wc_ctx,
+ &(log_gap_baton.target_fspath), merge_b->ctx->wc_ctx,
merge_b->target_abspath, repos_root_url, TRUE, NULL,
result_pool, scratch_pool));
SVN_ERR(svn_client__path_relative_to_root(
- &(log_gap_baton.source_repos_abs), merge_b->ctx->wc_ctx,
+ &(log_gap_baton.source_fspath), merge_b->ctx->wc_ctx,
url2, repos_root_url, TRUE, NULL,
result_pool, scratch_pool));
log_gap_baton.merged_ranges = apr_array_make(scratch_pool, 0,
@@ -9745,7 +9729,6 @@ mergeinfo_in_catalog(svn_boolean_t *in_c
const char **cat_key_path,
const char *repos_rel_path,
svn_mergeinfo_t mergeinfo,
- svn_revnum_t revision,
svn_mergeinfo_catalog_t catalog,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
@@ -9816,7 +9799,7 @@ typedef struct log_find_operative_baton_
svn_mergeinfo_catalog_t unmerged_catalog;
/* The repository absolute path of the reintegrate target. */
- const char *target_abspath;
+ const char *target_fspath;
/* The path of the reintegrate source relative to the repository root. */
const char *source_repos_rel_path;
@@ -9847,7 +9830,7 @@ log_find_operative_revs(void *baton,
svn_boolean_t in_catalog;
svn_mergeinfo_t log_entry_as_mergeinfo;
- rel_path = svn_fspath__skip_ancestor(log_baton->target_abspath, path);
+ rel_path = svn_fspath__skip_ancestor(log_baton->target_fspath, path);
/* Easy out: The path is not within the tree of interest. */
if (rel_path == NULL)
continue;
@@ -9862,7 +9845,7 @@ log_find_operative_revs(void *baton,
SVN_ERR(mergeinfo_in_catalog(&in_catalog, &subtree_missing_this_rev,
source_rel_path, log_entry_as_mergeinfo,
- revision, log_baton->merged_catalog,
+ log_baton->merged_catalog,
pool, pool));
if (!in_catalog)
@@ -9998,8 +9981,8 @@ find_unsynced_ranges(const char *source_
log_baton.merged_catalog = merged_catalog;
log_baton.unmerged_catalog = true_unmerged_catalog;
log_baton.source_repos_rel_path = source_repos_rel_path;
- log_baton.target_abspath = apr_psprintf(scratch_pool, "/%s",
- target_repos_rel_path);
+ log_baton.target_fspath = apr_psprintf(scratch_pool, "/%s",
+ target_repos_rel_path);
log_baton.result_pool = result_pool;
APR_ARRAY_PUSH(log_targets, const char *) = "";
Modified: subversion/branches/showing-merge-info/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_client/mergeinfo.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_client/mergeinfo.c Tue Oct 25 15:37:42 2011
@@ -141,35 +141,6 @@ svn_client__record_wc_mergeinfo(const ch
/*** Retrieving mergeinfo. ***/
svn_error_t *
-svn_client__adjust_mergeinfo_source_paths(svn_mergeinfo_t adjusted_mergeinfo,
- const char *rel_path,
- svn_mergeinfo_t mergeinfo,
- apr_pool_t *pool)
-{
- apr_hash_index_t *hi;
- const char *path;
- apr_array_header_t *copied_rangelist;
-
- SVN_ERR_ASSERT(adjusted_mergeinfo);
- SVN_ERR_ASSERT(mergeinfo);
-
- for (hi = apr_hash_first(pool, mergeinfo); hi; hi = apr_hash_next(hi))
- {
- const char *merge_source = svn__apr_hash_index_key(hi);
- apr_array_header_t *rangelist = svn__apr_hash_index_val(hi);
-
- /* Copy inherited mergeinfo into our output hash, adjusting the
- merge source as appropriate. */
- path = svn_fspath__join(merge_source, rel_path, pool);
- copied_rangelist = svn_rangelist_dup(rangelist, pool);
- apr_hash_set(adjusted_mergeinfo, path, APR_HASH_KEY_STRING,
- copied_rangelist);
- }
- return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
svn_client__get_wc_mergeinfo(svn_mergeinfo_t *mergeinfo,
svn_boolean_t *inherited,
svn_mergeinfo_inheritance_t inherit,
@@ -296,11 +267,11 @@ svn_client__get_wc_mergeinfo(svn_mergein
if (wc_mergeinfo)
{
*inherited = TRUE;
- *mergeinfo = apr_hash_make(result_pool);
- SVN_ERR(svn_client__adjust_mergeinfo_source_paths(*mergeinfo,
- walk_relpath,
- wc_mergeinfo,
- result_pool));
+ SVN_ERR(svn_mergeinfo__add_suffix_to_mergeinfo(mergeinfo,
+ wc_mergeinfo,
+ walk_relpath,
+ result_pool,
+ scratch_pool));
}
else
{
@@ -812,13 +783,11 @@ should_elide_mergeinfo(svn_boolean_t *el
svn_mergeinfo_t path_tweaked_parent_mergeinfo;
apr_pool_t *subpool = svn_pool_create(pool);
- path_tweaked_parent_mergeinfo = apr_hash_make(subpool);
-
/* If we need to adjust the paths in PARENT_MERGEINFO do it now. */
if (path_suffix)
- SVN_ERR(svn_client__adjust_mergeinfo_source_paths(
- path_tweaked_parent_mergeinfo,
- path_suffix, parent_mergeinfo, subpool));
+ SVN_ERR(svn_mergeinfo__add_suffix_to_mergeinfo(
+ &path_tweaked_parent_mergeinfo, parent_mergeinfo,
+ path_suffix, subpool, subpool));
else
path_tweaked_parent_mergeinfo = parent_mergeinfo;
@@ -1208,6 +1177,8 @@ svn_client__elide_mergeinfo_catalog(svn_
struct elide_mergeinfo_catalog_cb_baton cb = { 0 };
void *eb;
int i;
+ svn_delta_shim_callbacks_t *shim_callbacks =
+ svn_delta_shim_callbacks_default(pool);
cb.elidable_paths = elidable_paths;
cb.mergeinfo_catalog = mergeinfo_catalog;
@@ -1218,8 +1189,7 @@ svn_client__elide_mergeinfo_catalog(svn_
eb = mergeinfo_catalog;
SVN_ERR(svn_editor__insert_shims((const svn_delta_editor_t **)&editor, &eb,
- editor, eb, NULL, NULL, NULL, NULL,
- pool, pool));
+ editor, eb, shim_callbacks, pool, pool));
/* Walk over the paths, and build up a list of elidable ones. */
SVN_ERR(svn_hash_keys(&paths, mergeinfo_catalog, pool));
@@ -1249,8 +1219,8 @@ svn_client__elide_mergeinfo_catalog(svn_
each path.
Return a pointer to the mergeinfo value of the nearest path-wise ancestor
- of ABS_REPOS_PATH in DEPTH_FIRST_CATALOG_INDEX. A path is considered its
- own ancestor, so if a key exactly matches ABS_REPOS_PATH, return that
+ of FSPATH in DEPTH_FIRST_CATALOG_INDEX. A path is considered its
+ own ancestor, so if a key exactly matches FSPATH, return that
key's mergeinfo and set *ANCESTOR_IS_SELF to true (set it to false in all
other cases).
@@ -1259,7 +1229,7 @@ svn_client__elide_mergeinfo_catalog(svn_
static svn_mergeinfo_t
find_nearest_ancestor(const apr_array_header_t *depth_first_catalog_index,
svn_boolean_t *ancestor_is_self,
- const char *abs_repos_path)
+ const char *fspath)
{
int ancestor_index = -1;
@@ -1273,12 +1243,12 @@ find_nearest_ancestor(const apr_array_he
{
svn_sort__item_t item = APR_ARRAY_IDX(depth_first_catalog_index, i,
svn_sort__item_t);
- if (svn_fspath__is_ancestor(item.key, abs_repos_path))
+ if (svn_fspath__is_ancestor(item.key, fspath))
{
ancestor_index = i;
- /* There's no nearer ancestor than ABS_REPOS_PATH itself. */
- if (strcmp(item.key, abs_repos_path) == 0)
+ /* There's no nearer ancestor than FSPATH itself. */
+ if (strcmp(item.key, fspath) == 0)
{
*ancestor_is_self = TRUE;
break;
@@ -1306,12 +1276,12 @@ struct filter_log_entry_baton_t
/* Unsorted array of repository relative paths representing the merge
sources. There will be more than one source */
- const apr_array_header_t *merge_source_paths;
+ const apr_array_header_t *merge_source_fspaths;
/* The repository-absolute path we are calling svn_client_log5() on. */
- const char *abs_repos_target_path;
+ const char *target_fspath;
- /* Mergeinfo catalog for the tree rooted at ABS_REPOS_TARGET_PATH.
+ /* Mergeinfo catalog for the tree rooted at TARGET_FSPATH.
The path keys must be repository-absolute. */
svn_mergeinfo_catalog_t target_mergeinfo_catalog;
@@ -1337,16 +1307,16 @@ struct filter_log_entry_baton_t
Call the wrapped log receiver BATON->log_receiver (with
BATON->log_receiver_baton) if:
-
+
BATON->FILTERING_MERGED is FALSE and the changes represented by LOG_ENTRY
- have been fully merged from BATON->MERGE_SOURCE_PATHS to the WC target
+ have been fully merged from BATON->merge_source_fspaths to the WC target
based on the mergeinfo for the WC contained in BATON->TARGET_MERGEINFO_CATALOG.
Or
BATON->FILTERING_MERGED is TRUE and the changes represented by LOG_ENTRY
have not been merged, or only partially merged, from
- BATON->MERGE_SOURCE_PATHS to the WC target based on the mergeinfo for the
+ BATON->merge_source_fspaths to the WC target based on the mergeinfo for the
WC contained in BATON->TARGET_MERGEINFO_CATALOG. */
static svn_error_t *
filter_log_entry_with_rangelist(void *baton,
@@ -1405,25 +1375,25 @@ filter_log_entry_with_rangelist(void *ba
{
const char *path = svn__apr_hash_index_key(hi);
svn_log_changed_path2_t *change = svn__apr_hash_index_val(hi);
- const char *target_path_affected;
+ const char *target_fspath_affected;
svn_mergeinfo_t nearest_ancestor_mergeinfo;
apr_hash_index_t *hi2;
svn_boolean_t found_this_revision = FALSE;
const char *merge_source_rel_target;
- const char *merge_source_path;
+ const char *merge_source_fspath;
svn_boolean_t ancestor_is_self;
svn_pool_clear(iterpool);
/* Check that PATH is a subtree of at least one of the
merge sources. If not then ignore this path. */
- for (i = 0; i < fleb->merge_source_paths->nelts; i++)
+ for (i = 0; i < fleb->merge_source_fspaths->nelts; i++)
{
- merge_source_path = APR_ARRAY_IDX(fleb->merge_source_paths,
- i, const char *);
+ merge_source_fspath = APR_ARRAY_IDX(fleb->merge_source_fspaths,
+ i, const char *);
merge_source_rel_target
- = svn_fspath__skip_ancestor(merge_source_path, path);
+ = svn_fspath__skip_ancestor(merge_source_fspath, path);
if (merge_source_rel_target)
{
/* If MERGE_SOURCE was itself deleted, replaced, or added
@@ -1431,24 +1401,24 @@ filter_log_entry_with_rangelist(void *ba
can't merge a addition or deletion of yourself. */
if (merge_source_rel_target[0] == '\0'
&& (change->action != 'M'))
- i = fleb->merge_source_paths->nelts;
+ i = fleb->merge_source_fspaths->nelts;
break;
}
}
/* If we examined every merge source path and PATH is a child of
none of them then we can ignore this PATH. */
- if (i == fleb->merge_source_paths->nelts)
+ if (i == fleb->merge_source_fspaths->nelts)
continue;
/* Calculate the target path which PATH would affect if merged. */
- target_path_affected = svn_fspath__join(fleb->abs_repos_target_path,
- merge_source_rel_target,
- iterpool);
+ target_fspath_affected = svn_fspath__join(fleb->target_fspath,
+ merge_source_rel_target,
+ iterpool);
nearest_ancestor_mergeinfo =
find_nearest_ancestor(fleb->depth_first_catalog_index,
&ancestor_is_self,
- target_path_affected);
+ target_fspath_affected);
/* Issue #3791: A path should never have explicit mergeinfo
describing its own addition (that's self-referential). Nor will
@@ -1488,11 +1458,11 @@ filter_log_entry_with_rangelist(void *ba
/* Does the mergeinfo for PATH reflect if
LOG_ENTRY->REVISION was previously merged
- from MERGE_SOURCE_PATH? */
- if (svn_fspath__is_ancestor(merge_source_path,
+ from MERGE_SOURCE_FSPATH? */
+ if (svn_fspath__is_ancestor(merge_source_fspath,
mergeinfo_path))
{
- /* Something was merged from MERGE_SOURCE_PATH, does
+ /* Something was merged from MERGE_SOURCE_FSPATH, does
it include LOG_ENTRY->REVISION? */
SVN_ERR(svn_rangelist_intersect(&intersection,
rangelist,
@@ -1541,11 +1511,11 @@ filter_log_entry_with_rangelist(void *ba
static svn_error_t *
logs_for_mergeinfo_rangelist(const char *source_url,
- const apr_array_header_t *merge_source_paths,
+ const apr_array_header_t *merge_source_fspaths,
svn_boolean_t filtering_merged,
const apr_array_header_t *rangelist,
svn_mergeinfo_t target_mergeinfo_catalog,
- const char *abs_repos_target_path,
+ const char *target_fspath,
svn_boolean_t discover_changed_paths,
const apr_array_header_t *revprops,
svn_log_entry_receiver_t log_receiver,
@@ -1591,13 +1561,13 @@ logs_for_mergeinfo_rangelist(const char
/* Build the log filtering callback baton. */
fleb.filtering_merged = filtering_merged;
- fleb.merge_source_paths = merge_source_paths;
+ fleb.merge_source_fspaths = merge_source_fspaths;
fleb.target_mergeinfo_catalog = target_mergeinfo_catalog;
fleb.depth_first_catalog_index =
svn_sort__hash(target_mergeinfo_catalog,
svn_sort_compare_items_as_paths,
scratch_pool);
- fleb.abs_repos_target_path = abs_repos_target_path;
+ fleb.target_fspath = target_fspath;
fleb.rangelist = rangelist;
fleb.log_receiver = log_receiver;
fleb.log_receiver_baton = log_receiver_baton;
@@ -1632,7 +1602,6 @@ svn_client_mergeinfo_get_merged(apr_hash
apr_pool_t *pool)
{
const char *repos_root;
- apr_hash_t *full_path_mergeinfo;
svn_mergeinfo_catalog_t mergeinfo_cat;
svn_mergeinfo_t mergeinfo;
@@ -1658,26 +1627,8 @@ svn_client_mergeinfo_get_merged(apr_hash
mergeinfo = NULL;
}
- /* Copy the MERGEINFO hash items into another hash, but change
- the relative paths into full URLs. */
- *mergeinfo_p = NULL;
- if (mergeinfo)
- {
- apr_hash_index_t *hi;
-
- full_path_mergeinfo = apr_hash_make(pool);
- for (hi = apr_hash_first(pool, mergeinfo); hi; hi = apr_hash_next(hi))
- {
- const char *key = svn__apr_hash_index_key(hi);
- void *val = svn__apr_hash_index_val(hi);
-
- apr_hash_set(full_path_mergeinfo,
- svn_path_url_add_component2(repos_root, key + 1, pool),
- APR_HASH_KEY_STRING, val);
- }
- *mergeinfo_p = full_path_mergeinfo;
- }
-
+ SVN_ERR(svn_mergeinfo__relpaths_to_urls(mergeinfo_p, mergeinfo,
+ repos_root, pool, pool));
return SVN_NO_ERROR;
}
@@ -1711,7 +1662,7 @@ svn_client_mergeinfo_log(svn_boolean_t f
svn_mergeinfo_t target_history;
apr_array_header_t *master_noninheritable_rangelist;
apr_array_header_t *master_inheritable_rangelist;
- apr_array_header_t *merge_source_paths =
+ apr_array_header_t *merge_source_fspaths =
apr_array_make(scratch_pool, 1, sizeof(const char *));
apr_hash_index_t *hi_catalog;
apr_hash_index_t *hi;
@@ -1742,7 +1693,7 @@ svn_client_mergeinfo_log(svn_boolean_t f
ctx->wc_ctx,
target_path_or_url,
repos_root,
- FALSE, NULL,
+ FALSE /* leading_slash */, NULL,
scratch_pool,
scratch_pool));
@@ -2054,7 +2005,7 @@ svn_client_mergeinfo_log(svn_boolean_t f
subtree_merged_rangelist,
FALSE, iterpool));
- APR_ARRAY_PUSH(merge_source_paths, const char *) =
+ APR_ARRAY_PUSH(merge_source_fspaths, const char *) =
apr_pstrdup(scratch_pool, key);
if (intersecting_rangelist->nelts)
@@ -2070,13 +2021,12 @@ svn_client_mergeinfo_log(svn_boolean_t f
log_target = svn_path_url_add_component2(repos_root, log_target + 1,
scratch_pool);
- SVN_ERR(logs_for_mergeinfo_rangelist(log_target, merge_source_paths,
+ SVN_ERR(logs_for_mergeinfo_rangelist(log_target, merge_source_fspaths,
finding_merged,
master_inheritable_rangelist,
target_mergeinfo_cat,
- svn_dirent_join("/",
- target_repos_rel,
- scratch_pool),
+ svn_fspath__join("/", target_repos_rel,
+ scratch_pool),
discover_changed_paths,
revprops,
log_receiver, log_receiver_baton,
Modified: subversion/branches/showing-merge-info/subversion/libsvn_client/mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_client/mergeinfo.h?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_client/mergeinfo.h Tue Oct 25 15:37:42 2011
@@ -166,7 +166,9 @@ svn_client__get_wc_mergeinfo_catalog(svn
If there is no mergeinfo available for REL_PATH, or if the server
doesn't support a mergeinfo capability and SQUELCH_INCAPABLE is
- TRUE, set *TARGET_MERGEINFO to NULL. */
+ TRUE, set *TARGET_MERGEINFO to NULL. If the server doesn't support
+ a mergeinfo capability and SQUELCH_INCAPABLE is FALSE, return an
+ SVN_ERR_UNSUPPORTED_FEATURE error. */
svn_error_t *
svn_client__get_repos_mergeinfo(svn_mergeinfo_t *target_mergeinfo,
svn_ra_session_t *ra_session,
@@ -355,17 +357,6 @@ svn_error_t *
svn_client__elide_mergeinfo_catalog(svn_mergeinfo_t mergeinfo_catalog,
apr_pool_t *pool);
-/* For each source path : rangelist pair in MERGEINFO, append REL_PATH to
- the source path and add the new source path : rangelist pair to
- ADJUSTED_MERGEINFO. The new source path and rangelist are both deep
- copies allocated in POOL. Neither ADJUSTED_MERGEINFO
- nor MERGEINFO should be NULL. */
-svn_error_t *
-svn_client__adjust_mergeinfo_source_paths(svn_mergeinfo_t adjusted_mergeinfo,
- const char *rel_path,
- svn_mergeinfo_t mergeinfo,
- apr_pool_t *pool);
-
/* Set *MERGEINFO_CHANGES to TRUE if LOCAL_ABSPATH has locally modified
mergeinfo, set *MERGEINFO_CHANGES to FALSE otherwise. */
svn_error_t *
Modified: subversion/branches/showing-merge-info/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_client/repos_diff.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_client/repos_diff.c Tue Oct 25 15:37:42 2011
@@ -1348,6 +1348,8 @@ svn_client__get_diff_editor(const svn_de
apr_pool_t *editor_pool = svn_pool_create(result_pool);
svn_delta_editor_t *tree_editor = svn_delta_default_editor(editor_pool);
struct edit_baton *eb = apr_pcalloc(editor_pool, sizeof(*eb));
+ svn_delta_shim_callbacks_t *shim_callbacks =
+ svn_delta_shim_callbacks_default(editor_pool);
eb->pool = editor_pool;
eb->depth = depth;
@@ -1388,7 +1390,7 @@ svn_client__get_diff_editor(const svn_de
eb->pool));
SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
- NULL, NULL, NULL, NULL,
+ shim_callbacks,
result_pool, result_pool));
return SVN_NO_ERROR;
Modified: subversion/branches/showing-merge-info/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_delta/compat.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_delta/compat.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_delta/compat.c Tue Oct 25 15:37:42 2011
@@ -507,13 +507,13 @@ ev2_abort_edit(void *edit_baton,
return svn_error_trace(svn_editor_abort(eb->editor));
}
-svn_error_t *
-svn_delta_from_editor(const svn_delta_editor_t **deditor,
- void **dedit_baton,
- svn_editor_t *editor,
- svn_delta_fetch_props_func_t fetch_props_func,
- void *fetch_props_baton,
- apr_pool_t *pool)
+static svn_error_t *
+delta_from_editor(const svn_delta_editor_t **deditor,
+ void **dedit_baton,
+ svn_editor_t *editor,
+ svn_delta_fetch_props_func_t fetch_props_func,
+ void *fetch_props_baton,
+ apr_pool_t *pool)
{
/* Static 'cause we don't want it to be on the stack. */
static svn_delta_editor_t delta_editor = {
@@ -591,6 +591,7 @@ struct editor_baton
void *fetch_kind_baton;
struct operation root;
+ svn_boolean_t root_opened;
apr_hash_t *paths;
apr_pool_t *edit_pool;
@@ -742,6 +743,19 @@ build(struct editor_baton *eb,
return SVN_NO_ERROR;
}
+static svn_error_t *
+ensure_root_opened(struct editor_baton *eb)
+{
+ if (!eb->root_opened)
+ {
+ SVN_ERR(eb->deditor->open_root(eb->dedit_baton, SVN_INVALID_REVNUM,
+ eb->edit_pool, &eb->root.baton));
+ eb->root_opened = TRUE;
+ }
+
+ return SVN_NO_ERROR;
+}
+
/* This implements svn_editor_cb_add_directory_t */
static svn_error_t *
add_directory_cb(void *baton,
@@ -753,6 +767,8 @@ add_directory_cb(void *baton,
{
struct editor_baton *eb = baton;
+ SVN_ERR(ensure_root_opened(eb));
+
SVN_ERR(build(eb, ACTION_MKDIR, relpath, svn_kind_dir,
NULL, SVN_INVALID_REVNUM,
NULL, NULL, SVN_INVALID_REVNUM, scratch_pool));
@@ -774,6 +790,8 @@ add_file_cb(void *baton,
const char *tmp_filename;
svn_stream_t *tmp_stream;
+ SVN_ERR(ensure_root_opened(eb));
+
/* Spool the contents to a tempfile, and provide that to the driver. */
SVN_ERR(svn_stream_open_unique(&tmp_stream, &tmp_filename, NULL,
svn_io_file_del_on_pool_cleanup,
@@ -797,6 +815,10 @@ add_symlink_cb(void *baton,
svn_revnum_t replaces_rev,
apr_pool_t *scratch_pool)
{
+ struct editor_baton *eb = baton;
+
+ SVN_ERR(ensure_root_opened(eb));
+
return SVN_NO_ERROR;
}
@@ -808,6 +830,10 @@ add_absent_cb(void *baton,
svn_revnum_t replaces_rev,
apr_pool_t *scratch_pool)
{
+ struct editor_baton *eb = baton;
+
+ SVN_ERR(ensure_root_opened(eb));
+
return SVN_NO_ERROR;
}
@@ -822,6 +848,8 @@ set_props_cb(void *baton,
{
struct editor_baton *eb = baton;
+ SVN_ERR(ensure_root_opened(eb));
+
SVN_ERR(build(eb, ACTION_PROPSET, relpath, svn_kind_none,
NULL, SVN_INVALID_REVNUM,
props, NULL, SVN_INVALID_REVNUM, scratch_pool));
@@ -842,6 +870,8 @@ set_text_cb(void *baton,
const char *tmp_filename;
svn_stream_t *tmp_stream;
+ SVN_ERR(ensure_root_opened(eb));
+
/* Spool the contents to a tempfile, and provide that to the driver. */
SVN_ERR(svn_stream_open_unique(&tmp_stream, &tmp_filename, NULL,
svn_io_file_del_on_pool_cleanup,
@@ -864,6 +894,10 @@ set_target_cb(void *baton,
const char *target,
apr_pool_t *scratch_pool)
{
+ struct editor_baton *eb = baton;
+
+ SVN_ERR(ensure_root_opened(eb));
+
return SVN_NO_ERROR;
}
@@ -874,6 +908,10 @@ delete_cb(void *baton,
svn_revnum_t revision,
apr_pool_t *scratch_pool)
{
+ struct editor_baton *eb = baton;
+
+ SVN_ERR(ensure_root_opened(eb));
+
return SVN_NO_ERROR;
}
@@ -886,6 +924,10 @@ copy_cb(void *baton,
svn_revnum_t replaces_rev,
apr_pool_t *scratch_pool)
{
+ struct editor_baton *eb = baton;
+
+ SVN_ERR(ensure_root_opened(eb));
+
return SVN_NO_ERROR;
}
@@ -898,6 +940,10 @@ move_cb(void *baton,
svn_revnum_t replaces_rev,
apr_pool_t *scratch_pool)
{
+ struct editor_baton *eb = baton;
+
+ SVN_ERR(ensure_root_opened(eb));
+
return SVN_NO_ERROR;
}
@@ -966,9 +1012,6 @@ complete_cb(void *baton,
struct editor_baton *eb = baton;
svn_error_t *err;
- SVN_ERR(eb->deditor->open_root(eb->dedit_baton, SVN_INVALID_REVNUM,
- eb->edit_pool, &eb->root.baton));
-
/* Drive the tree we've created. */
err = drive(&eb->root, eb->deditor, scratch_pool);
if (!err)
@@ -990,8 +1033,6 @@ abort_cb(void *baton,
/* We still need to drive anything we collected in the editor to this
point. */
- SVN_ERR(eb->deditor->open_root(eb->dedit_baton, SVN_INVALID_REVNUM,
- eb->edit_pool, &eb->root.baton));
/* Drive the tree we've created. */
err = drive(&eb->root, eb->deditor, scratch_pool);
@@ -1009,16 +1050,16 @@ abort_cb(void *baton,
return svn_error_trace(err);
}
-svn_error_t *
-svn_editor_from_delta(svn_editor_t **editor_p,
- const svn_delta_editor_t *deditor,
- void *dedit_baton,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
- svn_delta_fetch_kind_func_t fetch_kind_func,
- void *fetch_kind_baton,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+static svn_error_t *
+editor_from_delta(svn_editor_t **editor_p,
+ const svn_delta_editor_t *deditor,
+ void *dedit_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ svn_delta_fetch_kind_func_t fetch_kind_func,
+ void *fetch_kind_baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_editor_t *editor;
static const svn_editor_cb_many_t editor_cbs = {
@@ -1051,6 +1092,8 @@ svn_editor_from_delta(svn_editor_t **edi
eb->root.props = NULL;
eb->root.copyfrom_revision = SVN_INVALID_REVNUM;
+ eb->root_opened = FALSE;
+
SVN_ERR(svn_editor_create(&editor, eb, cancel_func, cancel_baton,
result_pool, scratch_pool));
SVN_ERR(svn_editor_setcb_many(editor, &editor_cbs, scratch_pool));
@@ -1060,6 +1103,13 @@ svn_editor_from_delta(svn_editor_t **edi
return SVN_NO_ERROR;
}
+svn_delta_shim_callbacks_t *
+svn_delta_shim_callbacks_default(apr_pool_t *result_pool)
+{
+ svn_delta_shim_callbacks_t *shim_callbacks = apr_pcalloc(result_pool,
+ sizeof(*shim_callbacks));
+ return shim_callbacks;
+}
/* Uncomment below to add editor shims throughout Subversion. In it's
* current state, that will likely break The World. */
@@ -1070,10 +1120,7 @@ svn_editor__insert_shims(const svn_delta
void **dedit_baton_out,
const svn_delta_editor_t *deditor_in,
void *dedit_baton_in,
- svn_delta_fetch_props_func_t fetch_props_func,
- void *fetch_props_baton,
- svn_delta_fetch_kind_func_t fetch_kind_func,
- void *fetch_kind_baton,
+ svn_delta_shim_callbacks_t *shim_callbacks,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -1087,12 +1134,14 @@ svn_editor__insert_shims(const svn_delta
a lot of overhead. */
svn_editor_t *editor;
- SVN_ERR(svn_editor_from_delta(&editor, deditor_in, dedit_baton_in,
- NULL, NULL, fetch_kind_func, fetch_kind_baton,
- result_pool, scratch_pool));
- SVN_ERR(svn_delta_from_editor(deditor_out, dedit_baton_out, editor,
- fetch_props_func, fetch_props_baton,
- result_pool));
+ SVN_ERR(editor_from_delta(&editor, deditor_in, dedit_baton_in,
+ NULL, NULL, shim_callbacks->fetch_kind_func,
+ shim_callbacks->fetch_kind_baton,
+ result_pool, scratch_pool));
+ SVN_ERR(delta_from_editor(deditor_out, dedit_baton_out, editor,
+ shim_callbacks->fetch_props_func,
+ shim_callbacks->fetch_props_baton,
+ result_pool));
#endif
return SVN_NO_ERROR;
Modified: subversion/branches/showing-merge-info/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_fs/fs-loader.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_fs/fs-loader.c Tue Oct 25 15:37:42 2011
@@ -891,6 +891,21 @@ svn_fs_closest_copy(svn_fs_root_t **root
}
svn_error_t *
+svn_fs_get_mergeinfo2(svn_mergeinfo_catalog_t *catalog,
+ svn_fs_root_t *root,
+ const apr_array_header_t *paths,
+ svn_mergeinfo_inheritance_t inherit,
+ svn_boolean_t include_descendants,
+ svn_boolean_t adjust_inherited_mergeinfo,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ return svn_error_trace(root->vtable->get_mergeinfo(
+ catalog, root, paths, inherit, include_descendants,
+ adjust_inherited_mergeinfo, result_pool, scratch_pool));
+}
+
+svn_error_t *
svn_fs_get_mergeinfo(svn_mergeinfo_catalog_t *catalog,
svn_fs_root_t *root,
const apr_array_header_t *paths,
@@ -901,7 +916,7 @@ svn_fs_get_mergeinfo(svn_mergeinfo_catal
return svn_error_trace(root->vtable->get_mergeinfo(catalog, root, paths,
inherit,
include_descendants,
- pool));
+ TRUE, pool, pool));
}
svn_error_t *
Modified: subversion/branches/showing-merge-info/subversion/libsvn_fs/fs-loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_fs/fs-loader.h?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_fs/fs-loader.h Tue Oct 25 15:37:42 2011
@@ -333,7 +333,9 @@ typedef struct root_vtable_t
const apr_array_header_t *paths,
svn_mergeinfo_inheritance_t inherit,
svn_boolean_t include_descendants,
- apr_pool_t *pool);
+ svn_boolean_t adjust_inherited_mergeinfo,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
} root_vtable_t;
Modified: subversion/branches/showing-merge-info/subversion/libsvn_fs_base/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_fs_base/tree.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_fs_base/tree.c Tue Oct 25 15:37:42 2011
@@ -5142,6 +5142,7 @@ struct get_mergeinfo_for_path_baton
svn_fs_root_t *root;
const char *path;
svn_mergeinfo_inheritance_t inherit;
+ svn_boolean_t adjust_inherited_mergeinfo;
apr_pool_t *pool;
};
@@ -5237,7 +5238,7 @@ txn_body_get_mergeinfo_for_path(void *ba
can return the mergeinfo results directly. Otherwise, we're
inheriting the mergeinfo, so we need to a) remove non-inheritable
ranges and b) telescope the merged-from paths. */
- if (nearest_ancestor != parent_path)
+ if (args->adjust_inherited_mergeinfo && (nearest_ancestor != parent_path))
{
svn_mergeinfo_t tmp_mergeinfo;
@@ -5291,10 +5292,12 @@ get_mergeinfos_for_paths(svn_fs_root_t *
const apr_array_header_t *paths,
svn_mergeinfo_inheritance_t inherit,
svn_boolean_t include_descendants,
- apr_pool_t *pool)
+ svn_boolean_t adjust_inherited_mergeinfo,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
- svn_mergeinfo_catalog_t result_catalog = apr_hash_make(pool);
- apr_pool_t *iterpool = svn_pool_create(pool);
+ svn_mergeinfo_catalog_t result_catalog = apr_hash_make(result_pool);
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
int i;
for (i = 0; i < paths->nelts; i++)
@@ -5312,12 +5315,13 @@ get_mergeinfos_for_paths(svn_fs_root_t *
gmfp_args.root = root;
gmfp_args.path = path;
gmfp_args.inherit = inherit;
- gmfp_args.pool = pool;
+ gmfp_args.pool = result_pool;
+ gmfp_args.adjust_inherited_mergeinfo = adjust_inherited_mergeinfo;
SVN_ERR(svn_fs_base__retry_txn(root->fs,
txn_body_get_mergeinfo_for_path,
&gmfp_args, FALSE, iterpool));
if (path_mergeinfo)
- apr_hash_set(result_catalog, apr_pstrdup(pool, path),
+ apr_hash_set(result_catalog, apr_pstrdup(result_pool, path),
APR_HASH_KEY_STRING,
path_mergeinfo);
@@ -5363,7 +5367,9 @@ base_get_mergeinfo(svn_mergeinfo_catalog
const apr_array_header_t *paths,
svn_mergeinfo_inheritance_t inherit,
svn_boolean_t include_descendants,
- apr_pool_t *pool)
+ svn_boolean_t adjust_inherited_mergeinfo,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
/* Verify that our filesystem version supports mergeinfo stuff. */
SVN_ERR(svn_fs_base__test_required_feature_format
@@ -5376,7 +5382,8 @@ base_get_mergeinfo(svn_mergeinfo_catalog
/* Retrieve a path -> mergeinfo mapping. */
return get_mergeinfos_for_paths(root, catalog, paths,
inherit, include_descendants,
- pool);
+ adjust_inherited_mergeinfo,
+ result_pool, scratch_pool);
}
Modified: subversion/branches/showing-merge-info/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_fs_fs/tree.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_fs_fs/tree.c Tue Oct 25 15:37:42 2011
@@ -3463,6 +3463,7 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
svn_fs_root_t *rev_root,
const char *path,
svn_mergeinfo_inheritance_t inherit,
+ svn_boolean_t adjust_inherited_mergeinfo,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -3549,7 +3550,7 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
can return the mergeinfo results directly. Otherwise, we're
inheriting the mergeinfo, so we need to a) remove non-inheritable
ranges and b) telescope the merged-from paths. */
- if (nearest_ancestor != parent_path)
+ if (adjust_inherited_mergeinfo && (nearest_ancestor != parent_path))
{
svn_mergeinfo_t tmp_mergeinfo;
@@ -3604,10 +3605,12 @@ get_mergeinfos_for_paths(svn_fs_root_t *
const apr_array_header_t *paths,
svn_mergeinfo_inheritance_t inherit,
svn_boolean_t include_descendants,
- apr_pool_t *pool)
+ svn_boolean_t adjust_inherited_mergeinfo,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
- svn_mergeinfo_catalog_t result_catalog = apr_hash_make(pool);
- apr_pool_t *iterpool = svn_pool_create(pool);
+ svn_mergeinfo_catalog_t result_catalog = apr_hash_make(result_pool);
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
int i;
for (i = 0; i < paths->nelts; i++)
@@ -3619,7 +3622,8 @@ get_mergeinfos_for_paths(svn_fs_root_t *
svn_pool_clear(iterpool);
err = get_mergeinfo_for_path(&path_mergeinfo, root, path,
- inherit, pool, iterpool);
+ inherit, adjust_inherited_mergeinfo,
+ result_pool, iterpool);
if (err)
{
if (err->apr_err == SVN_ERR_MERGEINFO_PARSE_ERROR)
@@ -3638,8 +3642,8 @@ get_mergeinfos_for_paths(svn_fs_root_t *
apr_hash_set(result_catalog, path, APR_HASH_KEY_STRING,
path_mergeinfo);
if (include_descendants)
- SVN_ERR(add_descendant_mergeinfo(result_catalog, root, path, pool,
- iterpool));
+ SVN_ERR(add_descendant_mergeinfo(result_catalog, root, path,
+ result_pool, scratch_pool));
}
svn_pool_destroy(iterpool);
@@ -3655,7 +3659,9 @@ fs_get_mergeinfo(svn_mergeinfo_catalog_t
const apr_array_header_t *paths,
svn_mergeinfo_inheritance_t inherit,
svn_boolean_t include_descendants,
- apr_pool_t *pool)
+ svn_boolean_t adjust_inherited_mergeinfo,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
fs_fs_data_t *ffd = root->fs->fsap_data;
@@ -3674,7 +3680,9 @@ fs_get_mergeinfo(svn_mergeinfo_catalog_t
/* Retrieve a path -> mergeinfo hash mapping. */
return get_mergeinfos_for_paths(root, catalog, paths,
inherit,
- include_descendants, pool);
+ include_descendants,
+ adjust_inherited_mergeinfo,
+ result_pool, scratch_pool);
}
Modified: subversion/branches/showing-merge-info/subversion/libsvn_ra_neon/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_ra_neon/commit.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_ra_neon/commit.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_ra_neon/commit.c Tue Oct 25 15:37:42 2011
@@ -1572,6 +1572,8 @@ svn_error_t * svn_ra_neon__get_commit_ed
svn_delta_editor_t *commit_editor;
commit_ctx_t *cc;
apr_hash_index_t *hi;
+ svn_delta_shim_callbacks_t *shim_callbacks =
+ svn_delta_shim_callbacks_default(pool);
/* Build the main commit editor's baton. */
cc = apr_pcalloc(pool, sizeof(*cc));
@@ -1622,7 +1624,7 @@ svn_error_t * svn_ra_neon__get_commit_ed
*edit_baton = cc;
SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
- NULL, NULL, NULL, NULL, pool, pool));
+ shim_callbacks, pool, pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/showing-merge-info/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_ra_serf/commit.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_ra_serf/commit.c Tue Oct 25 15:37:42 2011
@@ -2320,6 +2320,8 @@ svn_ra_serf__get_commit_editor(svn_ra_se
svn_delta_editor_t *editor;
commit_context_t *ctx;
apr_hash_index_t *hi;
+ svn_delta_shim_callbacks_t *shim_callbacks =
+ svn_delta_shim_callbacks_default(pool);
ctx = apr_pcalloc(pool, sizeof(*ctx));
@@ -2367,8 +2369,7 @@ svn_ra_serf__get_commit_editor(svn_ra_se
*edit_baton = ctx;
SVN_ERR(svn_editor__insert_shims(ret_editor, edit_baton, *ret_editor,
- *edit_baton, NULL, NULL, NULL, NULL,
- pool, pool));
+ *edit_baton, shim_callbacks, pool, pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/showing-merge-info/subversion/libsvn_ra_svn/editorp.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_ra_svn/editorp.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_ra_svn/editorp.c Tue Oct 25 15:37:42 2011
@@ -408,6 +408,8 @@ void svn_ra_svn_get_editor(const svn_del
{
svn_delta_editor_t *ra_svn_editor = svn_delta_default_editor(pool);
ra_svn_edit_baton_t *eb;
+ svn_delta_shim_callbacks_t *shim_callbacks =
+ svn_delta_shim_callbacks_default(pool);
eb = apr_palloc(pool, sizeof(*eb));
eb->conn = conn;
@@ -437,8 +439,8 @@ void svn_ra_svn_get_editor(const svn_del
*edit_baton = eb;
svn_error_clear(svn_editor__insert_shims(editor, edit_baton, *editor,
- *edit_baton, NULL, NULL,
- NULL, NULL, pool, pool));
+ *edit_baton, shim_callbacks,
+ pool, pool));
}
/* --- DRIVING AN EDITOR --- */
Modified: subversion/branches/showing-merge-info/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_repos/commit.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_repos/commit.c Tue Oct 25 15:37:42 2011
@@ -802,6 +802,8 @@ svn_repos_get_commit_editor5(const svn_d
svn_delta_editor_t *e;
apr_pool_t *subpool = svn_pool_create(pool);
struct edit_baton *eb;
+ svn_delta_shim_callbacks_t *shim_callbacks =
+ svn_delta_shim_callbacks_default(pool);
/* Do a global authz access lookup. Users with no write access
whatsoever to the repository don't get a commit editor. */
@@ -854,7 +856,7 @@ svn_repos_get_commit_editor5(const svn_d
*editor = e;
SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
- NULL, NULL, NULL, NULL, pool, pool));
+ shim_callbacks, pool, pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/showing-merge-info/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_repos/dump.c?rev=1188722&r1=1188721&r2=1188722&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_repos/dump.c Tue Oct 25 15:37:42 2011
@@ -870,6 +870,8 @@ get_dump_editor(const svn_delta_editor_t
root baton. */
struct edit_baton *eb = apr_pcalloc(pool, sizeof(*eb));
svn_delta_editor_t *dump_editor = svn_delta_default_editor(pool);
+ svn_delta_shim_callbacks_t *shim_callbacks =
+ svn_delta_shim_callbacks_default(pool);
/* Set up the edit baton. */
eb->stream = stream;
@@ -897,7 +899,7 @@ get_dump_editor(const svn_delta_editor_t
*editor = dump_editor;
SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
- NULL, NULL, NULL, NULL, pool, pool));
+ shim_callbacks, pool, pool));
return SVN_NO_ERROR;
}