203 args = _toolstr(ui, tool, "args", '$local $base $other') |
203 args = _toolstr(ui, tool, "args", '$local $base $other') |
204 if "$output" in args: |
204 if "$output" in args: |
205 out, a = a, back # read input from backup, write to original |
205 out, a = a, back # read input from backup, write to original |
206 replace = dict(local=a, base=b, other=c, output=out) |
206 replace = dict(local=a, base=b, other=c, output=out) |
207 args = re.sub("\$(local|base|other|output)", |
207 args = re.sub("\$(local|base|other|output)", |
208 lambda x: '"%s"' % replace[x.group()[1:]], args) |
208 lambda x: '"%s"' % util.localpath(replace[x.group()[1:]]), args) |
209 r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env) |
209 r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env) |
210 |
210 |
211 if not r and _toolbool(ui, tool, "checkconflicts"): |
211 if not r and _toolbool(ui, tool, "checkconflicts"): |
212 if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data()): |
212 if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data()): |
213 r = 1 |
213 r = 1 |