monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Non-modal merge


From: Stefan Monnier
Subject: [Monotone-devel] Non-modal merge
Date: Fri, 21 Sep 2007 13:18:22 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

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
}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]