-
-# default mergerc content
-__DATA__
- function local_execute_redirected(stdin, stdout, stderr, path, ...)
- local pid
- local ret = -1
- io.flush();
- pid = spawn_redirected(stdin, stdout, stderr, path, unpack(arg))
- if (pid ~= -1) then ret, pid = wait(pid) end
- return ret
- end
- if (not execute_redirected) then -- use standard function if available
- execute_redirected = local_execute_redirected
- end
- if (not mergers.fail) then -- use standard merger if available
- mergers.fail = {
- cmd = function (tbl) return false end,
- available = function () return true end,
- wanted = function () return true end
- }
- end
- mergers.diffutils_force = {
- cmd = function (tbl)
- local ret = execute_redirected(
- "",
- tbl.outfile,
- "",
- "diff3",
- "--merge",
- "--show-overlap",
- "--label", string.format("[Yours]", tbl.left_path ),
- "--label", string.format("[Original]", tbl.anc_path ),
- "--label", string.format("[Theirs]", tbl.right_path),
- tbl.lfile,
- tbl.afile,
- tbl.rfile
- )
- if (ret > 1) then
- io.write(gettext("Error running GNU diffutils 3-way difference tool 'diff3'"))
- return false
- end
- return tbl.outfile
- end,
- available =
- function ()
- return program_exists_in_path("diff3");
- end,
- wanted =
- function ()
- return true
- end
- }