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 2013/06/11 16:47:41 UTC

svn commit: r1491816 - /subversion/trunk/subversion/svn/file-merge.c

Author: stsp
Date: Tue Jun 11 14:47:41 2013
New Revision: 1491816

URL: http://svn.apache.org/r1491816
Log:
Add options to the interactive file merge which concanenate conflicted
'their' and 'mine' versions.

This is useful when resolving text conflicts in append-only files.

One example is our release signature files, where new PGP signatures are
appended, but never removed or edited. If someone else was quicker with
committing their signature, pick 'm' at the conflict prompt, then pick '12'
during the file merge, then pick 'r' to mark the conflict resolved.

* subversion/svn/file-merge.c
  (merge_chunks): Add new options "12" and "21" which can be used to
    concanenate conflicted chunks in either order.

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=1491816&r1=1491815&r2=1491816&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/file-merge.c (original)
+++ subversion/trunk/subversion/svn/file-merge.c Tue Jun 11 14:47:41 2013
@@ -655,6 +655,8 @@ merge_chunks(apr_array_header_t **merged
   svn_stringbuf_appendcstr(
     prompt,
     _("Select: (1) use their version, (2) use your version,\n"
+      "        (12) their version first, then yours,\n"
+      "        (21) your version first, then theirs,\n"
       "        (e1) edit their version and use the result,\n"
       "        (e2) edit your version and use the result,\n"
       "        (eb) edit both versions and use the result,\n"
@@ -679,6 +681,18 @@ merge_chunks(apr_array_header_t **merged
           *merged_chunk = chunk2;
           break;
         }
+      if (strcmp(answer, "12") == 0)
+        {
+          *merged_chunk = chunk1;
+          apr_array_cat(*merged_chunk, chunk2);
+          break;
+        }
+      if (strcmp(answer, "21") == 0)
+        {
+          *merged_chunk = chunk2;
+          apr_array_cat(*merged_chunk, chunk1);
+          break;
+        }
       else if (strcmp(answer, "p") == 0)
         {
           *merged_chunk = NULL;