You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/10/21 21:07:54 UTC

svn commit: r1026105 - /subversion/trunk/subversion/libsvn_wc/merge.c

Author: stsp
Date: Thu Oct 21 19:07:54 2010
New Revision: 1026105

URL: http://svn.apache.org/viewvc?rev=1026105&view=rev
Log:
* subversion/libsvn_wc/merge.c
  (merge_text_file): Don't leak temporary file RESULT_TARGET.
   E.g. when a text conflict happened during an update, and the user
   chose 'theirs-full', a file containing the diff3 merge result with
   conflict markers was left over in .svn/tmp/ directory.

Found by: someone on the #svn IRC channel, some time ago

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

Modified: subversion/trunk/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/merge.c?rev=1026105&r1=1026104&r2=1026105&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/merge.c (original)
+++ subversion/trunk/subversion/libsvn_wc/merge.c Thu Oct 21 19:07:54 2010
@@ -1039,7 +1039,10 @@ merge_text_file(svn_skel_t **work_items,
         }
 
       if (*merge_outcome == svn_wc_merge_merged)
-        return SVN_NO_ERROR;
+        {
+          SVN_ERR(svn_io_remove_file2(result_target, TRUE, scratch_pool));
+          return SVN_NO_ERROR;
+        }
     }
   else if (contains_conflicts && dry_run)
       *merge_outcome = svn_wc_merge_conflict;
@@ -1078,6 +1081,8 @@ merge_text_file(svn_skel_t **work_items,
                                             result_pool, scratch_pool));
       *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
     }
+  else
+    SVN_ERR(svn_io_remove_file2(result_target, TRUE, scratch_pool));
 
   return SVN_NO_ERROR;
 }



Re: svn commit: r1026105 - /subversion/trunk/subversion/libsvn_wc/merge.c

Posted by Stefan Sperling <st...@elego.de>.
On Thu, Oct 21, 2010 at 11:09:59PM +0200, Erik Huelsmann wrote:
> Hi Stefan,
> 
> I see you're not on irc, so you may have missed it: This commit, or
> the next, turned the buildslaves red.

I don't have time to fix this quickly, so I've reverted this commit
in r1026270 for now. Thanks!

Stefan

Re: svn commit: r1026105 - /subversion/trunk/subversion/libsvn_wc/merge.c

Posted by Erik Huelsmann <eh...@gmail.com>.
Hi Stefan,

I see you're not on irc, so you may have missed it: This commit, or
the next, turned the buildslaves red.


Bye,

Erik.

On Thu, Oct 21, 2010 at 9:07 PM,  <st...@apache.org> wrote:
> Author: stsp
> Date: Thu Oct 21 19:07:54 2010
> New Revision: 1026105
>
> URL: http://svn.apache.org/viewvc?rev=1026105&view=rev
> Log:
> * subversion/libsvn_wc/merge.c
>  (merge_text_file): Don't leak temporary file RESULT_TARGET.
>   E.g. when a text conflict happened during an update, and the user
>   chose 'theirs-full', a file containing the diff3 merge result with
>   conflict markers was left over in .svn/tmp/ directory.
>
> Found by: someone on the #svn IRC channel, some time ago
>
> Modified:
>    subversion/trunk/subversion/libsvn_wc/merge.c
>
> Modified: subversion/trunk/subversion/libsvn_wc/merge.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/merge.c?rev=1026105&r1=1026104&r2=1026105&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_wc/merge.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/merge.c Thu Oct 21 19:07:54 2010
> @@ -1039,7 +1039,10 @@ merge_text_file(svn_skel_t **work_items,
>         }
>
>       if (*merge_outcome == svn_wc_merge_merged)
> -        return SVN_NO_ERROR;
> +        {
> +          SVN_ERR(svn_io_remove_file2(result_target, TRUE, scratch_pool));
> +          return SVN_NO_ERROR;
> +        }
>     }
>   else if (contains_conflicts && dry_run)
>       *merge_outcome = svn_wc_merge_conflict;
> @@ -1078,6 +1081,8 @@ merge_text_file(svn_skel_t **work_items,
>                                             result_pool, scratch_pool));
>       *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
>     }
> +  else
> +    SVN_ERR(svn_io_remove_file2(result_target, TRUE, scratch_pool));
>
>   return SVN_NO_ERROR;
>  }
>
>
>