subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbu...@apache.org
Subject svn commit: r1163792 - /subversion/trunk/subversion/libsvn_client/merge.c
Date Wed, 31 Aug 2011 20:20:08 GMT
Author: pburba
Date: Wed Aug 31 20:20:07 2011
New Revision: 1163792

URL: http://svn.apache.org/viewvc?rev=1163792&view=rev
Log:
Follow-up to issue #3975 fixes made in r1160756: Catch and clear a possible
error.

* subversion/libsvn_client/merge.c

  (record_mergeinfo_for_dir_merge): Subtrees of the merge source may have
   been deleted, the issue #3975 fixes must tolerate this -- see
   http://subversion.tigris.org/issues/show_bug.cgi?id=3975#desc6

Modified:
    subversion/trunk/subversion/libsvn_client/merge.c

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1163792&r1=1163791&r2=1163792&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Wed Aug 31 20:20:07 2011
@@ -7941,6 +7941,7 @@ record_mergeinfo_for_dir_merge(svn_merge
           if ((!merge_b->record_only || merge_b->reintegrate_merge)
               && (!is_rollback))
             {
+              svn_error_t *err;
               svn_opt_revision_t peg_revision;
               svn_mergeinfo_t subtree_history_as_mergeinfo;
               apr_array_header_t *child_merge_src_rangelist;
@@ -7963,26 +7964,40 @@ record_mergeinfo_for_dir_merge(svn_merge
                                                         merge_b->ra_session2,
                                                         subtree_mergeinfo_url,
                                                         iterpool));
-              SVN_ERR(svn_client__get_history_as_mergeinfo(
+              err = svn_client__get_history_as_mergeinfo(
                 &subtree_history_as_mergeinfo, NULL,
                 subtree_mergeinfo_url, &peg_revision,
                 merged_range->end,
                 merged_range->start,
-                merge_b->ra_session2, merge_b->ctx, iterpool));
+                merge_b->ra_session2, merge_b->ctx, iterpool);
+
+              /* If CHILD is a subtree it may have been deleted prior to
+                 MERGED_RANGE->END so the above call to get its history
+                 will fail. */
+              if (err)
+                {
+                  if (err->apr_err != SVN_ERR_FS_NOT_FOUND)
+                      return svn_error_trace(err);
+                  svn_error_clear(err);
+                }
+              else
+                {
+                  child_merge_src_rangelist = apr_hash_get(
+                    subtree_history_as_mergeinfo,
+                    child_merge_src_canon_path,
+                    APR_HASH_KEY_STRING);
+                  SVN_ERR(svn_rangelist_intersect(&child_merge_rangelist,
+                                                  child_merge_rangelist,
+                                                  child_merge_src_rangelist,
+                                                  FALSE, iterpool));
+                  if (!rangelist_inheritance)
+                    svn_rangelist__set_inheritance(child_merge_rangelist,
+                                                   FALSE);
+                }
 
               if (old_session_url)
                 SVN_ERR(svn_ra_reparent(merge_b->ra_session2,
                                         old_session_url, iterpool));
-              child_merge_src_rangelist = apr_hash_get(
-                subtree_history_as_mergeinfo,
-                child_merge_src_canon_path,
-                APR_HASH_KEY_STRING);
-              SVN_ERR(svn_rangelist_intersect(&child_merge_rangelist,
-                                              child_merge_rangelist,
-                                              child_merge_src_rangelist,
-                                              FALSE, iterpool));
-              if (!rangelist_inheritance)
-                svn_rangelist__set_inheritance(child_merge_rangelist, FALSE);
             }
 
           apr_hash_set(child_merges, child->abspath, APR_HASH_KEY_STRING,



Mime
View raw message