##// END OF EJS Templates
filemerge._xmerge: drop no longer necessary 'if r:' check...
Siddharth Agarwal -
r26574:f82cb7df default
parent child Browse files
Show More
@@ -356,34 +356,31 b' def _idump(repo, mynode, orig, fcd, fco,'
356 return False, 1
356 return False, 1
357
357
358 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
358 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
359 r = 1
359 tool, toolpath, binary, symlink = toolconf
360 if r:
360 a, b, c, back = files
361 tool, toolpath, binary, symlink = toolconf
361 out = ""
362 a, b, c, back = files
362 env = {'HG_FILE': fcd.path(),
363 out = ""
363 'HG_MY_NODE': short(mynode),
364 env = {'HG_FILE': fcd.path(),
364 'HG_OTHER_NODE': str(fco.changectx()),
365 'HG_MY_NODE': short(mynode),
365 'HG_BASE_NODE': str(fca.changectx()),
366 'HG_OTHER_NODE': str(fco.changectx()),
366 'HG_MY_ISLINK': 'l' in fcd.flags(),
367 'HG_BASE_NODE': str(fca.changectx()),
367 'HG_OTHER_ISLINK': 'l' in fco.flags(),
368 'HG_MY_ISLINK': 'l' in fcd.flags(),
368 'HG_BASE_ISLINK': 'l' in fca.flags(),
369 'HG_OTHER_ISLINK': 'l' in fco.flags(),
369 }
370 'HG_BASE_ISLINK': 'l' in fca.flags(),
371 }
372
370
373 ui = repo.ui
371 ui = repo.ui
374
372
375 args = _toolstr(ui, tool, "args", '$local $base $other')
373 args = _toolstr(ui, tool, "args", '$local $base $other')
376 if "$output" in args:
374 if "$output" in args:
377 out, a = a, back # read input from backup, write to original
375 out, a = a, back # read input from backup, write to original
378 replace = {'local': a, 'base': b, 'other': c, 'output': out}
376 replace = {'local': a, 'base': b, 'other': c, 'output': out}
379 args = util.interpolate(r'\$', replace, args,
377 args = util.interpolate(r'\$', replace, args,
380 lambda s: util.shellquote(util.localpath(s)))
378 lambda s: util.shellquote(util.localpath(s)))
381 cmd = toolpath + ' ' + args
379 cmd = toolpath + ' ' + args
382 repo.ui.debug('launching merge tool: %s\n' % cmd)
380 repo.ui.debug('launching merge tool: %s\n' % cmd)
383 r = ui.system(cmd, cwd=repo.root, environ=env)
381 r = ui.system(cmd, cwd=repo.root, environ=env)
384 repo.ui.debug('merge tool returned: %s\n' % r)
382 repo.ui.debug('merge tool returned: %s\n' % r)
385 return True, r
383 return True, r
386 return False, 0
387
384
388 def _formatconflictmarker(repo, ctx, template, label, pad):
385 def _formatconflictmarker(repo, ctx, template, label, pad):
389 """Applies the given template to the ctx, prefixed by the label.
386 """Applies the given template to the ctx, prefixed by the label.
General Comments 0
You need to be logged in to leave comments. Login now