##// END OF EJS Templates
simplemerge: do not allow binary files to abort an entire merge...
Steve Borho -
r14328:3c65cdcf stable
parent child Browse files
Show More
@@ -407,10 +407,10 b' def simplemerge(ui, local, base, other, '
407 f.close()
407 f.close()
408 if util.binary(text):
408 if util.binary(text):
409 msg = _("%s looks like a binary file.") % filename
409 msg = _("%s looks like a binary file.") % filename
410 if not opts.get('quiet'):
411 ui.warn(_('warning: %s\n') % msg)
410 if not opts.get('text'):
412 if not opts.get('text'):
411 raise util.Abort(msg)
413 raise util.Abort(msg)
412 elif not opts.get('quiet'):
413 ui.warn(_('warning: %s\n') % msg)
414 return text
414 return text
415
415
416 name_a = local
416 name_a = local
@@ -423,9 +423,12 b' def simplemerge(ui, local, base, other, '
423 if labels:
423 if labels:
424 raise util.Abort(_("can only specify two labels."))
424 raise util.Abort(_("can only specify two labels."))
425
425
426 localtext = readfile(local)
426 try:
427 basetext = readfile(base)
427 localtext = readfile(local)
428 othertext = readfile(other)
428 basetext = readfile(base)
429 othertext = readfile(other)
430 except util.Abort:
431 return 1
429
432
430 local = os.path.realpath(local)
433 local = os.path.realpath(local)
431 if not opts.get('print'):
434 if not opts.get('print'):
@@ -99,8 +99,8 b' binary file'
99 $ python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
99 $ python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
100 $ cat orig >> binary-local
100 $ cat orig >> binary-local
101 $ python simplemerge -p binary-local base other
101 $ python simplemerge -p binary-local base other
102 abort: binary-local looks like a binary file.
102 warning: binary-local looks like a binary file.
103 [255]
103 [1]
104
104
105 binary file --text
105 binary file --text
106
106
General Comments 0
You need to be logged in to leave comments. Login now