[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH]: Fix issue #4128

From: Markus Schaber <m.schaber_at_3s-software.com>
Date: Mon, 11 Jun 2012 12:32:20 +0000

Hi,

See attached a patch to fix issue #4128: If the incoming file is identical to the existing, locally modified file, we don't flag a conflict any more, but notify the user of a successful merge.

[[[
libsvn_wc: no conflict for identical files

[ insubversion/libsvn_wc ]

* merge.c
  (merge_file_trivial): Successful report merged when incoming file is identical to existing, locally modified file.

]]]

Thank you,
Markus Schaber

Index: subversion/libsvn_wc/merge.c
===================================================================
--- subversion/libsvn_wc/merge.c (revision 1348784)
+++ subversion/libsvn_wc/merge.c (working copy)
@@ -992,6 +992,20 @@

       return SVN_NO_ERROR;
     }
+ else
+ {
+ /* Check whether the existing version equals the right side.
+ * If it does, the local changes reflect the same state as the incoming
+ * file, so there is no conflict. But as the state of the file actually
+ * changes, we intentionally report this as a successful merge. */
+ SVN_ERR(svn_io_files_contents_same_p(&same_contents, detranslated_target_abspath,
+ right_abspath, scratch_pool));
+ if (same_contents)
+ {
+ *merge_outcome = svn_wc_merge_merged;
+ return SVN_NO_ERROR;
+ }
+ }

   *merge_outcome = svn_wc_merge_no_merge;
   return SVN_NO_ERROR;
Received on 2012-06-11 14:33:00 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.