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

Three-way merge markers by default

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Mon, 7 Apr 2014 08:34:49 +0000

What do people feel about applying this patch (from the FreeBSD port) to trunk?

[[[
http://svn.freebsd.org/ports/head/devel/subversion/files/extra-patch-3way-conflict-markers (mod_dav_svn)
https://svnweb.freebsd.org/ports/head/devel/subversion/files/extra-patch-3way-conflict-markers?view=log (viewvc)
(and mentioned previously in context of custom keywords: <http://mid.gmane.org/20100922180752.GJ25159@ted.stsp.name>)
diff -ruN subversion/libsvn_wc/merge.c subversion/libsvn_wc/merge.c
--- subversion/libsvn_wc/merge.c 2011-08-06 19:15:44.000000000 +0400
+++ subversion/libsvn_wc/merge.c 2011-09-07 21:47:19.000000000 +0400
@@ -413,7 +413,7 @@
                                       target_marker,
                                       right_marker,
                                       "=======", /* separator */
- svn_diff_conflict_display_modified_latest,
+ svn_diff_conflict_display_modified_original_latest,
                                       pool));
   SVN_ERR(svn_stream_close(ostream));
 
]]]

All it does is change the contents of conflict files in --accept=postpone mode:
it causes conflict markers to be rendered not as two sides
    <<<<<<
    mine
    ======
    theirs
>>>>>>
but as three sides
    <<<<<<
    mine
    ||||||
    original
    ======
    theirs
>>>>>>
    .
I find the latter style much easier to work with --- it is easier for me to
"Apply diff(ORIGINAL, THEIRS) to MINE" than to "Compare (MINE, THEIRS) and
sort out which parts of the delta to keep and which to reverse".

Does this break compatibility somehow? Scripts have the foo.c.{mine,theirs,
merged} files to work with. As to users, they may already be familiar with the
three-way syntax since the interactive conflicts resolver generates it[1]; if
not, the book could explain the |||||| block like it explains <<<<<< and >>>>>>.

Daniel

[1] The interactive conflicts resolver generates three-way diffs in the 'dc'
    (display-conflicts) command:

    [[[
        wc/trunk% svn merge ../branch
        Conflict discovered in 'foo'.
        Select: (p) postpone, (df) diff-full, (e) edit,
                (mc) mine-conflict, (tc) theirs-conflict,
                (s) show all options: dc
        <<<<<<< MINE (select with 'mc') (1)
        foo on trunk
        ||||||| ORIGINAL (1)
        foo
        =======
        foo on branch
>>>>>>> THEIRS (select with 'tc') (1)
    ]]]
    
    The inclusion of the "foo\n" version makes the conflict easier to
    resolve.
Received on 2014-04-07 10:35:33 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.