[PATCH 1 of 2] test-extdiff: Test that changes made in tmp copy are copied back

Mads Kiilerich mads at kiilerich.com
Thu Apr 9 07:43:40 CDT 2009


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1239280364 -7200
# Node ID a1739831bf1ed32b12fd3a89f1c6692f9a944874
# Parent  ffbebfb6b8d427b02a6fa3b680ad86cb9ef31b16
test-extdiff: Test that changes made in tmp copy are copied back

diff --git a/tests/test-extdiff b/tests/test-extdiff
--- a/tests/test-extdiff
+++ b/tests/test-extdiff
@@ -28,7 +28,7 @@
 hg falabala -r 0:1
 
 # test diff during merge
-hg update 0
+hg update -C 0
 echo c >> c
 hg add c
 hg ci -m "new branch" -d '1 0'
@@ -43,3 +43,23 @@
 # check diff are made from the first parent
 hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
 #hg log
+
+echo
+echo % test extdiff of multiple files in tmp dir:
+hg update -C 0 > /dev/null
+echo changed > a
+echo changed > b
+echo % diff in working directory, before
+hg diff --git
+echo % edit with extdiff -p
+# prepare custom diff/edit tool
+cat > differ.sh << EOT
+#!/bin/sh
+sleep 1 # avoid unchanged-timestamp problems
+echo edited >> a/a
+echo edited >> a/b
+EOT
+chmod +x differ.sh
+hg extdiff -p `pwd`/differ.sh # will change to /tmp/extdiff.TMP and populate directories a.TMP and a and start tool
+echo % diff in working directory, after
+hg diff --git
diff --git a/tests/test-extdiff.out b/tests/test-extdiff.out
--- a/tests/test-extdiff.out
+++ b/tests/test-extdiff.out
@@ -34,3 +34,34 @@
 diffing a.8a5febb7f867/a a.34eed99112ab/a
 diffing a.2a13a4d2da36/a a.46c0e4daeb72/a
 diff-like tools yield a non-zero exit code
+
+% test extdiff of multiple files in tmp dir:
+% diff in working directory, before
+diff --git a/a b/a
+--- a/a
++++ b/a
+@@ -1,1 +1,1 @@
+-a
++changed
+diff --git a/b b/b
+--- a/b
++++ b/b
+@@ -1,1 +1,1 @@
+-b
++changed
+% edit with extdiff -p
+% diff in working directory, after
+diff --git a/a b/a
+--- a/a
++++ b/a
+@@ -1,1 +1,2 @@
+-a
++changed
++edited
+diff --git a/b b/b
+--- a/b
++++ b/b
+@@ -1,1 +1,2 @@
+-b
++changed
++edited


More information about the Mercurial-devel mailing list