##// END OF EJS Templates
simplemerge: add optional context parameters to simplemerge...
Phil Cohen -
r33825:b3571dc0 default
parent child Browse files
Show More
@@ -408,7 +408,8 b' def _verifytext(text, path, ui, opts):'
408 408 raise error.Abort(msg)
409 409 return text
410 410
411 def simplemerge(ui, local, base, other, **opts):
411 def simplemerge(ui, localfile, basefile, otherfile,
412 localctx=None, basectx=None, otherctx=None, repo=None, **opts):
412 413 def readfile(filename):
413 414 f = open(filename, "rb")
414 415 text = f.read()
@@ -421,8 +422,8 b' def simplemerge(ui, local, base, other, '
421 422 name_b = None
422 423 name_base = None
423 424 else:
424 name_a = local
425 name_b = other
425 name_a = localfile
426 name_b = otherfile
426 427 name_base = None
427 428 labels = opts.get('label', [])
428 429 if len(labels) > 0:
@@ -435,16 +436,16 b' def simplemerge(ui, local, base, other, '
435 436 raise error.Abort(_("can only specify three labels."))
436 437
437 438 try:
438 localtext = readfile(local)
439 basetext = readfile(base)
440 othertext = readfile(other)
439 localtext = readfile(localfile)
440 basetext = readfile(basefile)
441 othertext = readfile(otherfile)
441 442 except error.Abort:
442 443 return 1
443 444
444 local = os.path.realpath(local)
445 localfile = os.path.realpath(localfile)
445 446 if not opts.get('print'):
446 opener = vfsmod.vfs(os.path.dirname(local))
447 out = opener(os.path.basename(local), "w", atomictemp=True)
447 opener = vfsmod.vfs(os.path.dirname(localfile))
448 out = opener(os.path.basename(localfile), "w", atomictemp=True)
448 449 else:
449 450 out = ui.fout
450 451
General Comments 0
You need to be logged in to leave comments. Login now