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/12/05 16:11:40 UTC

svn commit: r1210492 - in /subversion/trunk/subversion: include/svn_client.h libsvn_client/merge.c

Author: julianfoad
Date: Mon Dec  5 15:11:40 2011
New Revision: 1210492

URL: http://svn.apache.org/viewvc?rev=1210492&view=rev
Log:
Rename parameters in some merge functions for clarity.

* subversion/include/svn_client.h
  (svn_client_merge_reintegrate, svn_client_merge_peg4): Rename 'source' to
    'source_path_or_url' and 'peg_revision' to 'source_peg_revision'.

* subversion/libsvn_client/merge.c
  (normalize_merge_sources_internal, normalize_merge_sources,
   merge_reintegrate_locked, svn_client_merge_reintegrate,
   svn_client_merge_peg4): Same and similar.
  (merge_peg_locked): Same, and put the two source parameters next to each
    other.

Modified:
    subversion/trunk/subversion/include/svn_client.h
    subversion/trunk/subversion/libsvn_client/merge.c

Modified: subversion/trunk/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1210492&r1=1210491&r2=1210492&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Mon Dec  5 15:11:40 2011
@@ -3437,12 +3437,12 @@ svn_client_merge(const char *source1,
 
 
 /**
- * Perform a reintegration merge of @a source at @a peg_revision
+ * Perform a reintegration merge of @a source_path_or_url at @a source_peg_revision
  * into @a target_wcpath.
  * @a target_wcpath must be a single-revision, #svn_depth_infinity,
  * pristine, unswitched working copy -- in other words, it must
  * reflect a single revision tree, the "target".  The mergeinfo on @a
- * source must reflect that all of the target has been merged into it.
+ * source_path_or_url must reflect that all of the target has been merged into it.
  * Then this behaves like a merge with svn_client_merge4() from the
  * target's URL to the source.
  *
@@ -3452,8 +3452,8 @@ svn_client_merge(const char *source1,
  * @since New in 1.5.
  */
 svn_error_t *
-svn_client_merge_reintegrate(const char *source,
-                             const svn_opt_revision_t *peg_revision,
+svn_client_merge_reintegrate(const char *source_path_or_url,
+                             const svn_opt_revision_t *source_peg_revision,
                              const char *target_wcpath,
                              svn_boolean_t dry_run,
                              const apr_array_header_t *merge_options,
@@ -3461,8 +3461,8 @@ svn_client_merge_reintegrate(const char 
                              apr_pool_t *pool);
 
 /**
- * Merge the changes between the filesystem object @a source in peg
- * revision @a peg_revision, as it changed between the ranges described
+ * Merge the changes between the filesystem object @a source_path_or_url in peg
+ * revision @a source_peg_revision, as it changed between the ranges described
  * in @a ranges_to_merge.
  *
  * @a ranges_to_merge is an array of <tt>svn_opt_revision_range_t
@@ -3478,9 +3478,9 @@ svn_client_merge_reintegrate(const char 
  * @since New in 1.7.
  */
 svn_error_t *
-svn_client_merge_peg4(const char *source,
+svn_client_merge_peg4(const char *source_path_or_url,
                       const apr_array_header_t *ranges_to_merge,
-                      const svn_opt_revision_t *peg_revision,
+                      const svn_opt_revision_t *source_peg_revision,
                       const char *target_wcpath,
                       svn_depth_t depth,
                       svn_boolean_t ignore_ancestry,

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1210492&r1=1210491&r2=1210492&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Mon Dec  5 15:11:40 2011
@@ -6380,13 +6380,13 @@ combine_range_with_segments(apr_array_he
 }
 
 /* Similar to normalize_merge_sources() but:
- * no SOURCE (path-or-URL) argument;
+ * no SOURCE_PATH_OR_URL argument;
  * MERGE_RANGE_TS (array of svn_merge_range_t *) instead of RANGES;
- * PEG_REVNUM instead of PEG_REVISION. */
+ * SOURCE_PEG_REVNUM instead of SOURCE_PEG_REVISION. */
 static svn_error_t *
 normalize_merge_sources_internal(apr_array_header_t **merge_sources_p,
                                  const char *source_url,
-                                 svn_revnum_t peg_revnum,
+                                 svn_revnum_t source_peg_revnum,
                                  const apr_array_header_t *merge_range_ts,
                                  svn_ra_session_t *ra_session,
                                  svn_client_ctx_t *ctx,
@@ -6415,21 +6415,22 @@ normalize_merge_sources_internal(apr_arr
      we'll just verify that the source in the peg revision is related
      to the the source in the youngest requested revision (which is
      all the underlying APIs would do in this case right now anyway). */
-  if (peg_revnum < youngest_requested)
+  if (source_peg_revnum < youngest_requested)
     {
       const char *start_url;
 
       SVN_ERR(svn_client__repos_location(&start_url,
-                                         ra_session, source_url, peg_revnum,
+                                         ra_session, source_url,
+                                         source_peg_revnum,
                                          youngest_requested,
                                          ctx, scratch_pool, scratch_pool));
-      peg_revnum = youngest_requested;
+      source_peg_revnum = youngest_requested;
     }
 
   /* Fetch the locations for our merge range span. */
   SVN_ERR(svn_client__repos_location_segments(&segments,
                                               ra_session, "",
-                                              peg_revnum,
+                                              source_peg_revnum,
                                               youngest_requested,
                                               oldest_requested,
                                               ctx, result_pool));
@@ -6544,15 +6545,15 @@ normalize_merge_sources_internal(apr_arr
    holding the paths and revisions needed to fully describe a range of
    requested merges; order the objects from oldest to youngest.
 
-   Determine the requested merges by examining SOURCE (and its
-   associated URL, SOURCE_URL) and PEG_REVISION (which specifies the
+   Determine the requested merges by examining SOURCE_PATH_OR_URL (and its
+   associated URL, SOURCE_URL) and SOURCE_PEG_REVISION (which specifies the
    line of history from which merges will be pulled) and
    RANGES_TO_MERGE (a list of svn_opt_revision_range_t's which provide
-   revision ranges).  Note that SOURCE may itself be either a working
-   copy path or a URL; in the latter case, SOURCE_URL is probably
-   identical to SOURCE.
+   revision ranges).  Note that SOURCE_PATH_OR_URL may itself be either a
+   working copy path or a URL; in the latter case, SOURCE_URL is probably
+   identical to SOURCE_PATH_OR_URL.
 
-   If PEG_REVISION is unspecified, treat that it as HEAD.
+   If SOURCE_PEG_REVISION is unspecified, treat that it as HEAD.
 
    Use RA_SESSION -- whose session URL matches SOURCE_URL -- to answer
    historical questions.
@@ -6567,9 +6568,9 @@ normalize_merge_sources_internal(apr_arr
 */
 static svn_error_t *
 normalize_merge_sources(apr_array_header_t **merge_sources_p,
-                        const char *source,
+                        const char *source_path_or_url,
                         const char *source_url,
-                        const svn_opt_revision_t *peg_revision,
+                        const svn_opt_revision_t *source_peg_revision,
                         const apr_array_header_t *ranges_to_merge,
                         svn_ra_session_t *ra_session,
                         svn_client_ctx_t *ctx,
@@ -6577,25 +6578,25 @@ normalize_merge_sources(apr_array_header
                         apr_pool_t *scratch_pool)
 {
   const char *source_abspath_or_url;
-  svn_revnum_t peg_revnum;
+  svn_revnum_t source_peg_revnum;
   svn_revnum_t youngest_rev = SVN_INVALID_REVNUM;
   apr_array_header_t *merge_range_ts;
   int i;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
-  if(!svn_path_is_url(source))
-    SVN_ERR(svn_dirent_get_absolute(&source_abspath_or_url, source,
+  if(!svn_path_is_url(source_path_or_url))
+    SVN_ERR(svn_dirent_get_absolute(&source_abspath_or_url, source_path_or_url,
                                     scratch_pool));
   else
-    source_abspath_or_url = source;
+    source_abspath_or_url = source_path_or_url;
 
-  /* Resolve our PEG_REVISION to a real number. */
-  SVN_ERR(svn_client__get_revision_number(&peg_revnum, &youngest_rev,
+  /* Resolve our SOURCE_PEG_REVISION to a real number. */
+  SVN_ERR(svn_client__get_revision_number(&source_peg_revnum, &youngest_rev,
                                           ctx->wc_ctx,
                                           source_abspath_or_url,
-                                          ra_session, peg_revision,
+                                          ra_session, source_peg_revision,
                                           iterpool));
-  if (! SVN_IS_VALID_REVNUM(peg_revnum))
+  if (! SVN_IS_VALID_REVNUM(source_peg_revnum))
     return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL, NULL);
 
   /* Create a list to hold svn_merge_range_t's. */
@@ -6638,7 +6639,7 @@ normalize_merge_sources(apr_array_header
     }
 
   SVN_ERR(normalize_merge_sources_internal(
-            merge_sources_p, source_url, peg_revnum,
+            merge_sources_p, source_url, source_peg_revnum,
             merge_range_ts, ra_session, ctx, result_pool, scratch_pool));
 
   svn_pool_destroy(iterpool);
@@ -10475,8 +10476,8 @@ calculate_left_hand_side(const char **ur
 }
 
 static svn_error_t *
-merge_reintegrate_locked(const char *source,
-                         const svn_opt_revision_t *peg_revision,
+merge_reintegrate_locked(const char *source_path_or_url,
+                         const svn_opt_revision_t *source_peg_revision,
                          const char *target_abspath,
                          svn_boolean_t dry_run,
                          const apr_array_header_t *merge_options,
@@ -10509,12 +10510,13 @@ merge_reintegrate_locked(const char *sou
                                                     scratch_pool));
 
   /* Make sure we're dealing with a real URL. */
-  SVN_ERR(svn_client_url_from_path2(&url2, source, ctx,
+  SVN_ERR(svn_client_url_from_path2(&url2, source_path_or_url, ctx,
                                     scratch_pool, scratch_pool));
   if (! url2)
     return svn_error_createf(SVN_ERR_ENTRY_MISSING_URL, NULL,
                              _("'%s' has no URL"),
-                             svn_dirent_local_style(source, scratch_pool));
+                             svn_dirent_local_style(source_path_or_url,
+                                                    scratch_pool));
 
   /* Determine the working copy target's repository root URL. */
   SVN_ERR(svn_client_get_repos_root(&wc_repos_root.url, &wc_repos_root.uuid,
@@ -10529,7 +10531,8 @@ merge_reintegrate_locked(const char *sou
   /* source_repos_root and wc_repos_root are required to be the same,
      as mergeinfo doesn't come into play for cross-repository merging. */
   SVN_ERR(check_same_repos(&source_repos_root,
-                           svn_dirent_local_style(source, scratch_pool),
+                           svn_dirent_local_style(source_path_or_url,
+                                                  scratch_pool),
                            &wc_repos_root,
                            svn_dirent_local_style(target_abspath, scratch_pool),
                            TRUE /* strict_urls */, scratch_pool));
@@ -10574,8 +10577,8 @@ merge_reintegrate_locked(const char *sou
 
   /* Open two RA sessions, one to our source and one to our target. */
   SVN_ERR(svn_client__ra_session_from_path(&source_ra_session, &rev2, &url2,
-                                           url2, NULL, peg_revision,
-                                           peg_revision,
+                                           url2, NULL, source_peg_revision,
+                                           source_peg_revision,
                                            ctx, scratch_pool));
   SVN_ERR(svn_wc__node_get_url(&target_url, ctx->wc_ctx, target_abspath,
                                scratch_pool, scratch_pool));
@@ -10689,8 +10692,8 @@ merge_reintegrate_locked(const char *sou
 }
 
 svn_error_t *
-svn_client_merge_reintegrate(const char *source,
-                             const svn_opt_revision_t *peg_revision,
+svn_client_merge_reintegrate(const char *source_path_or_url,
+                             const svn_opt_revision_t *source_peg_revision,
                              const char *target_wcpath,
                              svn_boolean_t dry_run,
                              const apr_array_header_t *merge_options,
@@ -10704,11 +10707,13 @@ svn_client_merge_reintegrate(const char 
 
   if (!dry_run)
     SVN_WC__CALL_WITH_WRITE_LOCK(
-      merge_reintegrate_locked(source, peg_revision, target_abspath,
+      merge_reintegrate_locked(source_path_or_url, source_peg_revision,
+                               target_abspath,
                                dry_run, merge_options, ctx, pool),
       ctx->wc_ctx, lock_abspath, FALSE /* lock_anchor */, pool);
   else
-    SVN_ERR(merge_reintegrate_locked(source, peg_revision, target_abspath,
+    SVN_ERR(merge_reintegrate_locked(source_path_or_url, source_peg_revision,
+                                     target_abspath,
                                      dry_run, merge_options, ctx, pool));
 
   return SVN_NO_ERROR;
@@ -10716,9 +10721,9 @@ svn_client_merge_reintegrate(const char 
 
 
 static svn_error_t *
-merge_peg_locked(const char *source,
+merge_peg_locked(const char *source_path_or_url,
+                 const svn_opt_revision_t *source_peg_revision,
                  const apr_array_header_t *ranges_to_merge,
-                 const svn_opt_revision_t *peg_revision,
                  const char *target_abspath,
                  svn_depth_t depth,
                  svn_boolean_t ignore_ancestry,
@@ -10751,12 +10756,13 @@ merge_peg_locked(const char *source,
                                                     scratch_pool));
 
   /* Make sure we're dealing with a real URL. */
-  SVN_ERR(svn_client_url_from_path2(&URL, source, ctx,
+  SVN_ERR(svn_client_url_from_path2(&URL, source_path_or_url, ctx,
                                     scratch_pool, scratch_pool));
   if (! URL)
     return svn_error_createf(SVN_ERR_ENTRY_MISSING_URL, NULL,
                              _("'%s' has no URL"),
-                             svn_dirent_local_style(source, scratch_pool));
+                             svn_dirent_local_style(source_path_or_url,
+                                                    scratch_pool));
 
   SVN_ERR(svn_wc_read_kind(&target_kind, ctx->wc_ctx, target_abspath, FALSE,
                            scratch_pool));
@@ -10784,7 +10790,8 @@ merge_peg_locked(const char *source,
   SVN_ERR(svn_ra_get_uuid2(ra_session, &source_repos_root.uuid, scratch_pool));
 
   /* Normalize our merge sources. */
-  SVN_ERR(normalize_merge_sources(&merge_sources, source, URL, peg_revision,
+  SVN_ERR(normalize_merge_sources(&merge_sources,
+                                  source_path_or_url, URL, source_peg_revision,
                                   ranges_to_merge, ra_session, ctx,
                                   scratch_pool, scratch_pool));
 
@@ -10812,9 +10819,9 @@ merge_peg_locked(const char *source,
 }
 
 svn_error_t *
-svn_client_merge_peg4(const char *source,
+svn_client_merge_peg4(const char *source_path_or_url,
                       const apr_array_header_t *ranges_to_merge,
-                      const svn_opt_revision_t *peg_revision,
+                      const svn_opt_revision_t *source_peg_revision,
                       const char *target_wcpath,
                       svn_depth_t depth,
                       svn_boolean_t ignore_ancestry,
@@ -10837,13 +10844,15 @@ svn_client_merge_peg4(const char *source
 
   if (!dry_run)
     SVN_WC__CALL_WITH_WRITE_LOCK(
-      merge_peg_locked(source, ranges_to_merge, peg_revision,
+      merge_peg_locked(source_path_or_url, source_peg_revision,
+                       ranges_to_merge,
                        target_abspath, depth, ignore_ancestry,
                        force, record_only, dry_run,
                        allow_mixed_rev, merge_options, ctx, pool),
       ctx->wc_ctx, lock_abspath, FALSE /* lock_anchor */, pool);
   else
-    SVN_ERR(merge_peg_locked(source, ranges_to_merge, peg_revision,
+    SVN_ERR(merge_peg_locked(source_path_or_url, source_peg_revision,
+                       ranges_to_merge,
                        target_abspath, depth, ignore_ancestry,
                        force, record_only, dry_run,
                        allow_mixed_rev, merge_options, ctx, pool));