[PATCH] Add 'shelltools': diff tool detection (try to find GNU diff)
David Champion
dgc at uchicago.edu
Sun Jul 5 21:33:00 CDT 2009
# HG changeset patch
# User David Champion <dgc at uchicago.edu>
# Date 1246847552 18000
# Node ID b662b90acf147e5d264a083ed6302b3fc6ea82c3
# Parent 95046688f80fbe481241ed3affeed205ce378b7e
Add 'shelltools': diff tool detection (try to find GNU diff).
diff -r 95046688f80f -r b662b90acf14 tests/shelltools
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/shelltools Sun Jul 05 21:32:32 2009 -0500
@@ -0,0 +1,9 @@
+#!/bin/sh
+#
+# Detect some shell programs. This file is sourced from other shells,
+# so it should do nothing to irreversibly affect the current process.
+#
+
+# Detect and use GNU diff as diff, if available as 'gdiff'.
+_diff=`gdiff >/dev/null 2>&1 && echo gdiff || which diff`
+diff () { "$_diff" "$@"; }
diff -r 95046688f80f -r b662b90acf14 tests/test-command-template
--- a/tests/test-command-template Sun Jul 05 18:52:55 2009 -0400
+++ b/tests/test-command-template Sun Jul 05 21:32:32 2009 -0500
@@ -1,5 +1,7 @@
#!/bin/sh
+. "$TESTDIR/shelltools"
+
hg init a
cd a
echo a > a
diff -r 95046688f80f -r b662b90acf14 tests/test-highlight
--- a/tests/test-highlight Sun Jul 05 18:52:55 2009 -0400
+++ b/tests/test-highlight Sun Jul 05 21:32:32 2009 -0500
@@ -2,6 +2,8 @@
"$TESTDIR/hghave" pygments || exit 80
+. "$TESTDIR/shelltools"
+
cat <<EOF >> $HGRCPATH
[extensions]
hgext.highlight =
More information about the Mercurial-devel
mailing list