Files
openairinterface5g/targets/SCRIPTS/svn-merge-meld.py
T
Navid Nikaein f18e400960 * merge/add handover procedure for the access stratum (enabled with the -H), status: experimental.
* fix a bug in BSR computation
* add a python script to launch meld if the diff3 in subvsersion/config file is set to the targets/SCRIPTS/svn-merge-meld.py
* pre-ci passed (100%) 


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4309 818b1a75-f10b-46b9-bf7c-635c3b92a50f
2013-10-30 21:52:26 +00:00

42 lines
1.6 KiB
Python
Executable File

#!/usr/bin/env python
# svn merge-tool python wrapper for meld
# to use: edit ~/.subversion/config and uncomment the line merge-tool-cmd =
# and set the path to your command
# Note that when a conflict occurs, you will be prompted what to do with it. You need to type a single 'l' and for svn to run this script. When you've finished your merge, you need to type an 'r' to resolve the conflict and copy the merged version to the working copy.
import os, sys
import subprocess
import shutil
try:
# path to meld
meld = "/usr/bin/meld"
print "Set the file paths for mine, theirs, and merged\n"
print "When you've finished your merge, you need to type an 'r' to resolve the conflict and copy the merged version to the working copy\n"
# the base or "left" revision version of the file you're merging with
base = sys.argv[1]
# this is "later" or "right"revision version of the file you're merging with
theirs = sys.argv[2]
# this is my version, recommandations: sync your copy to the latest version
mine = sys.argv[3]
#this starts out as a copy of 'mine' (your working copy), and this is where you want the final results of the merge to end up.
merged = sys.argv[4]
print "Calling meld: the order of the files is (merged, theirs, and mine)"
# all 4 versions: worke right-to-left, reslut being stored in the left file
# cmd = [meld, mine, base, theirs, merged]
# only 3 versions
cmd = [meld, merged, theirs, mine]
# Call meld, making sure it exits correctly
subprocess.check_call(cmd)
except:
print "Oh, an error!\n"
sys.exit(-1)