Bak when I used monotone for the first time, I was surprised to see that
all the merge options provided were pretty much modal.  So I came up with
the code attached below (not on my own, it's largely copied from random
bits on the Web, it's probably hideous for Lua experts).

Is there such a tool in standard now?


        Stefan


--    -*- lua -*-

mergers.diffutils = {
   cmd = function (tbl)
      local ret = execute(
          "sh",
          "-c",
          "diff3 " ..
          "-Am " ..
          "--label " .. string.format("'%s [left]' ",     tbl.left_path ) ..
          "--label " .. string.format("'%s [ancestor]' ", tbl.anc_path  ) ..
          "--label " .. string.format("'%s [right]' ",    tbl.right_path) ..
          "'" .. tbl.lfile .. "' " ..
          "'" .. tbl.afile .. "' " ..
          "'" .. tbl.rfile .. "' " ..
          ">'" .. tbl.outfile .. "'"
      )
      if (ret > 1) then
         io.write(gettext("Error running GNU diffutils 3-way difference tool 
'diff3'\n"))
         return false
      end
      return tbl.outfile
   end,
   available = function () return program_exists_in_path("diff3"); end,
   wanted = function () return true end
}



_______________________________________________
Monotone-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to