diff mercurial/filemerge.py @ 8831:91e26fb24fb1

filemerge: add internal:dump This create foo.{local,other,base} files for people to manually merge files while littering their working directory.
author Matt Mackall <mpm@selenic.com>
date Thu, 18 Jun 2009 16:56:03 -0500
parents a9850eda2973
children 90f74b31ed4f
line wrap: on
line diff
--- a/mercurial/filemerge.py	Thu Jun 18 16:56:02 2009 -0500
+++ b/mercurial/filemerge.py	Thu Jun 18 16:56:03 2009 -0500
@@ -16,7 +16,8 @@
 def _toolbool(ui, tool, part, default=False):
     return ui.configbool("merge-tools", tool + "." + part, default)
 
-_internal = ['internal:' + s for s in 'fail local other merge prompt'.split()]
+_internal = ['internal:' + s
+             for s in 'fail local other merge prompt dump'.split()]
 
 def _findtool(ui, tool):
     if tool in _internal:
@@ -191,6 +192,12 @@
 
     if tool == "internal:merge":
         r = simplemerge.simplemerge(ui, a, b, c, label=['local', 'other'])
+    elif tool == 'internal:dump':
+        a = repo.wjoin(fd)
+        util.copyfile(a, a + ".local")
+        repo.wwrite(a + ".other", fco.data(), fco.flags())
+        repo.wwrite(a + ".base", fca.data(), fca.flags())
+        return 1 # unresolved
     else:
         args = _toolstr(ui, tool, "args", '$local $base $other')
         if "$output" in args: