subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svn-r...@apache.org
Subject svn commit: r1367854 - in /subversion/branches/1.7.x: ./ STATUS subversion/libsvn_wc/merge.c
Date Wed, 01 Aug 2012 04:03:23 GMT
Author: svn-role
Date: Wed Aug  1 04:03:23 2012
New Revision: 1367854

URL: http://svn.apache.org/viewvc?rev=1367854&view=rev
Log:
Reintegrate the 1.7.x-r1361007 branch:

 * r1361007, r1361019
   Don't record references to files in the system temp directory from
   workqueue operations from the merge code.
   Justification:
     Removes cases where a ^C can break your workqueue, because the
     diff code removes the files referenced from the workqueue in its
     pool cleanup.
   Branch: ^/subversion/branches/1.7.x-r1361007
   Notes:
     Requires a branch because the merge code has been reworked for 1.8.
   Votes:
     +1: rhuijben, cmpilato, philip

Modified:
    subversion/branches/1.7.x/   (props changed)
    subversion/branches/1.7.x/STATUS
    subversion/branches/1.7.x/subversion/libsvn_wc/merge.c

Propchange: subversion/branches/1.7.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1361007,1361019
  Merged /subversion/branches/1.7.x-r1361007:r1361110-1367853

Modified: subversion/branches/1.7.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1367854&r1=1367853&r2=1367854&view=diff
==============================================================================
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Wed Aug  1 04:03:23 2012
@@ -81,19 +81,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1361007, r1361019
-   Don't record references to files in the system temp directory from
-   workqueue operations from the merge code.
-   Justification:
-     Removes cases where a ^C can break your workqueue, because the
-     diff code removes the files referenced from the workqueue in its
-     pool cleanup.
-   Branch: ^/subversion/branches/1.7.x-r1361007
-   Notes:
-     Requires a branch because the merge code has been reworked for 1.8.
-   Votes:
-     +1: rhuijben, cmpilato, philip
-
  * r1361341
    Avoid checking for working copies above the current working copy from
    svn_wc__acquire_write_lock() to avoid checking for .svn/wc.db in

Modified: subversion/branches/1.7.x/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_wc/merge.c?rev=1367854&r1=1367853&r2=1367854&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/libsvn_wc/merge.c (original)
+++ subversion/branches/1.7.x/subversion/libsvn_wc/merge.c Wed Aug  1 04:03:23 2012
@@ -940,6 +940,8 @@ merge_file_trivial(svn_skel_t **work_ite
                    const char *target_abspath,
                    svn_boolean_t dry_run,
                    svn_wc__db_t *db,
+                   svn_cancel_func_t cancel_func,
+                   void *cancel_baton,
                    apr_pool_t *result_pool,
                    apr_pool_t *scratch_pool)
 {
@@ -977,6 +979,41 @@ merge_file_trivial(svn_skel_t **work_ite
           *merge_outcome = svn_wc_merge_merged;
           if (!dry_run)
             {
+              const char *wcroot_abspath;
+              svn_boolean_t delete_src = FALSE;
+
+              /* The right_abspath might be outside our working copy. In that
+                 case we should copy the file to a safe location before
+                 installing to avoid breaking the workqueue */
+
+              SVN_ERR(svn_wc__db_get_wcroot(&wcroot_abspath,
+                                            db, target_abspath,
+                                            scratch_pool, scratch_pool));
+
+              if (!svn_dirent_is_child(wcroot_abspath, right_abspath, NULL))
+                {
+                  svn_stream_t *tmp_src;
+                  svn_stream_t *tmp_dst;
+
+                  SVN_ERR(svn_stream_open_readonly(&tmp_src, right_abspath,
+                                                   scratch_pool,
+                                                   scratch_pool));
+
+                  SVN_ERR(svn_wc__open_writable_base(&tmp_dst, &right_abspath,
+                                                     NULL, NULL,
+                                                     db, target_abspath,
+                                                     scratch_pool,
+                                                     scratch_pool));
+
+                  SVN_ERR(svn_stream_copy3(tmp_src, tmp_dst,
+                                           cancel_func, cancel_baton,
+                                           scratch_pool));
+
+                  /* no need to strdup right_abspath, as the wq_build_()
+                     call already does that for us */
+                  delete_src = TRUE;
+                }
+
               SVN_ERR(svn_wc__wq_build_file_install(
                         &work_item, db, target_abspath, right_abspath,
                         FALSE /* use_commit_times */,
@@ -984,6 +1021,15 @@ merge_file_trivial(svn_skel_t **work_ite
                         result_pool, scratch_pool));
               *work_items = svn_wc__wq_merge(*work_items, work_item,
                                              result_pool);
+
+              if (delete_src)
+                {
+                  SVN_ERR(svn_wc__wq_build_file_remove(
+                                    &work_item, db, right_abspath,
+                                    result_pool, scratch_pool));
+                  *work_items = svn_wc__wq_merge(*work_items, work_item,
+                                                 result_pool);
+                }
             }
         }
 
@@ -1418,6 +1464,7 @@ svn_wc__internal_merge(svn_skel_t **work
   SVN_ERR(merge_file_trivial(work_items, merge_outcome,
                              left_abspath, right_abspath,
                              target_abspath, dry_run, db,
+                             cancel_func, cancel_baton,
                              result_pool, scratch_pool));
   if (*merge_outcome == svn_wc_merge_no_merge)
     {



Mime
View raw message