diff/merge
This commit is contained in:
parent
6483f11b06
commit
7b1b57dc59
src/lib/diff
Binary file not shown.
@ -60,5 +60,31 @@ def compute_diff(path_filea, path_fileb):
|
|||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
def txt_diff(path_filea, path_fileb):
|
||||||
|
ldiff = compute_diff(path_filea, path_fileb)
|
||||||
|
|
||||||
|
tdiff = ''
|
||||||
|
|
||||||
|
astart = '<<<<<<< %s\n' % (path_filea,)
|
||||||
|
sep = '======='
|
||||||
|
bstart = '>>>>>>> %s\n' % (path_fileb,)
|
||||||
|
|
||||||
|
for block in ldiff:
|
||||||
|
islast_block = True if block == ldiff[-1] else False
|
||||||
|
|
||||||
|
if isinstance(block[0], list):
|
||||||
|
ja = ''.join(block[0])
|
||||||
|
tdiff += astart + ja + sep + '\n'
|
||||||
|
jb = ''.join(block[1])
|
||||||
|
tdiff += bstart + jb + sep
|
||||||
|
if not islast_block:
|
||||||
|
tdiff += '\n'
|
||||||
|
continue
|
||||||
|
|
||||||
|
tdiff += ''.join(block)
|
||||||
|
|
||||||
|
print(tdiff)
|
||||||
|
return tdiff
|
||||||
|
|
||||||
def merge_diff(txt_diff, outfile):
|
def merge_diff(txt_diff, outfile):
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user