220 else: |
220 else: |
221 args = _toolstr(ui, tool, "args", '$local $base $other') |
221 args = _toolstr(ui, tool, "args", '$local $base $other') |
222 if "$output" in args: |
222 if "$output" in args: |
223 out, a = a, back # read input from backup, write to original |
223 out, a = a, back # read input from backup, write to original |
224 replace = dict(local=a, base=b, other=c, output=out) |
224 replace = dict(local=a, base=b, other=c, output=out) |
225 args = re.sub("\$(local|base|other|output)", |
225 args = util.interpolate(r'\$', replace, args, |
226 lambda x: '"%s"' % util.localpath(replace[x.group()[1:]]), args) |
226 lambda s: '"%s"' % util.localpath(s)) |
227 r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env) |
227 r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env) |
228 |
228 |
229 if not r and (_toolbool(ui, tool, "checkconflicts") or |
229 if not r and (_toolbool(ui, tool, "checkconflicts") or |
230 'conflicts' in _toollist(ui, tool, "check")): |
230 'conflicts' in _toollist(ui, tool, "check")): |
231 if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data()): |
231 if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data()): |