[prev in list] [next in list] [prev in thread] [next in thread] 

List:       subversion-cvs
Subject:    
From:       dlr () tigris ! org
Date:       2006-07-31 19:59:26
Message-ID: 20060731195926.DC09934C09F () svn ! collab ! net
[Download RAW message or body]

Author: dlr
Date: Mon Jul 31 12:59:26 2006
New Revision: 20921

Modified:
   branches/merge-tracking/subversion/libsvn_client/diff.c

Log:
On the merge-tracking branch: Refactor updating of merge info.

* subversion/libsvn_client/diff.c
  (update_wc_merge_info): Move call to parse_merge_info() inside this
   routine, since it's always necessary.  Update parameters and doc
   string accordingly.

  (do_merge, do_single_file_merge): Update for update_wc_merge_info()
   API change.

Suggested by: madanus


Modified: branches/merge-tracking/subversion/libsvn_client/diff.c
URL: http://svn.collab.net/viewvc/svn/branches/merge-tracking/subversion/libsvn_client/diff.c?pathrev=20921&r1=20920&r2=20921
 ==============================================================================
--- branches/merge-tracking/subversion/libsvn_client/diff.c	(original)
+++ branches/merge-tracking/subversion/libsvn_client/diff.c	Mon Jul 31 12:59:26 2006
@@ -1861,19 +1861,25 @@
   return SVN_NO_ERROR;
 }
 
-/* Calculate the new merge info for REL_PATH based on TARGET_MERGEINFO
-   and RANGES, and record it in the WC at TARGET_WCPATH.
-   TARGET_MERGEINFO is expected to be non-NULL. */
+/* Calculate the new merge info for REL_PATH based on the merge info
+   for TARGET_WCPATH and RANGES, and record it in the WC at
+   TARGET_WCPATH. */
 static svn_error_t *
-update_wc_merge_info(const char *target_wcpath, apr_hash_t *target_mergeinfo,
+update_wc_merge_info(const char *target_wcpath, const svn_wc_entry_t *entry,
                      const char *rel_path, apr_array_header_t *ranges,
                      svn_boolean_t is_revert, svn_wc_adm_access_t *adm_access,
-                     apr_pool_t *pool)
+                     svn_client_ctx_t *ctx, apr_pool_t *pool)
 {
   svn_string_t *mergeinfo_str = NULL;
-  apr_hash_t *mergeinfo = apr_hash_copy(pool, target_mergeinfo);
-  apr_array_header_t *rangelist = apr_hash_get(target_mergeinfo, rel_path,
-                                               APR_HASH_KEY_STRING);
+  apr_hash_t *mergeinfo;
+  apr_array_header_t *rangelist;
+
+  /* As some of the merges may've changed the WC's merge info, get a
+     fresh copy before using it to update the WC's merge info. */
+  SVN_ERR(parse_merge_info(&mergeinfo, entry, target_wcpath, adm_access,
+                           ctx, pool));
+
+  rangelist = apr_hash_get(mergeinfo, rel_path, APR_HASH_KEY_STRING);
   if (rangelist == NULL)
     rangelist = apr_array_make(pool, 0, sizeof(svn_merge_range_t *));
 
@@ -2115,14 +2121,9 @@
 
   if (!merge_b->dry_run && remaining_ranges->nelts > 0)
     {
-      /* As some of the above merges may've changed the WC's merge
-         info, refresh our copy before using it to update the WC's
-         merge info. */
-      SVN_ERR(parse_merge_info(&target_mergeinfo, entry, target_wcpath,
-                               adm_access, ctx, pool));
-      SVN_ERR(update_wc_merge_info(target_wcpath, target_mergeinfo, rel_path,
+      SVN_ERR(update_wc_merge_info(target_wcpath, entry, rel_path,
                                    remaining_ranges, is_revert, adm_access,
-                                   pool));
+                                   ctx, pool));
     }
 
   /* Sleep to ensure timestamp integrity. */
@@ -2319,14 +2320,9 @@
 
   if (!merge_b->dry_run && remaining_ranges->nelts > 0)
     {
-      /* As some of the above merges may've changed the WC's merge
-         info, refresh our copy before using it to update the WC's
-         merge info. */
-      SVN_ERR(parse_merge_info(&target_mergeinfo, entry, target_wcpath,
-                               adm_access, ctx, pool));
-      SVN_ERR(update_wc_merge_info(target_wcpath, target_mergeinfo, rel_path,
+      SVN_ERR(update_wc_merge_info(target_wcpath, entry, rel_path,
                                    remaining_ranges, is_revert, adm_access,
-                                   pool));
+                                   ctx, pool));
     }
 
   /* Sleep to ensure timestamp integrity. */

---------------------------------------------------------------------
To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
For additional commands, e-mail: svn-help@subversion.tigris.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic