You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2010/01/24 00:49:27 UTC
svn commit: r902509 [1/3] - in /subversion/trunk/subversion: include/
libsvn_client/ svn/ tests/cmdline/ tests/cmdline/svntest/
Author: pburba
Date: Sat Jan 23 23:49:26 2010
New Revision: 902509
URL: http://svn.apache.org/viewvc?rev=902509&view=rev
Log:
Produce notifications when mergeinfo is set to describe a merge or when
mergeinfo is elided.
See http://svn.haxx.se/dev/archive-2009-12/0224.shtml for discussion of
this enhancement.
* subversion/include/svn_wc.h
(svn_wc_notify_action_t): Add new svn_wc_notify_merge_record_info_begin
and svn_wc_notify_merge_elide_info notification actions.
* subversion/libsvn_client/copy.c
(extend_wc_mergeinfo): Update call to svn_client__record_wc_mergeinfo().
* subversion/libsvn_client/merge.c
(notification_receiver): Allow svn_wc_notify_merge_record_info_begin
notifications during a --record-only merge.
(update_wc_mergeinfo,
get_mergeinfo_paths,
process_children_with_new_mergeinfo):
Update call to svn_client__record_wc_mergeinfo().
(do_file_merge,
record_mergeinfo_for_dir_merge,
record_mergeinfo_for_added_subtrees): Start issuing
svn_wc_notify_merge_record_info_begin notifications, but with an option
to supress. Update calls to svn_client__record_wc_mergeinfo().
(do_directory_merge): Add argument to supress
svn_wc_notify_merge_record_info_begin notifications and pass it to
record_mergeinfo_for_dir_merge and record_mergeinfo_for_added_subtrees.
(do_merge): Add argument to supress svn_wc_notify_merge_record_info_begin
notifications and pass it to do_directory_merge() and do_file_merge().
(merge_cousins_and_supplement_mergeinfo): Update calls to do_merge() so a
svn_wc_notify_merge_record_info_begin notification is issued before
setting mergeinfo describing the merge.
(svn_client_merge3,
svn_client_merge_peg3): Update calls to do_merge().
* subversion/libsvn_client/mergeinfo.h
(svn_client__record_wc_mergeinfo): Add a parameter controlling whether
to do notifications or not.
(svn_client__mergeinfo_status): New.
* subversion/libsvn_client/mergeinfo.c
(svn_client__record_wc_mergeinfo): Implement new parameter.
(elide_mergeinfo): Issue a svn_wc_notify_merge_elide_info notification.
(svn_client__mergeinfo_status): New.
* subversion/svn/notify.c
(notify): Handle new svn_wc_notify_action_t's and existing but previously
unused svn_wc_notify_merge_record_info.
* subversion/tests/cmdline/svntest/actions.py
(verify_update): Handle expected and actual mergeinfo and elision
notification output.
(verify_disk,
run_and_verify_update,
run_and_verify_patch,
run_and_verify_switch): Update calls to verify_update, passing None for
expected and actual mergeinfo and elision notifications.
(run_and_verify_merge): Consolidate run_and_verify_merge2's parameters and
add parameters to support expected and actual mergeinfo and elision
notifications.
(run_and_verify_merge2): Remove...As part of this patch I had to update
pretty much every call to run_and_verify_merge2(), so it was only a
marginal effort to update the remaining run_and_verify_merge*.
(deep_trees_run_tests_scheme_for_merge): Update call to
run_and_verify_merge().
* subversion/tests/cmdline/svntest/main.py
(setup_development_mode): Remove run_and_verify_merge2().
(mergeinfo_notify_line): New.
* subversion/tests/cmdline/log_tests.py
* subversion/tests/cmdline/merge_authz_tests.py
* subversion/tests/cmdline/mergeinfo_tests.py
* subversion/tests/cmdline/resolve_tests.py
* subversion/tests/cmdline/resolved_tests.py
* subversion/tests/cmdline/revert_tests.py
* subversion/tests/cmdline/switch_tests.py
* subversion/tests/cmdline/update_tests.py
Replace calls to actions.run_and_verify_merge2() with
actions.run_and_verify_merge(). Update all calls to
actions.run_and_verify_merge() and expected_merge_output() to check for
appropriate mergeinfo notifications.
* subversion/tests/cmdline/merge_tests.py
As above, plus the following:
(expected_merge_output): Enable creation of merge output which includes
new mergeinfo notifications.
Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_client/copy.c
subversion/trunk/subversion/libsvn_client/merge.c
subversion/trunk/subversion/libsvn_client/mergeinfo.c
subversion/trunk/subversion/libsvn_client/mergeinfo.h
subversion/trunk/subversion/svn/notify.c
subversion/trunk/subversion/tests/cmdline/log_tests.py
subversion/trunk/subversion/tests/cmdline/merge_authz_tests.py
subversion/trunk/subversion/tests/cmdline/merge_tests.py
subversion/trunk/subversion/tests/cmdline/mergeinfo_tests.py
subversion/trunk/subversion/tests/cmdline/resolve_tests.py
subversion/trunk/subversion/tests/cmdline/resolved_tests.py
subversion/trunk/subversion/tests/cmdline/revert_tests.py
subversion/trunk/subversion/tests/cmdline/svntest/actions.py
subversion/trunk/subversion/tests/cmdline/svntest/main.py
subversion/trunk/subversion/tests/cmdline/switch_tests.py
subversion/trunk/subversion/tests/cmdline/update_tests.py
Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=902509&r1=902508&r2=902509&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Sat Jan 23 23:49:26 2010
@@ -1053,6 +1053,14 @@
* @since New in 1.7. */
svn_wc_notify_upgraded_path,
+ /** Mergeinfo describing a merge was recorded.
+ * @since New in 1.7. */
+ svn_wc_notify_merge_record_info_begin,
+
+ /** Mergeinfo was removed due to elision.
+ * @since New in 1.7. */
+ svn_wc_notify_merge_elide_info,
+
} svn_wc_notify_action_t;
Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=902509&r1=902508&r2=902509&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Sat Jan 23 23:49:26 2010
@@ -177,7 +177,7 @@
return svn_error_return(
svn_client__record_wc_mergeinfo(target_abspath, wc_mergeinfo,
- ctx, pool));
+ FALSE, ctx, pool));
}
/* Find the longest common ancestor of paths in COPY_PAIRS. If
Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=902509&r1=902508&r2=902509&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Sat Jan 23 23:49:26 2010
@@ -2600,11 +2600,12 @@
svn_boolean_t is_operative_notification = FALSE;
/* Skip notifications if this is a --record-only merge that is adding
- or deleting NOTIFY->PATH, allow only mergeinfo changes to be notified.
+ or deleting NOTIFY->PATH, allow only mergeinfo changes and headers.
We will already have skipped the actual addition or deletion, but will
- still get a notification callback for it.*/
+ still get a notification callback for it. */
if (notify_b->merge_b->record_only
- && notify->action != svn_wc_notify_update_update)
+ && (notify->action != svn_wc_notify_update_update
+ && notify->action != svn_wc_notify_merge_record_info_begin))
return;
/* Is the notification the result of a real operative merge? */
@@ -4385,7 +4386,7 @@
svn_mergeinfo__remove_empty_rangelists(mergeinfo, scratch_pool);
err = svn_client__record_wc_mergeinfo(local_abspath, mergeinfo,
- ctx, iterpool);
+ TRUE, ctx, iterpool);
if (err && err->apr_err == SVN_ERR_ENTRY_NOT_FOUND)
{
@@ -5640,7 +5641,7 @@
SVN_ERR(svn_client__record_wc_mergeinfo(
child_of_noninheritable->abspath, mergeinfo,
- merge_cmd_baton->ctx, iterpool));
+ FALSE, merge_cmd_baton->ctx, iterpool));
}
}
}
@@ -6256,6 +6257,7 @@
svn_revnum_t revision2,
const char *target_abspath,
svn_boolean_t sources_related,
+ svn_boolean_t squelch_mergeinfo_notifications,
notification_receiver_baton_t *notify_b,
merge_cmd_baton_t *merge_b,
apr_pool_t *scratch_pool)
@@ -6557,12 +6559,35 @@
if (indirect)
SVN_ERR(svn_client__record_wc_mergeinfo(target_abspath,
target_mergeinfo,
- ctx, subpool));
+ FALSE, ctx, subpool));
apr_hash_set(merges, target_abspath, APR_HASH_KEY_STRING,
filtered_rangelist);
+
+ if (!squelch_mergeinfo_notifications)
+ {
+ /* Notify that we are recording mergeinfo describing a merge. */
+ svn_wc_notify_t *notify = svn_wc_create_notify(
+ target_abspath, svn_wc_notify_merge_record_info_begin,
+ subpool);
+ svn_revnum_t youngest_rev;
+ svn_revnum_t oldest_rev;
+ SVN_ERR(svn_mergeinfo__get_range_endpoints(&youngest_rev,
+ &oldest_rev,
+ merges,
+ subpool));
+ notify->merge_range = apr_pcalloc(subpool,
+ sizeof(svn_merge_range_t *));
+ notify->merge_range->start = oldest_rev;
+ notify->merge_range->end = youngest_rev;
+ notify->merge_range->inheritable = TRUE;
+ merge_b->ctx->notify_func2(merge_b->ctx->notify_baton2,
+ notify, subpool);
+ }
+
SVN_ERR(update_wc_mergeinfo(target_abspath, mergeinfo_path,
- merges, is_rollback, ctx, subpool));
+ merges, is_rollback,
+ ctx, subpool));
}
}
@@ -6675,7 +6700,7 @@
SVN_ERR(svn_client__record_wc_mergeinfo(
abspath_with_new_mergeinfo,
path_explicit_mergeinfo,
- merge_b->ctx, iterpool));
+ FALSE, merge_b->ctx, iterpool));
}
/* If the path is not in NOTIFY_B->CHILDREN_WITH_MERGEINFO
@@ -6823,13 +6848,14 @@
be called if recording mergeinfo -- see doc string for
mergeinfo_behavior().
- DEPTH, NOTIFY_B, and MERGE_B are all cascaded from do_directory_merge's
- arguments of the same names.
+ DEPTH, NOTIFY_B, MERGE_B, and SQUELCH_MERGEINFO_NOTIFICATIONS are all
+ cascaded from do_directory_merge's arguments of the same names.
*/
static svn_error_t *
record_mergeinfo_for_dir_merge(const svn_merge_range_t *merged_range,
const char *mergeinfo_path,
svn_depth_t depth,
+ svn_boolean_t squelch_mergeinfo_notifications,
notification_receiver_baton_t *notify_b,
merge_cmd_baton_t *merge_b,
apr_pool_t *pool)
@@ -6914,7 +6940,7 @@
if (child->child_of_noninheritable)
{
SVN_ERR(svn_client__record_wc_mergeinfo(child->abspath,
- NULL,
+ NULL, FALSE,
merge_b->ctx,
iterpool));
}
@@ -6947,6 +6973,18 @@
if (child_merge_rangelist->nelts == 0)
continue;
+ if (!squelch_mergeinfo_notifications)
+ {
+ svn_wc_notify_t *notify = svn_wc_create_notify(
+ child->abspath,
+ svn_wc_notify_merge_record_info_begin,
+ iterpool);
+ notify->merge_range = svn_merge_range_dup(merged_range,
+ iterpool);
+ merge_b->ctx->notify_func2(merge_b->ctx->notify_baton2, notify,
+ iterpool);
+ }
+
/* If we are here we know we will be recording some mergeinfo, but
before we do set override mergeinfo on skipped paths so they
don't incorrectly inherit the mergeinfo we are about to set.
@@ -6977,7 +7015,7 @@
SVN_ERR(svn_client__record_wc_mergeinfo(
child->abspath,
child->pre_merge_mergeinfo,
- merge_b->ctx,
+ FALSE, merge_b->ctx,
iterpool));
if (merge_b->implicit_src_gap)
{
@@ -7059,16 +7097,18 @@
See also issue #2829
http://subversion.tigris.org/issues/show_bug.cgi?id=2829#desc14.
- DEPTH, NOTIFY_B and MERGE_B and are both cascaded from
- do_directory_merge's arguments of the same names.
+ DEPTH, NOTIFY_B, MERGE_B, and SQUELCH_MERGEINFO_NOTIFICATIONS, are
+ cascaded from do_directory_merge's arguments of the same names.
*/
static svn_error_t *
-record_mergeinfo_for_added_subtrees(svn_merge_range_t *merged_range,
- const char *mergeinfo_path,
- svn_depth_t depth,
- notification_receiver_baton_t *notify_b,
- merge_cmd_baton_t *merge_b,
- apr_pool_t *pool)
+record_mergeinfo_for_added_subtrees(
+ svn_merge_range_t *merged_range,
+ const char *mergeinfo_path,
+ svn_depth_t depth,
+ svn_boolean_t squelch_mergeinfo_notifications,
+ notification_receiver_baton_t *notify_b,
+ merge_cmd_baton_t *merge_b,
+ apr_pool_t *pool)
{
apr_pool_t *iterpool;
apr_hash_index_t *hi;
@@ -7151,9 +7191,9 @@
if (added_path_mergeinfo)
SVN_ERR(svn_mergeinfo_merge(merge_mergeinfo, added_path_mergeinfo,
iterpool));
- SVN_ERR(svn_client__record_wc_mergeinfo(added_abspath,
- merge_mergeinfo,
- merge_b->ctx, iterpool));
+ SVN_ERR(svn_client__record_wc_mergeinfo(
+ added_abspath, merge_mergeinfo,
+ !squelch_mergeinfo_notifications, merge_b->ctx, iterpool));
}
}
svn_pool_destroy(iterpool);
@@ -7487,6 +7527,12 @@
requirements around the values of URL1, REVISION1, URL2, and REVISION2
in this case).
+ If mergeinfo is being recorded, SQUELCH_MERGEINFO_NOTIFICATIONS is FALSE,
+ and MERGE_B->CTX->NOTIFY_FUNC2 is not NULL, then call
+ MERGE_B->CTX->NOTIFY_FUNC2 with MERGE_B->CTX->NOTIFY_BATON2 and a
+ svn_wc_notify_merge_record_info_begin notification before any mergeinfo
+ changes are made to describe the merge performed.
+
Handle DEPTH as documented for svn_client_merge3().
NOTE: This is a wrapper around drive_merge_report_editor() which
@@ -7501,6 +7547,7 @@
svn_revnum_t revision2,
const char *target_abspath,
svn_depth_t depth,
+ svn_boolean_t squelch_mergeinfo_notifications,
notification_receiver_baton_t *notify_b,
merge_cmd_baton_t *merge_b,
apr_pool_t *pool)
@@ -7771,6 +7818,7 @@
SVN_ERR(record_mergeinfo_for_dir_merge(&range,
mergeinfo_path,
depth,
+ squelch_mergeinfo_notifications,
notify_b,
merge_b,
pool));
@@ -7789,12 +7837,9 @@
So here we look at the root path of each subtree added during the
merge and set explicit mergeinfo on it if it meets the aforementioned
conditions. */
- SVN_ERR(record_mergeinfo_for_added_subtrees(&range,
- mergeinfo_path,
- depth,
- notify_b,
- merge_b,
- pool));
+ SVN_ERR(record_mergeinfo_for_added_subtrees(
+ &range, mergeinfo_path, depth, squelch_mergeinfo_notifications,
+ notify_b, merge_b, pool));
}
return svn_error_return(err);
@@ -7855,6 +7900,12 @@
repository as the one from which the target working copy has been
checked out.
+ If mergeinfo is being recorded, SQUELCH_MERGEINFO_NOTIFICATIONS is FALSE,
+ and CTX->NOTIFY_FUNC2 is not NULL, then call CTX->NOTIFY_FUNC2 with
+ CTX->NOTIFY_BATON2 and a svn_wc_notify_merge_record_info_begin
+ notification before any mergeinfo changes are made to describe the merge
+ performed.
+
FORCE, DRY_RUN, RECORD_ONLY, IGNORE_ANCESTRY, DEPTH, MERGE_OPTIONS,
and CTX are as described in the docstring for svn_client_merge_peg3().
@@ -7874,6 +7925,7 @@
svn_boolean_t dry_run,
svn_boolean_t record_only,
svn_boolean_t reintegrate_merge,
+ svn_boolean_t squelch_mergeinfo_notifications,
svn_depth_t depth,
const apr_array_header_t *merge_options,
svn_boolean_t *use_sleep,
@@ -8013,14 +8065,17 @@
if (target_kind == svn_node_file)
{
SVN_ERR(do_file_merge(url1, rev1, url2, rev2, target_abspath,
- sources_related, ¬ify_baton,
+ sources_related,
+ squelch_mergeinfo_notifications,
+ ¬ify_baton,
&merge_cmd_baton, subpool));
}
else if (target_kind == svn_node_dir)
{
SVN_ERR(do_directory_merge(url1, rev1, url2, rev2, target_abspath,
- depth, ¬ify_baton,
- &merge_cmd_baton, subpool));
+ depth, squelch_mergeinfo_notifications,
+ ¬ify_baton, &merge_cmd_baton,
+ subpool));
}
/* The final mergeinfo on TARGET_WCPATH may itself elide. */
@@ -8149,7 +8204,8 @@
SVN_ERR(do_merge(faux_sources, target_abspath,
FALSE, TRUE, same_repos,
ignore_ancestry, force, dry_run, FALSE, TRUE,
- depth, merge_options, use_sleep, ctx, pool));
+ FALSE, depth, merge_options, use_sleep, ctx,
+ pool));
}
else if (! same_repos)
{
@@ -8163,16 +8219,19 @@
calculated. (We know that each tong in our fork of our merge
source history tree has an ancestral relationship with the common
ancestral, so we force ancestral=TRUE here.) */
- if (same_repos)
+ if (same_repos && !dry_run)
{
+ svn_wc_notify_t *notify = svn_wc_create_notify(
+ target_abspath, svn_wc_notify_merge_record_info_begin, pool);
+ ctx->notify_func2(ctx->notify_baton2, notify, pool);
SVN_ERR(do_merge(add_sources, target_abspath,
TRUE, TRUE, same_repos,
ignore_ancestry, force, dry_run, TRUE, TRUE,
- depth, merge_options, use_sleep, ctx, pool));
+ TRUE, depth, merge_options, use_sleep, ctx, pool));
SVN_ERR(do_merge(remove_sources, target_abspath,
TRUE, TRUE, same_repos,
ignore_ancestry, force, dry_run, TRUE, TRUE,
- depth, merge_options, use_sleep, ctx, pool));
+ TRUE, depth, merge_options, use_sleep, ctx, pool));
}
return SVN_NO_ERROR;
@@ -8422,7 +8481,7 @@
err = do_merge(merge_sources, target_abspath,
ancestral, related, same_repos,
ignore_ancestry, force, dry_run,
- record_only, FALSE, depth, merge_options,
+ record_only, FALSE, FALSE, depth, merge_options,
&use_sleep, ctx, pool);
if (use_sleep)
@@ -9387,7 +9446,7 @@
sources are both ancestral and related.) */
err = do_merge(merge_sources, target_abspath,
TRUE, TRUE, same_repos, ignore_ancestry, force, dry_run,
- record_only, FALSE, depth, merge_options,
+ record_only, FALSE, FALSE, depth, merge_options,
&use_sleep, ctx, pool);
if (use_sleep)
Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.c?rev=902509&r1=902508&r2=902509&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.c Sat Jan 23 23:49:26 2010
@@ -91,10 +91,12 @@
svn_error_t *
svn_client__record_wc_mergeinfo(const char *local_abspath,
svn_mergeinfo_t mergeinfo,
+ svn_boolean_t do_notification,
svn_client_ctx_t *ctx,
apr_pool_t *scratch_pool)
{
svn_string_t *mergeinfo_str = NULL;
+ svn_boolean_t mergeinfo_changes = FALSE;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
@@ -102,6 +104,10 @@
if (mergeinfo)
SVN_ERR(svn_mergeinfo_to_string(&mergeinfo_str, mergeinfo, scratch_pool));
+ if (do_notification && ctx->notify_func2)
+ SVN_ERR(svn_client__mergeinfo_status(&mergeinfo_changes, ctx->wc_ctx,
+ local_abspath, scratch_pool));
+
/* Record the new mergeinfo in the WC. */
/* ### Later, we'll want behavior more analogous to
### svn_client__get_prop_from_wc(). */
@@ -109,13 +115,18 @@
mergeinfo_str, TRUE /* skip checks */, NULL, NULL,
scratch_pool));
- if (ctx->notify_func2)
+ if (do_notification && ctx->notify_func2)
{
- ctx->notify_func2(ctx->notify_baton2,
- svn_wc_create_notify(local_abspath,
- svn_wc_notify_merge_record_info,
- scratch_pool),
- scratch_pool);
+ svn_wc_notify_t *notify =
+ svn_wc_create_notify(local_abspath,
+ svn_wc_notify_merge_record_info,
+ scratch_pool);
+ if (mergeinfo_changes)
+ notify->prop_state = svn_wc_notify_state_merged;
+ else
+ notify->prop_state = svn_wc_notify_state_changed;
+
+ ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
}
return SVN_NO_ERROR;
@@ -853,9 +864,17 @@
svn_wc_create_notify(
svn_dirent_join_many(scratch_pool, local_abspath,
path_suffix, NULL),
- svn_wc_notify_merge_record_info, scratch_pool);
+ svn_wc_notify_merge_elide_info, scratch_pool);
ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
+ notify = svn_wc_create_notify(svn_dirent_join_many(scratch_pool,
+ local_abspath,
+ path_suffix,
+ NULL),
+ svn_wc_notify_update_update,
+ scratch_pool);
+ notify->prop_state = svn_wc_notify_state_changed;
+ ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
}
}
@@ -2122,3 +2141,30 @@
*suggestions = list;
return SVN_NO_ERROR;
}
+
+svn_error_t *
+svn_client__mergeinfo_status(svn_boolean_t *mergeinfo_changes,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool)
+{
+ apr_array_header_t *propchanges;
+ int i;
+
+ *mergeinfo_changes = FALSE;
+
+ SVN_ERR(svn_wc_get_prop_diffs2(&propchanges, NULL, wc_ctx,
+ local_abspath, scratch_pool, scratch_pool));
+
+ for (i = 0; i < propchanges->nelts; i++)
+ {
+ svn_prop_t prop = APR_ARRAY_IDX(propchanges, i, svn_prop_t);
+ if (strcmp(prop.name, SVN_PROP_MERGEINFO) == 0)
+ {
+ *mergeinfo_changes = TRUE;
+ break;
+ }
+ }
+
+ return SVN_NO_ERROR;
+}
Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.h?rev=902509&r1=902508&r2=902509&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.h Sat Jan 23 23:49:26 2010
@@ -274,13 +274,15 @@
/* Write MERGEINFO into the WC for LOCAL_ABSPATH. If MERGEINFO is NULL,
remove any SVN_PROP_MERGEINFO for LOCAL_ABSPATH. If MERGEINFO is empty,
record an empty property value (e.g. ""). If CTX->NOTIFY_FUNC2 is
- not null call it with notification type svn_wc_notify_merge_record_info.
+ not null call it with notification type svn_wc_notify_update_update
+ if DO_NOTIFICATION is true.
Use WC_CTX to access the working copy, and SCRATCH_POOL for any temporary
allocations. */
svn_error_t *
svn_client__record_wc_mergeinfo(const char *local_abspath,
svn_mergeinfo_t mergeinfo,
+ svn_boolean_t do_notification,
svn_client_ctx_t *ctx,
apr_pool_t *scratch_pool);
@@ -339,4 +341,12 @@
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 *
+svn_client__mergeinfo_status(svn_boolean_t *mergeinfo_changes,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool);
+
#endif /* SVN_LIBSVN_CLIENT_MERGEINFO_H */
Modified: subversion/trunk/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/notify.c?rev=902509&r1=902508&r2=902509&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/notify.c (original)
+++ subversion/trunk/subversion/svn/notify.c Sat Jan 23 23:49:26 2010
@@ -282,6 +282,7 @@
break;
case svn_wc_notify_update_update:
+ case svn_wc_notify_merge_record_info:
{
if (n->content_state == svn_wc_notify_state_conflicted)
{
@@ -583,6 +584,50 @@
goto print_error;
break;
+ case svn_wc_notify_merge_record_info_begin:
+ if (!n->merge_range)
+ {
+ err = svn_cmdline_printf(pool,
+ _("--- Recording mergeinfo for merge "
+ "between repository URLs into '%s':\n"),
+ path_local);
+ }
+ else
+ {
+ if (n->merge_range->start == n->merge_range->end - 1
+ || n->merge_range->start == n->merge_range->end)
+ err = svn_cmdline_printf(
+ pool,
+ _("--- Recording mergeinfo for merge of r%ld into '%s':\n"),
+ n->merge_range->end, path_local);
+ else if (n->merge_range->start - 1 == n->merge_range->end)
+ err = svn_cmdline_printf(
+ pool,
+ _("--- Recording mergeinfo for reverse merge of r%ld into '%s':\n"),
+ n->merge_range->start, path_local);
+ else if (n->merge_range->start < n->merge_range->end)
+ err = svn_cmdline_printf(
+ pool,
+ _("--- Recording mergeinfo for merge of r%ld through r%ld into '%s':\n"),
+ n->merge_range->start + 1, n->merge_range->end, path_local);
+ else /* n->merge_range->start > n->merge_range->end - 1 */
+ err = svn_cmdline_printf(
+ pool,
+ _("--- Recording mergeinfo for reverse merge of r%ld through r%ld into '%s':\n"),
+ n->merge_range->start, n->merge_range->end + 1, path_local);
+
+ if (err)
+ goto print_error;
+ }
+ break;
+
+ case svn_wc_notify_merge_elide_info:
+ if ((err = svn_cmdline_printf(pool,
+ _("--- Eliding mergeinfo from '%s':\n"),
+ path_local)))
+ goto print_error;
+ break;
+
case svn_wc_notify_foreign_merge_begin:
if (n->merge_range == NULL)
err = svn_cmdline_printf(pool,
Modified: subversion/trunk/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/log_tests.py?rev=902509&r1=902508&r2=902509&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/log_tests.py Sat Jan 23 23:49:26 2010
@@ -1472,6 +1472,11 @@
'G/rho' : Item(status='U '),
'H/omega' : Item(status='U '),
})
+ expected_mergeinfo_output = wc.State(D_COPY_path, {
+ '' : Item(status=' U'),
+ })
+ expected_elision_output = wc.State(D_COPY_path, {
+ })
expected_status = wc.State(D_COPY_path, {
'' : Item(status=' M', wc_rev=2),
'G' : Item(status=' ', wc_rev=2),
@@ -1498,8 +1503,10 @@
})
expected_skip = wc.State(D_COPY_path, { })
svntest.actions.run_and_verify_merge(D_COPY_path, None, None,
- sbox.repo_url + '/A/D',
+ sbox.repo_url + '/A/D', None,
expected_output,
+ expected_mergeinfo_output,
+ expected_elision_output,
expected_disk,
expected_status,
expected_skip,
@@ -1534,6 +1541,11 @@
expected_output = wc.State(H_COPY_path, {
'psi' : Item(status='U ')
})
+ expected_mergeinfo_output = wc.State(H_COPY_path, {
+ '' : Item(status=' G'),
+ })
+ expected_elision_output = wc.State(H_COPY_path, {
+ })
expected_status = wc.State(H_COPY_path, {
'' : Item(status=' M', wc_rev=7),
'psi' : Item(status='M ', wc_rev=7),
@@ -1548,8 +1560,11 @@
})
expected_skip = wc.State(H_COPY_path, { })
svntest.actions.run_and_verify_merge(H_COPY_path, '3', '2',
- sbox.repo_url + '/A/D/H',
- expected_output, expected_disk,
+ sbox.repo_url + '/A/D/H', None,
+ expected_output,
+ expected_mergeinfo_output,
+ expected_elision_output,
+ expected_disk,
expected_status, expected_skip,
None, None, None, None, None, 1)
Modified: subversion/trunk/subversion/tests/cmdline/merge_authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_authz_tests.py?rev=902509&r1=902508&r2=902509&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_authz_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_authz_tests.py Sat Jan 23 23:49:26 2010
@@ -139,6 +139,13 @@
'D/G/rho' : Item(status='U '),
'D/H/psi' : Item(status='U '),
})
+ expected_mergeinfo_output = wc.State(A_COPY_path, {
+ '' : Item(status=' U'),
+ 'B/E' : Item(status=' U'),
+ 'D/H/omega' : Item(status=' U'),
+ })
+ expected_elision_output = wc.State(A_COPY_path, {
+ })
expected_status = wc.State(A_COPY_path, {
'' : Item(status=' M', wc_rev=8),
'D/H/chi' : Item(status=' ', wc_rev=8),
@@ -189,9 +196,10 @@
})
saved_cwd = os.getcwd()
svntest.actions.run_and_verify_merge(A_COPY_path, '4', '8',
- sbox.repo_url + \
- '/A',
+ sbox.repo_url + '/A', None,
expected_output,
+ expected_mergeinfo_output,
+ expected_elision_output,
expected_disk,
expected_status,
expected_skip,
@@ -219,6 +227,15 @@
'D/G' : Item(status=' ', treeconflict='C'),
'D/H/omega' : Item(status='U '),
})
+ expected_mergeinfo_output = wc.State(A_COPY_2_path, {
+ '' : Item(status=' U'),
+ 'D' : Item(status=' U'),
+ 'D/H' : Item(status=' U'),
+ 'D/H/omega' : Item(status=' U'),
+ 'B/E' : Item(status=' U'),
+ })
+ expected_elision_output = wc.State(A_COPY_2_path, {
+ })
expected_status = wc.State(A_COPY_2_path, {
'' : Item(status=' M', wc_rev=8),
'D/G' : Item(status='! ', treeconflict='C'),
@@ -259,9 +276,10 @@
})
saved_cwd = os.getcwd()
svntest.actions.run_and_verify_merge(A_COPY_2_path, '4', '8',
- sbox.repo_url + \
- '/A',
+ sbox.repo_url + '/A', None,
expected_output,
+ expected_mergeinfo_output,
+ expected_elision_output,
expected_disk,
expected_status,
expected_skip,
@@ -278,6 +296,12 @@
expected_output = wc.State(A_COPY_3_path, {
'D/G/rho' : Item(status='U '),
})
+ expected_mergeinfo_output = wc.State(A_COPY_3_path, {
+ '' : Item(status=' U'),
+ 'B' : Item(status=' U'),
+ })
+ expected_elision_output = wc.State(A_COPY_3_path, {
+ })
expected_status = wc.State(A_COPY_3_path, {
'' : Item(status=' M', wc_rev=8),
'D/H/chi' : Item(status=' ', wc_rev=8),
@@ -317,9 +341,10 @@
expected_skip = wc.State(A_COPY_3_path, {'B/E' : Item()})
saved_cwd = os.getcwd()
svntest.actions.run_and_verify_merge(A_COPY_3_path, '5', '7',
- sbox.repo_url + \
- '/A',
+ sbox.repo_url + '/A', None,
expected_output,
+ expected_mergeinfo_output,
+ expected_elision_output,
expected_disk,
expected_status,
expected_skip,
@@ -338,6 +363,8 @@
expected_output = wc.State(A_COPY_2_H_path, {
'omega' : Item(status='U '),
})
+ expected_elision_output = wc.State(A_COPY_2_H_path, {
+ })
expected_status = wc.State(A_COPY_2_H_path, {
'' : Item(status=' M', wc_rev=8),
'chi' : Item(status=' ', wc_rev=8),
@@ -353,10 +380,16 @@
'psi' : Item(),
})
saved_cwd = os.getcwd()
+ # Note we don't bother checking expected mergeinfo output because the
+ # multiple merges being performed here, -c5 and -c8, will result in
+ # first ' U' and then ' G' mergeinfo notifications. Our expected
+ # tree structures can't handle checking for multiple values for the
+ # same key.
svntest.actions.run_and_verify_merge(A_COPY_2_H_path, '4', '5',
- sbox.repo_url + \
- '/A/D/H',
+ sbox.repo_url + '/A/D/H', None,
expected_output,
+ None, # expected_mergeinfo_output,
+ expected_elision_output,
expected_disk,
expected_status,
expected_skip,
@@ -387,6 +420,13 @@
'omega' : Item(status='U '),
'zeta' : Item(status='A '),
})
+ expected_mergeinfo_output = wc.State(A_COPY_2_H_path, {
+ '' : Item(status=' U'),
+ 'omega' : Item(status=' U'),
+ 'zeta' : Item(status=' U'),
+ })
+ expected_elision_output = wc.State(A_COPY_2_H_path, {
+ })
expected_status = wc.State(A_COPY_2_H_path, {
'' : Item(status=' M', wc_rev=8),
'chi' : Item(status=' ', wc_rev=8),
@@ -403,10 +443,12 @@
})
expected_skip = wc.State(A_COPY_2_H_path, {})
saved_cwd = os.getcwd()
+ #raise svntest.Failure("PTB")
svntest.actions.run_and_verify_merge(A_COPY_2_H_path, '7', '9',
- sbox.repo_url + \
- '/A/D/H',
+ sbox.repo_url + '/A/D/H', None,
expected_output,
+ expected_mergeinfo_output,
+ expected_elision_output,
expected_disk,
expected_status,
expected_skip,
@@ -507,11 +549,14 @@
expected_status,
None,
wc_dir, wc_dir)
- svntest.actions.run_and_verify_svn(None, expected_merge_output([[3,4]],
- 'U ' + Acopy_gamma_path + '\n'),
- [], 'merge', '-r1:4',
- A_url + '/D/gamma' + '@4',
- Acopy_gamma_path)
+ svntest.actions.run_and_verify_svn(
+ None,
+ expected_merge_output([[3,4]],
+ ['U ' + Acopy_gamma_path + '\n',
+ ' U ' + Acopy_gamma_path + '\n']),
+ [], 'merge', '-r1:4',
+ A_url + '/D/gamma' + '@4',
+ Acopy_gamma_path)
# r6: create an empty (unreadable) commit.
# Empty or unreadable revisions used to crash a svn 1.6+ client when
@@ -524,10 +569,13 @@
# A delete merged ontop of a modified file is normally a tree conflict,
# see notes/tree-conflicts/detection.txt, but --force currently avoids
# this.
- svntest.actions.run_and_verify_svn(None, expected_merge_output([[3,6]],
- ['D ' + Acopy_gamma_path + '\n']),
- [], 'merge', '-r1:6', '--force',
- A_url, Acopy_path)
+ svntest.actions.run_and_verify_svn(
+ None,
+ expected_merge_output([[3,6]],
+ ['D ' + Acopy_gamma_path + '\n',
+ ' U ' + Acopy_path + '\n']),
+ [], 'merge', '-r1:6', '--force',
+ A_url, Acopy_path)
########################################################################
# Run the tests