[PATCH 1 of 3] Fix and test merge-tools internal:dump and internal:prompt

Mads Kiilerich mads at kiilerich.com
Sat Jun 20 20:36:17 CDT 2009


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1245546712 -7200
# Node ID f7457428462daa072c77e3426d34ca4757dffa2a
# Parent  89b71acdac9a2c29fc570c398c730295e47142a2
Fix and test merge-tools internal:dump and internal:prompt

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -195,8 +195,8 @@
     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())
+        repo.wwrite(fd + ".other", fco.data(), fco.flags())
+        repo.wwrite(fd + ".base", fca.data(), fca.flags())
         return 1 # unresolved
     else:
         args = _toolstr(ui, tool, "args", '$local $base $other')
diff --git a/tests/test-merge-tools b/tests/test-merge-tools
--- a/tests/test-merge-tools
+++ b/tests/test-merge-tools
@@ -121,6 +121,20 @@
 echo "# ui.merge specifies internal:other:"
 domerge -r 2 --config ui.merge=internal:other
 
+echo "# ui.merge specifies internal:prompt:"
+domerge -r 2 --config ui.merge=internal:prompt
+
+echo "# ui.merge specifies internal:dump:"
+domerge -r 2 --config ui.merge=internal:dump
+echo f.base:
+cat f.base
+echo f.local:
+cat f.local
+echo f.other:
+cat f.other
+rm f.base f.local f.other
+echo
+
 echo "# ui.merge specifies internal:other but is overruled by pattern for false:"
 domerge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
 
diff --git a/tests/test-merge-tools.out b/tests/test-merge-tools.out
--- a/tests/test-merge-tools.out
+++ b/tests/test-merge-tools.out
@@ -297,6 +297,51 @@
 # hg stat
 M f
 
+# ui.merge specifies internal:prompt:
+[merge-tools]
+false.whatever=
+true.priority=1
+true.executable=cat
+# hg update -C 1
+# hg merge -r 2 --config ui.merge=internal:prompt
+0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+# cat f
+revision 1
+space
+# hg stat
+M f
+
+# ui.merge specifies internal:dump:
+[merge-tools]
+false.whatever=
+true.priority=1
+true.executable=cat
+# hg update -C 1
+# hg merge -r 2 --config ui.merge=internal:dump
+merging f
+0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon
+# cat f
+revision 1
+space
+# hg stat
+M f
+? f.base
+? f.local
+? f.orig
+? f.other
+
+f.base:
+revision 0
+space
+f.local:
+revision 1
+space
+f.other:
+revision 2
+space
+
 # ui.merge specifies internal:other but is overruled by pattern for false:
 [merge-tools]
 false.whatever=


More information about the Mercurial-devel mailing list