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 2012/09/11 13:06:47 UTC
svn commit: r1383353 - /subversion/trunk/subversion/svn/file-merge.c
Author: stsp
Date: Tue Sep 11 11:06:47 2012
New Revision: 1383353
URL: http://svn.apache.org/viewvc?rev=1383353&view=rev
Log:
* subversion/svn/file-merge.c
(svn_cl__merge_file): Preserve executable bit of the merged file.
Modified:
subversion/trunk/subversion/svn/file-merge.c
Modified: subversion/trunk/subversion/svn/file-merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/file-merge.c?rev=1383353&r1=1383352&r2=1383353&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/file-merge.c (original)
+++ subversion/trunk/subversion/svn/file-merge.c Tue Sep 11 11:06:47 2012
@@ -851,6 +851,7 @@ svn_cl__merge_file(const char *base_path
apr_file_t *merged_file;
const char *merged_file_name;
struct file_merge_baton fmb;
+ svn_boolean_t executable;
SVN_ERR(svn_cmdline_printf(
@@ -912,7 +913,9 @@ svn_cl__merge_file(const char *base_path
return SVN_NO_ERROR;
}
- SVN_ERR_W(svn_io_file_move(merged_file_name, merged_path, scratch_pool),
+ SVN_ERR(svn_io_is_file_executable(&executable, merged_path, scratch_pool));
+ SVN_ERR_W(svn_io_copy_file(merged_file_name, merged_path, FALSE,
+ scratch_pool),
apr_psprintf(scratch_pool,
_("Could not write merged result to '%s', saved "
"instead at '%s'.\n'%s' remains in conflict.\n"),
@@ -924,6 +927,9 @@ svn_cl__merge_file(const char *base_path
svn_dirent_local_style(
svn_dirent_skip_ancestor(path_prefix, wc_path),
scratch_pool)));
+ SVN_ERR(svn_io_set_file_executable(merged_path, executable, FALSE,
+ scratch_pool));
+ SVN_ERR(svn_io_remove_file2(merged_file_name, TRUE, scratch_pool));
/* The merge was not aborted and we could install the merged result. The
* file remains in conflict unless all conflicting sections were resolved. */