List:Commits« Previous MessageNext Message »
From:msvensson Date:May 2 2008 1:00pm
Subject:bk commit into 5.1 tree (msvensson:1.2620)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of msvensson.  When msvensson does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-05-02 13:00:04+02:00, msvensson@stripped +1 -0
  Change the "diff tool" detection algoritm to use "diff -u", "diff -c" and
  then just "diff"

  client/mysqltest.c@stripped, 2008-05-02 13:00:02+02:00, msvensson@stripped +10 -12
    Change the "diff tool" detection algoritm to use "diff -u", "diff -c" and
    then just "diff"

diff -Nrup a/client/mysqltest.c b/client/mysqltest.c
--- a/client/mysqltest.c	2008-04-22 12:42:01 +02:00
+++ b/client/mysqltest.c	2008-05-02 13:00:02 +02:00
@@ -1345,23 +1345,21 @@ void show_diff(DYNAMIC_STRING* ds,
   if (init_dynamic_string(&ds_tmp, "", 256, 256))
     die("Out of memory");
 
-  /* First try with diff --help to see if the command exists at all */
+  /* First try with unified diff */
   if (run_tool("diff",
                &ds_tmp, /* Get output from diff in ds_tmp */
-               "--help",
+               "-u",
+               filename1,
+               filename2,
                "2>&1",
-               NULL) != 0) /* Most "diff --help" tools return 0 */
-  {
-    diff_failed= "You don't appear to have diff installed";
-  }
-  else
+               NULL) > 1) /* Most "diff" tools return >1 if error */
   {
     dynstr_set(&ds_tmp, "");
-    /* First try with unified diff */
 
+    /* Fallback to context diff with "diff -c" */
     if (run_tool("diff",
                  &ds_tmp, /* Get output from diff in ds_tmp */
-                 "-u",
+                 "-c",
                  filename1,
                  filename2,
                  "2>&1",
@@ -1369,17 +1367,17 @@ void show_diff(DYNAMIC_STRING* ds,
     {
       dynstr_set(&ds_tmp, "");
 
-      /* Fallback to context diff with "diff -c" */
+      /* Fallback to plain "diff" */
       if (run_tool("diff",
                    &ds_tmp, /* Get output from diff in ds_tmp */
-                   "-c",
                    filename1,
                    filename2,
                    "2>&1",
                    NULL) > 1) /* Most "diff" tools return >1 if error */
       {
         dynstr_set(&ds_tmp, "");
-        diff_failed= "Could not execute 'diff -u' or 'diff -c'";
+
+        diff_failed= "Could not execute 'diff -u', 'diff -c' or 'diff'";
       }
     }
   }
Thread
bk commit into 5.1 tree (msvensson:1.2620)msvensson2 May