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

'svn update' command, in case of conflict, should leave the version with unchanged conflicting parts

From: Yuri <yuri_at_rawbw.com>
Date: Mon, 20 Jan 2014 16:31:44 -0800

I am trying to make an external merging utility present merging versions
in a nicer way. I am using meld as a remote utility.
Below is an example of merge-tool-cmd that I use.
svn supplies base revision of the file, new incoming revision (causing
conflict), merged by svn version, and the original user version.

So "merged" version here is marked up by svn, something like this:
<<<<<<< .mine
3b
||||||| .r1
3
=======
3a
>>>>>>> .r2

It would be beneficial for the external merging utility to use version
with resolved non-conflict places, and with original version in the
places which do cause conflicts.
Maybe there is some option in subversion that is already doing this, in
this case I apologize. Otherwise, I would like to suggest you add the
fourth variant of the file, maybe called .pending, as I described above.
Every marked up place would just contain the .mine version, and no markup.

Thanks,
Yuri

---merge-tool-cmd command---
#!/usr/bin/env python

import sys
import os.path
import time
import subprocess
import shutil

try:
    # path to meld
    meld = "meld"

    # file paths supplied by subversion
    base = sys.argv[1]
    theirs = sys.argv[2]
    mine = sys.argv[3]
    merged = sys.argv[4]

    # Call meld, making sure it exits correctly
    subprocess.check_call([meld, base, merged, theirs])
except:
    print "An error occurred in meld merge helper: ", sys.exc_info()[0],
sys.exc_info()[1]
    sys.exit(-1)
Received on 2014-01-21 01:32:22 CET

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

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