filemerge: add internal:dump
authorMatt Mackall <mpm@selenic.com>
Thu, 18 Jun 2009 16:56:03 -0500
changeset 8831 91e26fb24fb1
parent 8830 a9850eda2973
child 8832 6e6f5b80e056
child 8908 105343f9f744
filemerge: add internal:dump This create foo.{local,other,base} files for people to manually merge files while littering their working directory.
mercurial/filemerge.py
--- 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: