Author: julianfoad
Date: Tue Oct 16 01:08:26 2012
New Revision: 1398597

URL: http://svn.apache.org/viewvc?rev=1398597&view=rev
Log:
Make the symmetric merge APIs public.

* subversion/include/private/svn_client_private.h
  (svn_client__symmetric_merge_t, svn_client__find_symmetric_merge,
   svn_client__find_symmetric_merge_no_wc, svn_client__do_symmetric_merge,
   svn_client__symmetric_merge_is_reintegrate_like): Move and rename to ...

* subversion/include/svn_client.h
  (svn_client_symmetric_merge_t, svn_client_find_symmetric_merge,
   svn_client_find_symmetric_merge_no_wc, svn_client_do_symmetric_merge,
   svn_client_symmetric_merge_is_reintegrate_like): ... here.

* subversion/libsvn_client/merge.c,
  subversion/svn/merge-cmd.c,
  subversion/svn/mergeinfo-cmd.c:
    Track the renames.

Modified:
    subversion/trunk/subversion/include/private/svn_client_private.h
    subversion/trunk/subversion/include/svn_client.h
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/svn/merge-cmd.c
    subversion/trunk/subversion/svn/mergeinfo-cmd.c

Modified: subversion/trunk/subversion/include/private/svn_client_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_client_private.h?rev=1398597&r1=1398596&r2=1398597&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_client_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_client_private.h Tue Oct 16 
01:08:26 2012
@@ -226,54 +226,6 @@ svn_client__wc_node_get_origin(svn_clien
                                apr_pool_t *result_pool,
                                apr_pool_t *scratch_pool);
 
-
-/* Details of a symmetric merge. */
-typedef struct svn_client__symmetric_merge_t svn_client__symmetric_merge_t;
-
-/* Find the information needed to merge all unmerged changes from a source
- * branch into a target branch.  The information is the locations of the
- * youngest common ancestor, merge base, and such like.
- *
- * Set *MERGE to the information needed to merge all unmerged changes
- * (up to SOURCE_REVISION) from the source branch SOURCE_PATH_OR_URL @
- * SOURCE_REVISION into the target WC at TARGET_WCPATH.
- */
-svn_error_t *
-svn_client__find_symmetric_merge(svn_client__symmetric_merge_t **merge,
-                                 const char *source_path_or_url,
-                                 const svn_opt_revision_t *source_revision,
-                                 const char *target_wcpath,
-                                 svn_boolean_t allow_mixed_rev,
-                                 svn_boolean_t allow_local_mods,
-                                 svn_boolean_t allow_switched_subtrees,
-                                 svn_client_ctx_t *ctx,
-                                 apr_pool_t *result_pool,
-                                 apr_pool_t *scratch_pool);
-
-/* Find out what kind of symmetric merge would be needed, when the target
- * is only known as a repository location rather than a WC.
- *
- * Like svn_client__find_symmetric_merge() except that SOURCE_PATH_OR_URL @
- * SOURCE_REVISION should refer to a repository location and not a WC.
- *
- * ### The result, *MERGE_P, may not be suitable for passing to
- * svn_client__do_symmetric_merge().  The target WC state would not be
- * checked (as in the ALLOW_* flags).  We should resolve this problem:
- * perhaps add the allow_* params here, or provide another way of setting
- * them; and perhaps ensure __do_...() will accept the result iff given a
- * WC that matches the stored target location.
- */
-svn_error_t *
-svn_client__find_symmetric_merge_no_wc(
-                                 svn_client__symmetric_merge_t **merge_p,
-                                 const char *source_path_or_url,
-                                 const svn_opt_revision_t *source_revision,
-                                 const char *target_path_or_url,
-                                 const svn_opt_revision_t *target_revision,
-                                 svn_client_ctx_t *ctx,
-                                 apr_pool_t *result_pool,
-                                 apr_pool_t *scratch_pool);
-
 /* Set *YCA, *BASE, *RIGHT, *TARGET to the repository locations of the
  * youngest common ancestor of the branches, the base chosen for 3-way
  * merge, the right-hand side of the source diff, and the target WC.
@@ -286,45 +238,9 @@ svn_client__symmetric_merge_get_location
                                 svn_client__pathrev_t **base,
                                 svn_client__pathrev_t **right,
                                 svn_client__pathrev_t **target,
-                                const svn_client__symmetric_merge_t *merge,
+                                const svn_client_symmetric_merge_t *merge,
                                 apr_pool_t *result_pool);
 
-/* Perform a symmetric merge.
- *
- * Merge according to MERGE into the WC at TARGET_WCPATH.
- *
- * The other parameters are as in svn_client_merge4().
- *
- * ### TODO: There's little point in this function being the only way the
- * caller can use the result of svn_client__find_symmetric_merge().  The
- * contents of MERGE should be more public, or there should be other ways
- * the caller can use it, or these two functions should be combined into
- * one.  I want to make it more public, and also possibly have more ways
- * to use it in future (for example, do_symmetric_merge_with_step_by_-
- * step_confirmation).
- */
-svn_error_t *
-svn_client__do_symmetric_merge(const svn_client__symmetric_merge_t *merge,
-                               const char *target_wcpath,
-                               svn_depth_t depth,
-                               svn_boolean_t force,
-                               svn_boolean_t record_only,
-                               svn_boolean_t dry_run,
-                               const apr_array_header_t *merge_options,
-                               svn_client_ctx_t *ctx,
-                               apr_pool_t *scratch_pool);
-
-/* Return TRUE iff the symmetric merge represented by MERGE is going to be
- * a reintegrate-like merge: that is, merging in the opposite direction
- * from the last full merge.
- *
- * This function exists because the merge is NOT really symmetric and the
- * client can be more friendly if it knows something about the differences.
- */
-svn_boolean_t
-svn_client__symmetric_merge_is_reintegrate_like(
-        const svn_client__symmetric_merge_t *merge);
-
 
 #ifdef __cplusplus
 }

Modified: subversion/trunk/subversion/include/svn_client.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1398597&r1=1398596&r2=1398597&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Tue Oct 16 01:08:26 2012
@@ -3373,6 +3373,90 @@ svn_client_diff_summarize_peg(const char
  * @{
  */
 
+/* Details of a symmetric merge. */
+typedef struct svn_client_symmetric_merge_t svn_client_symmetric_merge_t;
+
+/* Find the information needed to merge all unmerged changes from a source
+ * branch into a target branch.  The information is the locations of the
+ * youngest common ancestor, merge base, and such like.
+ *
+ * Set *MERGE to the information needed to merge all unmerged changes
+ * (up to SOURCE_REVISION) from the source branch SOURCE_PATH_OR_URL @
+ * SOURCE_REVISION into the target WC at TARGET_WCPATH.
+ */
+svn_error_t *
+svn_client_find_symmetric_merge(svn_client_symmetric_merge_t **merge,
+                                const char *source_path_or_url,
+                                const svn_opt_revision_t *source_revision,
+                                const char *target_wcpath,
+                                svn_boolean_t allow_mixed_rev,
+                                svn_boolean_t allow_local_mods,
+                                svn_boolean_t allow_switched_subtrees,
+                                svn_client_ctx_t *ctx,
+                                apr_pool_t *result_pool,
+                                apr_pool_t *scratch_pool);
+
+/* Find out what kind of symmetric merge would be needed, when the target
+ * is only known as a repository location rather than a WC.
+ *
+ * Like svn_client_find_symmetric_merge() except that SOURCE_PATH_OR_URL @
+ * SOURCE_REVISION should refer to a repository location and not a WC.
+ *
+ * ### The result, *MERGE_P, may not be suitable for passing to
+ * svn_client_do_symmetric_merge().  The target WC state would not be
+ * checked (as in the ALLOW_* flags).  We should resolve this problem:
+ * perhaps add the allow_* params here, or provide another way of setting
+ * them; and perhaps ensure __do_...() will accept the result iff given a
+ * WC that matches the stored target location.
+ */
+svn_error_t *
+svn_client_find_symmetric_merge_no_wc(
+                                 svn_client_symmetric_merge_t **merge_p,
+                                 const char *source_path_or_url,
+                                 const svn_opt_revision_t *source_revision,
+                                 const char *target_path_or_url,
+                                 const svn_opt_revision_t *target_revision,
+                                 svn_client_ctx_t *ctx,
+                                 apr_pool_t *result_pool,
+                                 apr_pool_t *scratch_pool);
+
+/* Perform a symmetric merge.
+ *
+ * Merge according to MERGE into the WC at TARGET_WCPATH.
+ *
+ * The other parameters are as in svn_client_merge4().
+ *
+ * ### TODO: There's little point in this function being the only way the
+ * caller can use the result of svn_client_find_symmetric_merge().  The
+ * contents of MERGE should be more public, or there should be other ways
+ * the caller can use it, or these two functions should be combined into
+ * one.  I want to make it more public, and also possibly have more ways
+ * to use it in future (for example, do_symmetric_merge_with_step_by_-
+ * step_confirmation).
+ */
+svn_error_t *
+svn_client_do_symmetric_merge(const svn_client_symmetric_merge_t *merge,
+                              const char *target_wcpath,
+                              svn_depth_t depth,
+                              svn_boolean_t force,
+                              svn_boolean_t record_only,
+                              svn_boolean_t dry_run,
+                              const apr_array_header_t *merge_options,
+                              svn_client_ctx_t *ctx,
+                              apr_pool_t *scratch_pool);
+
+/* Return TRUE iff the symmetric merge represented by MERGE is going to be
+ * a reintegrate-like merge: that is, merging in the opposite direction
+ * from the last full merge.
+ *
+ * This function exists because the merge is NOT really symmetric and the
+ * client can be more friendly if it knows something about the differences.
+ */
+svn_boolean_t
+svn_client_symmetric_merge_is_reintegrate_like(
+        const svn_client_symmetric_merge_t *merge);
+
+
 /** Merge changes from @a source1/@a revision1 to @a source2/@a revision2 into
  * the working-copy path @a target_wcpath.
  *

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1398597&r1=1398596&r2=1398597&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Tue Oct 16 01:08:26 2012
@@ -11401,7 +11401,7 @@ find_base_on_target(svn_client__pathrev_
   return SVN_NO_ERROR;
 }
 
-/* The body of svn_client__find_symmetric_merge(), which see.
+/* The body of svn_client_find_symmetric_merge(), which see.
  */
 static svn_error_t *
 find_symmetric_merge(svn_client__pathrev_t **base_p,
@@ -11482,15 +11482,15 @@ find_symmetric_merge(svn_client__pathrev
 }
 
 /* Details of a symmetric merge. */
-struct svn_client__symmetric_merge_t
+struct svn_client_symmetric_merge_t
 {
   svn_client__pathrev_t *yca, *base, *mid, *right, *target;
   svn_boolean_t allow_mixed_rev, allow_local_mods, allow_switched_subtrees;
 };
 
 svn_error_t *
-svn_client__find_symmetric_merge_no_wc(
-                                 svn_client__symmetric_merge_t **merge_p,
+svn_client_find_symmetric_merge_no_wc(
+                                 svn_client_symmetric_merge_t **merge_p,
                                  const char *source_path_or_url,
                                  const svn_opt_revision_t *source_revision,
                                  const char *target_path_or_url,
@@ -11501,7 +11501,7 @@ svn_client__find_symmetric_merge_no_wc(
 {
   source_and_target_t *s_t = apr_palloc(scratch_pool, sizeof(*s_t));
   svn_client__pathrev_t *target_loc;
-  svn_client__symmetric_merge_t *merge = apr_palloc(result_pool, 
sizeof(*merge));
+  svn_client_symmetric_merge_t *merge = apr_palloc(result_pool, 
sizeof(*merge));
 
   /* Source */
   SVN_ERR(svn_client__ra_session_from_path2(
@@ -11531,20 +11531,20 @@ svn_client__find_symmetric_merge_no_wc(
 }
 
 svn_error_t *
-svn_client__find_symmetric_merge(svn_client__symmetric_merge_t **merge_p,
-                                 const char *source_path_or_url,
-                                 const svn_opt_revision_t *source_revision,
-                                 const char *target_wcpath,
-                                 svn_boolean_t allow_mixed_rev,
-                                 svn_boolean_t allow_local_mods,
-                                 svn_boolean_t allow_switched_subtrees,
-                                 svn_client_ctx_t *ctx,
-                                 apr_pool_t *result_pool,
-                                 apr_pool_t *scratch_pool)
+svn_client_find_symmetric_merge(svn_client_symmetric_merge_t **merge_p,
+                                const char *source_path_or_url,
+                                const svn_opt_revision_t *source_revision,
+                                const char *target_wcpath,
+                                svn_boolean_t allow_mixed_rev,
+                                svn_boolean_t allow_local_mods,
+                                svn_boolean_t allow_switched_subtrees,
+                                svn_client_ctx_t *ctx,
+                                apr_pool_t *result_pool,
+                                apr_pool_t *scratch_pool)
 {
   const char *target_abspath;
   source_and_target_t *s_t = apr_palloc(result_pool, sizeof(*s_t));
-  svn_client__symmetric_merge_t *merge = apr_palloc(result_pool, 
sizeof(*merge));
+  svn_client_symmetric_merge_t *merge = apr_palloc(result_pool, 
sizeof(*merge));
 
   SVN_ERR(svn_dirent_get_absolute(&target_abspath, target_wcpath, 
scratch_pool));
 
@@ -11588,7 +11588,7 @@ svn_client__find_symmetric_merge(svn_cli
   return SVN_NO_ERROR;
 }
 
-/* The body of svn_client__do_symmetric_merge(), which see.
+/* The body of svn_client_do_symmetric_merge(), which see.
  *
  * Five locations are inputs: YCA, BASE, MID, RIGHT, TARGET, as shown
  * depending on whether the base is on the source branch or the target
@@ -11616,7 +11616,7 @@ svn_client__find_symmetric_merge(svn_cli
  * eliminate already-cherry-picked revisions from the source.
  */
 static svn_error_t *
-do_symmetric_merge_locked(const svn_client__symmetric_merge_t *merge,
+do_symmetric_merge_locked(const svn_client_symmetric_merge_t *merge,
                           const char *target_abspath,
                           svn_depth_t depth,
                           svn_boolean_t force,
@@ -11735,15 +11735,15 @@ do_symmetric_merge_locked(const svn_clie
 }
 
 svn_error_t *
-svn_client__do_symmetric_merge(const svn_client__symmetric_merge_t *merge,
-                               const char *target_wcpath,
-                               svn_depth_t depth,
-                               svn_boolean_t force,
-                               svn_boolean_t record_only,
-                               svn_boolean_t dry_run,
-                               const apr_array_header_t *merge_options,
-                               svn_client_ctx_t *ctx,
-                               apr_pool_t *pool)
+svn_client_do_symmetric_merge(const svn_client_symmetric_merge_t *merge,
+                              const char *target_wcpath,
+                              svn_depth_t depth,
+                              svn_boolean_t force,
+                              svn_boolean_t record_only,
+                              svn_boolean_t dry_run,
+                              const apr_array_header_t *merge_options,
+                              svn_client_ctx_t *ctx,
+                              apr_pool_t *pool)
 {
   const char *target_abspath, *lock_abspath;
 
@@ -11767,8 +11767,8 @@ svn_client__do_symmetric_merge(const svn
 }
 
 svn_boolean_t
-svn_client__symmetric_merge_is_reintegrate_like(
-        const svn_client__symmetric_merge_t *merge)
+svn_client_symmetric_merge_is_reintegrate_like(
+        const svn_client_symmetric_merge_t *merge)
 {
   return merge->mid != NULL;
 }
@@ -11779,7 +11779,7 @@ svn_client__symmetric_merge_get_location
                                 svn_client__pathrev_t **base,
                                 svn_client__pathrev_t **right,
                                 svn_client__pathrev_t **target,
-                                const svn_client__symmetric_merge_t *merge,
+                                const svn_client_symmetric_merge_t *merge,
                                 apr_pool_t *result_pool)
 {
   if (yca)

Modified: subversion/trunk/subversion/svn/merge-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/merge-cmd.c?rev=1398597&r1=1398596&r2=1398597&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/merge-cmd.c (original)
+++ subversion/trunk/subversion/svn/merge-cmd.c Tue Oct 16 01:08:26 2012
@@ -120,16 +120,16 @@ symmetric_merge(const char *source_path_
                 svn_client_ctx_t *ctx,
                 apr_pool_t *scratch_pool)
 {
-  svn_client__symmetric_merge_t *merge;
+  svn_client_symmetric_merge_t *merge;
 
   /* Find the 3-way merges needed (and check suitability of the WC). */
-  SVN_ERR(svn_client__find_symmetric_merge(&merge,
-                                           source_path_or_url, source_revision,
-                                           target_wcpath, allow_mixed_rev,
-                                           allow_local_mods, 
allow_switched_subtrees,
-                                           ctx, scratch_pool, scratch_pool));
+  SVN_ERR(svn_client_find_symmetric_merge(&merge,
+                                          source_path_or_url, source_revision,
+                                          target_wcpath, allow_mixed_rev,
+                                          allow_local_mods, 
allow_switched_subtrees,
+                                          ctx, scratch_pool, scratch_pool));
 
-  if (svn_client__symmetric_merge_is_reintegrate_like(merge))
+  if (svn_client_symmetric_merge_is_reintegrate_like(merge))
     {
       if (record_only)
         return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
@@ -157,10 +157,10 @@ symmetric_merge(const char *source_path_
     }
 
   /* Perform the 3-way merges */
-  SVN_ERR(svn_client__do_symmetric_merge(merge, target_wcpath, depth,
-                                         force, record_only,
-                                         dry_run, merge_options,
-                                         ctx, scratch_pool));
+  SVN_ERR(svn_client_do_symmetric_merge(merge, target_wcpath, depth,
+                                        force, record_only,
+                                        dry_run, merge_options,
+                                        ctx, scratch_pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/svn/mergeinfo-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/mergeinfo-cmd.c?rev=1398597&r1=1398596&r2=1398597&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/mergeinfo-cmd.c (original)
+++ subversion/trunk/subversion/svn/mergeinfo-cmd.c Tue Oct 16 01:08:26 2012
@@ -205,7 +205,7 @@ mergeinfo_summary(
                   svn_client_ctx_t *ctx,
                   apr_pool_t *pool)
 {
-  svn_client__symmetric_merge_t *the_merge;
+  svn_client_symmetric_merge_t *the_merge;
   svn_client__pathrev_t *yca, *base, *right, *target;
   svn_boolean_t target_is_wc, reintegrate_like;
 
@@ -213,14 +213,14 @@ mergeinfo_summary(
                  && (target_revision->kind == svn_opt_revision_unspecified
                      || target_revision->kind == svn_opt_revision_working);
   if (target_is_wc)
-    SVN_ERR(svn_client__find_symmetric_merge(
+    SVN_ERR(svn_client_find_symmetric_merge(
               &the_merge,
               source_path_or_url, source_revision,
               target_path_or_url,
               TRUE, TRUE, TRUE,  /* allow_* */
               ctx, pool, pool));
   else
-    SVN_ERR(svn_client__find_symmetric_merge_no_wc(
+    SVN_ERR(svn_client_find_symmetric_merge_no_wc(
               &the_merge,
               source_path_or_url, source_revision,
               target_path_or_url, target_revision,
@@ -228,7 +228,7 @@ mergeinfo_summary(
 
   SVN_ERR(svn_client__symmetric_merge_get_locations(
             &yca, &base, &right, &target, the_merge, pool));
-  reintegrate_like = 
svn_client__symmetric_merge_is_reintegrate_like(the_merge);
+  reintegrate_like = svn_client_symmetric_merge_is_reintegrate_like(the_merge);
 
   SVN_ERR(mergeinfo_diagram(yca, base, right, target,
                             target_is_wc, reintegrate_like,


Reply via email to