For issue #4874 "Avoid foreign repository merge if repository UUIDs match"

The initial fix in r1888474 made the ambiguous foreign merge cases
(different URL, same UUID) an error.

This patch makes the ambiguous foreign merge cases a warning in Subversion
1.15, and an error in Subversion >= 1.16.

This patch also restores a 1.14-compatible error code and error message for
the case of mismatched source URLs in a two-URL merge, in addition to the
new error which is more explicit.

Summary of issue #4874 changes since 1.14 up to and including this:

  - two-URL or pegged merge, ambiguous foreign repo (different URL, same UUID):
      1.14 silently do foreign-repo merge
      1.15 warn and do foreign-repo merge
      1.16 error
  - automatic or reintegrate merge, source-target URL mismatch:
      add a more explicit error
  - two-URL merge, source URLs mismatch:
      add a more explicit error

* subversion/libsvn_client/merge.c
  (WITH_AMBIGUOUS_FOREIGN_MERGE_WARNING,
   notify_pre_1_16_warning): New.
  (is_same_repos,
   check_same_repos): Add a caller-supplied message when returning an error.
  (svn_client__merge_locked): Add Subversion 1.14 compatibility to the error
    when source URLs are mismatched. Let the ambiguous foreign merge case be
    a warning in Subversion 1.15.
  (merge_peg_locked): Let the ambiguous foreign merge case be a warning in
    Subversion 1.15.
  (open_reintegrate_source_and_target,
   client_find_automatic_merge): Adjust calls.

* subversion/include/svn_wc.h
  (svn_wc_notify_action_t): Add a new notification action,
    'svn_wc_notify_warning'.

* subversion/svn/notify.c
  (notify_body): Handle the new notification: print the warning.

* subversion/tests/cmdline/merge_tests.py
  (merge_error_if_source_urls_differ): Look for the 1.14-compatible
    part of the error message, to verify compatibility.
  (merge_error_if_target_url_differs_and_same_uuid): Split into...
  (merge_error_if_ambiguous_foreign_merge,
   merge_error_if_source_target_url_mismatch): ... these two parts, and
    adjust to expect a warning (exit code 0) rather than an error for
    Subversion 1.15.
  (test_list): Run them.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1889012 13f79535-47bb-0310-9956-ffa450edef68
4 files changed