Author: dannas
Date: Fri Jul  9 19:45:19 2010
New Revision: 962670

URL: http://svn.apache.org/viewvc?rev=962670&view=rev
Log:
Print a diff header even if the diff only contains changes to
properties. We enable that by keeping a hashtable of visited paths
and print the header for props if the path hasn't been visited yet.

Works nicely, with two exceptions:
1) svnlook uses it's own diff implementation. I've marked the test as 
  XFail and intend to do the same change there in a follow-up.

2) Since the diff_props_changed callback does not have any revision
  arguments, the revisions have been fetched from the diff_cmd_baton. 
  BUT, those don't match for paths that have been added or when the
  caller is providing SVN_INVALID_REVNUM for revnum2. Intending to
  fix that in a follow-up.

* subversion/libsvn_client/diff.c
  (diff_label): Move above display_prop_diffs() since we need to call
    it from there.
  (display_prop_diffs): Add parameters for paths and revisions
    of the diffed content. Also add parameter 'show_diff_header'.
    Print the diff header if 'show_diff_header' is TRUE.
  (diff_cmd_baton): Add field 'visited_paths', a hashtable holding all
    the paths that we have received changes for - be it properties or 
    text.
  (diff_props_changed): Determine if a diff header for the path has
    been written.
  (diff_content_changed): Add the path to 'visited_paths'.
  (svn_client_diff5,
   svn_client_diff_peg5): Initialize 'visited_paths'.

* subversion/tests/cmdline/depth_tests.py
  (diff_in_depthy_wc): Add diff headers.

* subversion/tests/cmdline/diff_tests.py
  (diff_only_property_change): Add diff headers.
  (diff_property_changes_to_base): Add diff headers. Use 
    make_diff_header() instead of replacing lines all over
    the place.
  (diff_prop_change_local_propmod): Add diff headers but mark
    as XFail since the revisions in the labels are not the 
    expected.
  (diff_repos_wc_add_with_props,
   diff_with_depth): Add diff headers.

* subversion/tests/cmdline/svnlook_tests.py
  (test_print_property_diffs,
   diff_ignore_eolstyle): Mark as XFail. 

* subversion/tests/cmdline/merge_tests.py
  (merge_in_new_file_and_diff): Add diff headers.

Modified:
    subversion/trunk/subversion/libsvn_client/diff.c
    subversion/trunk/subversion/tests/cmdline/depth_tests.py
    subversion/trunk/subversion/tests/cmdline/diff_tests.py
    subversion/trunk/subversion/tests/cmdline/merge_tests.py
    subversion/trunk/subversion/tests/cmdline/svnlook_tests.py

Modified: subversion/trunk/subversion/libsvn_client/diff.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=962670&r1=962669&r2=962670&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/diff.c Fri Jul  9 19:45:19 2010
@@ -279,6 +279,27 @@ adjust_paths_for_diff_labels(const char 
 }
 
 
+/* Generate a label for the diff output for file PATH at revision REVNUM.
+   If REVNUM is invalid then it is assumed to be the current working
+   copy.  Assumes the paths are already in the desired style (local
+   vs internal).  Allocate the label in POOL. */
+static const char *
+diff_label(const char *path,
+           svn_revnum_t revnum,
+           apr_pool_t *pool)
+{
+  const char *label;
+  if (revnum != SVN_INVALID_REVNUM)
+    label = apr_psprintf(pool, _("%s\t(revision %ld)"), path, revnum);
+  else
+    label = apr_psprintf(pool, _("%s\t(working copy)"), path);
+
+  return label;
+}
+
+
+
+
 /* A helper func that writes out verbal descriptions of property diffs
    to FILE.   Of course, the apr_file_t will probably be the 'outfile'
    passed to svn_client_diff5, which is probably stdout. */
@@ -286,9 +307,14 @@ static svn_error_t *
 display_prop_diffs(const apr_array_header_t *propchanges,
                    apr_hash_t *original_props,
                    const char *path,
+                   const char *orig_path1,
+                   const char *orig_path2,
+                   svn_revnum_t rev1,
+                   svn_revnum_t rev2,
                    const char *encoding,
                    apr_file_t *file,
                    const char *relative_to_dir,
+                   svn_boolean_t show_diff_header,
                    apr_pool_t *pool)
 {
   int i;
@@ -307,6 +333,39 @@ display_prop_diffs(const apr_array_heade
         return MAKE_ERR_BAD_RELATIVE_PATH(path, relative_to_dir);
     }
 
+  /* If we're creating a diff on the wc root, path would be empty. */
+  if (path[0] == '\0')
+    path = apr_psprintf(pool, ".");
+
+    if (show_diff_header)
+      {
+        const char *path1 = orig_path1;
+        const char *path2 = orig_path2;
+        const char *label1;
+        const char *label2;
+
+        SVN_ERR(adjust_paths_for_diff_labels(&path1, &path2, path,
+                                             relative_to_dir, pool));
+
+        label1 = diff_label(path1, rev1, pool);
+        label2 = diff_label(path2, rev2, pool);
+
+        /* ### Should we show the paths in platform specific format,
+         * ### diff_content_changed() does not! */
+
+        SVN_ERR(file_printf_from_utf8 (file, encoding,
+                                       "Index: %s" APR_EOL_STR 
+                                       "%s" APR_EOL_STR, 
+                                       path,
+                                       equal_string));
+
+        SVN_ERR(file_printf_from_utf8(file, encoding,
+                                            "--- %s" APR_EOL_STR
+                                            "+++ %s" APR_EOL_STR,
+                                            label1,
+                                            label2));
+      }
+
   SVN_ERR(file_printf_from_utf8(file, encoding,
                                 _("%sProperty changes on: %s%s"),
                                 APR_EOL_STR,
@@ -542,25 +601,13 @@ struct diff_cmd_baton {
   svn_boolean_t use_git_diff_format;
 
   svn_wc_context_t *wc_ctx;
-};
 
-/* Generate a label for the diff output for file PATH at revision REVNUM.
-   If REVNUM is invalid then it is assumed to be the current working
-   copy.  Assumes the paths are already in the desired style (local
-   vs internal).  Allocate the label in POOL. */
-static const char *
-diff_label(const char *path,
-           svn_revnum_t revnum,
-           apr_pool_t *pool)
-{
-  const char *label;
-  if (revnum != SVN_INVALID_REVNUM)
-    label = apr_psprintf(pool, _("%s\t(revision %ld)"), path, revnum);
-  else
-    label = apr_psprintf(pool, _("%s\t(working copy)"), path);
+  /* A hashtable using the visited paths as keys. 
+   * ### This is needed for us to know if we need to print a diff header for
+   * ### a path that has property changes. */
+  apr_hash_t *visited_paths;
+};
 
-  return label;
-}
 
 /* An svn_wc_diff_callbacks4_t function.  Used for both file and directory
    property diffs. */
@@ -576,16 +623,39 @@ diff_props_changed(const char *local_dir
 {
   struct diff_cmd_baton *diff_cmd_baton = diff_baton;
   apr_array_header_t *props;
+  svn_boolean_t show_diff_header;
   apr_pool_t *subpool = svn_pool_create(diff_cmd_baton->pool);
 
   SVN_ERR(svn_categorize_props(propchanges, NULL, NULL, &props, subpool));
 
+  if (apr_hash_get(diff_cmd_baton->visited_paths, path, APR_HASH_KEY_STRING))
+      show_diff_header = FALSE;
+  else
+    show_diff_header = TRUE;
+
   if (props->nelts > 0)
-    SVN_ERR(display_prop_diffs(props, original_props, path,
-                               diff_cmd_baton->header_encoding,
-                               diff_cmd_baton->outfile,
-                               diff_cmd_baton->relative_to_dir,
-                               subpool));
+    {
+      /* ### We're using the revnums from the diff_cmd_baton since there's
+       * ### no revision argument to diff_props_changed(). But those revnums
+       * ### don't always match the ones given by the diff callbacks. See
+       * ### diff_test 32 for an example. */
+      SVN_ERR(display_prop_diffs(props, original_props, path,
+                                 diff_cmd_baton->orig_path_1,
+                                 diff_cmd_baton->orig_path_2,
+                                 diff_cmd_baton->revnum1,
+                                 diff_cmd_baton->revnum2,
+                                 diff_cmd_baton->header_encoding,
+                                 diff_cmd_baton->outfile,
+                                 diff_cmd_baton->relative_to_dir,
+                                 show_diff_header,
+                                 subpool));
+
+      /* We've printed the diff header so now we can mark the path as
+       * visited. */
+      if (show_diff_header)
+        apr_hash_set(diff_cmd_baton->visited_paths, path,
+                     APR_HASH_KEY_STRING, path);
+    }
 
   if (state)
     *state = svn_wc_notify_state_unknown;
@@ -804,6 +874,8 @@ diff_content_changed(const char *path,
   /* Destroy the subpool. */
   svn_pool_destroy(subpool);
 
+  apr_hash_set(diff_cmd_baton->visited_paths, path, APR_HASH_KEY_STRING, path);
+
   return SVN_NO_ERROR;
 }
 
@@ -2006,6 +2078,7 @@ svn_client_diff5(const apr_array_header_
   diff_cmd_baton.relative_to_dir = relative_to_dir;
   diff_cmd_baton.use_git_diff_format = use_git_diff_format;
   diff_cmd_baton.wc_ctx = ctx->wc_ctx;
+  diff_cmd_baton.visited_paths = apr_hash_make(pool);
 
   return do_diff(&diff_params, &diff_callbacks, &diff_cmd_baton, ctx, pool);
 }
@@ -2075,6 +2148,7 @@ svn_client_diff_peg5(const apr_array_hea
   diff_cmd_baton.relative_to_dir = relative_to_dir;
   diff_cmd_baton.use_git_diff_format = use_git_diff_format;
   diff_cmd_baton.wc_ctx = ctx->wc_ctx;
+  diff_cmd_baton.visited_paths = apr_hash_make(pool);
 
   return do_diff(&diff_params, &diff_callbacks, &diff_cmd_baton, ctx, pool);
 }

Modified: subversion/trunk/subversion/tests/cmdline/depth_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/depth_tests.py?rev=962670&r1=962669&r2=962670&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/depth_tests.py Fri Jul  9 
19:45:19 2010
@@ -1045,6 +1045,10 @@ def diff_in_depthy_wc(sbox):
     "@@ -1 +1 @@\n",
     "-new text\n",
     "+This is the file 'mu'.\n",
+    "Index: A\n",
+    "===================================================================\n",
+    "--- A\t(revision 2)\n",
+    "+++ A\t(working copy)\n",
     "\n",
     "Property changes on: A\n",
     "___________________________________________________________________\n",
@@ -1058,6 +1062,10 @@ def diff_in_depthy_wc(sbox):
     "@@ -1 +1 @@\n",
     "-new text\n",
     "+This is the file 'iota'.\n",
+    "Index: .\n",
+    "===================================================================\n",
+    "--- .\t(revision 2)\n",
+    "+++ .\t(working copy)\n",
     "\n",
     "Property changes on: .\n",
     "___________________________________________________________________\n",
@@ -1067,7 +1075,7 @@ def diff_in_depthy_wc(sbox):
 
   os.chdir(wc_empty)
 
-  expected_output = svntest.verify.UnorderedOutput(diff[20:26])
+  expected_output = svntest.verify.UnorderedOutput(diff[24:])
   # The diff should contain only the propchange on '.'
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'diff', '-rHEAD')
@@ -1077,11 +1085,11 @@ def diff_in_depthy_wc(sbox):
                                      '--set-depth', 'files', '-r1')
   # The diff should contain only the propchange on '.' and the
   # contents change on iota.
-  expected_output = svntest.verify.UnorderedOutput(diff[13:26])
+  expected_output = svntest.verify.UnorderedOutput(diff[17:])
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'diff', '-rHEAD')
   # Do a diff at --depth empty.
-  expected_output = svntest.verify.UnorderedOutput(diff[20:26])
+  expected_output = svntest.verify.UnorderedOutput(diff[24:])
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'diff', '--depth', 'empty', '-rHEAD')
 
@@ -1090,11 +1098,11 @@ def diff_in_depthy_wc(sbox):
                                      '--set-depth', 'immediates', '-r1')
   # The diff should contain the propchanges on '.' and 'A' and the
   # contents change on iota.
-  expected_output = svntest.verify.UnorderedOutput(diff[7:26])
+  expected_output = svntest.verify.UnorderedOutput(diff[7:])
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                     'diff', '-rHEAD')
   # Do a diff at --depth files.
-  expected_output = svntest.verify.UnorderedOutput(diff[13:26])
+  expected_output = svntest.verify.UnorderedOutput(diff[17:])
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'diff', '--depth', 'files', '-rHEAD')
 

Modified: subversion/trunk/subversion/tests/cmdline/diff_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/diff_tests.py?rev=962670&r1=962669&r2=962670&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/diff_tests.py Fri Jul  9 19:45:19 
2010
@@ -713,6 +713,10 @@ def diff_only_property_change(sbox):
   wc_dir = sbox.wc_dir
 
   expected_output = [
+    "Index: iota\n",
+    "===================================================================\n",
+    "--- iota\t(revision 1)\n",
+    "+++ iota\t(revision 2)\n",
     "\n",
     "Property changes on: iota\n",
     "___________________________________________________________________\n",
@@ -721,11 +725,16 @@ def diff_only_property_change(sbox):
     "+native\n" ]
 
   expected_reverse_output = list(expected_output)
-  expected_reverse_output[3] = expected_reverse_output[3].replace("Added",
+  expected_reverse_output[2] = expected_reverse_output[2].replace("1", "2")
+  expected_reverse_output[3] = expected_reverse_output[3].replace("2", "1")
+  expected_reverse_output[7] = expected_reverse_output[7].replace("Added",
                                                                   "Deleted")
-  expected_reverse_output[4] = "## -1 +0,0 ##\n"
-  expected_reverse_output[5] = "-native\n"
+  expected_reverse_output[8] = "## -1 +0,0 ##\n"
+  expected_reverse_output[9] = "-native\n"
 
+  expected_rev1_output = list(expected_output)
+  expected_rev1_output[3] = expected_rev1_output[3].replace("revision 2",
+                                                            "working copy")
 
   os.chdir(sbox.wc_dir)
   svntest.actions.run_and_verify_svn(None, None, [],
@@ -747,10 +756,10 @@ def diff_only_property_change(sbox):
   svntest.actions.run_and_verify_svn(None, expected_reverse_output, [],
                                      'diff', '-c', '-2')
 
-  svntest.actions.run_and_verify_svn(None, expected_output, [],
+  svntest.actions.run_and_verify_svn(None, expected_rev1_output, [],
                                      'diff', '-r', '1')
 
-  svntest.actions.run_and_verify_svn(None, expected_output, [],
+  svntest.actions.run_and_verify_svn(None, expected_rev1_output, [],
                                      'diff', '-r', 'PREV', 'iota')
 
 
@@ -1947,7 +1956,8 @@ def diff_property_changes_to_base(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  expected_output_r1_r2 = [
+
+  add_diff = [
     "\n",
     "Property changes on: A\n",
     "___________________________________________________________________\n",
@@ -1961,17 +1971,46 @@ def diff_property_changes_to_base(sbox):
     "## -0,0 +1 ##\n",
     "+r2value\n"]
 
-
-  expected_output_r2_r1 = list(expected_output_r1_r2)
-  expected_output_r2_r1[3] = expected_output_r2_r1[3].replace("Added",
-                                                              "Deleted")
-  expected_output_r2_r1[4] = "## -1 +0,0 ##\n"
-  expected_output_r2_r1[5] = "-r2value\n"
-  expected_output_r2_r1[9] = expected_output_r2_r1[9].replace("Added",
-                                                              "Deleted")
-  expected_output_r2_r1[10] = "## -1 +0,0 ##\n"
-  expected_output_r2_r1[11] = "-r2value\n"
-
+  del_diff = [
+    "\n",
+    "Property changes on: A\n",
+    "___________________________________________________________________\n",
+    "Deleted: dirprop\n",
+    "## -1 +0,0 ##\n",
+    "-r2value\n",
+    "\n",
+    "Property changes on: iota\n",
+    "___________________________________________________________________\n",
+    "Deleted: fileprop\n",
+    "## -1 +0,0 ##\n",
+    "-r2value\n"]
+
+
+  expected_output_r1_r2 = list(make_diff_header('A', 'revision 1', 'revision 
2') 
+                               + add_diff[:6]
+                               + make_diff_header('iota', 'revision 1', 
+                                                   'revision 2')
+                               + add_diff[7:])
+
+  expected_output_r2_r1 = list(make_diff_header('A', 'revision 2', 
+                                                'revision 1')
+                               + del_diff[:6]
+                               + make_diff_header('iota', 'revision 2', 
+                                                  'revision 1')
+                               + del_diff[7:])
+
+  expected_output_r1 = list(make_diff_header('A', 'revision 1', 
+                                             'working copy')
+                            + add_diff[:6]
+                            + make_diff_header('iota', 'revision 1',
+                                               'working copy')
+                            + add_diff[7:])
+  expected_output_base_r1 = list(make_diff_header('A', 'working copy',
+                                                  'revision 1')
+                                 + del_diff[:6]
+                                 + make_diff_header('iota', 'working copy',
+                                                    'revision 1')
+                                 + del_diff[7:])
 
   os.chdir(sbox.wc_dir)
 
@@ -1998,14 +2037,14 @@ def diff_property_changes_to_base(sbox):
   # Now check repos->WORKING, repos->BASE, and BASE->repos.
   # (BASE is r1, and WORKING has no local mods, so this should produce
   # the same output as above).
-  expected = svntest.verify.UnorderedOutput(expected_output_r1_r2)
+  expected = svntest.verify.UnorderedOutput(expected_output_r1)
   svntest.actions.run_and_verify_svn(None, expected, [],
                                      'diff', '-r', '1')
 
   svntest.actions.run_and_verify_svn(None, expected, [],
                                      'diff', '-r', '1:BASE')
 
-  expected = svntest.verify.UnorderedOutput(expected_output_r2_r1)
+  expected = svntest.verify.UnorderedOutput(expected_output_base_r1)
   svntest.actions.run_and_verify_svn(None, expected, [],
                                      'diff', '-r', 'BASE:1')
 
@@ -2023,12 +2062,12 @@ def diff_property_changes_to_base(sbox):
                                      'fileprop', 'workingvalue', 'A/mu')
 
   # Check that the earlier diffs against BASE are unaffected by the
-  # presence of local mods.
-  expected = svntest.verify.UnorderedOutput(expected_output_r1_r2)
+  # presence of local mods (with the exception of diff header changes).
+  expected = svntest.verify.UnorderedOutput(expected_output_r1)
   svntest.actions.run_and_verify_svn(None, expected, [],
                                      'diff', '-r', '1:BASE')
 
-  expected = svntest.verify.UnorderedOutput(expected_output_r2_r1)
+  expected = svntest.verify.UnorderedOutput(expected_output_base_r1)
   svntest.actions.run_and_verify_svn(None, expected, [],
                                      'diff', '-r', 'BASE:1')
 
@@ -2181,6 +2220,10 @@ def diff_prop_change_local_propmod(sbox)
   sbox.build()
 
   expected_output_r2_wc = [
+    "Index: A\n",
+    "===================================================================\n",
+    "--- A\t(revision 2)\n",
+    "+++ A\t(working copy)\n",
     "\n",
     "Property changes on: A\n",
     "___________________________________________________________________\n",
@@ -2191,6 +2234,10 @@ def diff_prop_change_local_propmod(sbox)
     "Added: newdirprop\n",
     "## -0,0 +1 ##\n",
     "+newworkingvalue\n",
+    "Index: iota\n",
+    "===================================================================\n",
+    "--- iota\t(revision 2)\n",
+    "+++ iota\t(working copy)\n",
     "\n",
     "Property changes on: iota\n",
     "___________________________________________________________________\n",
@@ -2289,8 +2336,12 @@ def diff_repos_wc_add_with_props(sbox):
     "+propvalue\n",
     ]
 
+  diff_X_r1_base = make_diff_header("X", "revision 0",
+                                         "revision 3") + diff_X
+  diff_X_base_r3 = make_diff_header("X", "revision 0",
+                                         "revision 3") + diff_X
   diff_foo_r1_base = make_diff_header("foo", "revision 0",
-                                              "revision 3") + diff_foo
+                                             "revision 3") + diff_foo
   diff_foo_base_r3 = make_diff_header("foo", "revision 0",
                                              "revision 3") + diff_foo
   diff_X_bar_r1_base = make_diff_header("X/bar", "revision 0",
@@ -2298,8 +2349,8 @@ def diff_repos_wc_add_with_props(sbox):
   diff_X_bar_base_r3 = make_diff_header("X/bar", "revision 0",
                                                  "revision 3") + diff_X_bar
 
-  expected_output_r1_base = diff_X + diff_X_bar_r1_base + diff_foo_r1_base
-  expected_output_base_r3 = diff_foo_base_r3 + diff_X_bar_base_r3 + diff_X
+  expected_output_r1_base = diff_X_r1_base + diff_X_bar_r1_base + 
diff_foo_r1_base
+  expected_output_base_r3 = diff_foo_base_r3 + diff_X_bar_base_r3 + 
diff_X_base_r3
 
   os.chdir(sbox.wc_dir)
 
@@ -2703,6 +2754,7 @@ def diff_with_depth(sbox):
   "test diffs at various depths"
 
   sbox.build()
+  B_path = os.path.join('A', 'B')
 
   diff = [
     "\n",
@@ -2730,11 +2782,23 @@ def diff_with_depth(sbox):
     "## -0,0 +1 ##\n",
     "+bar4\n"]
 
-  expected_empty = svntest.verify.UnorderedOutput(diff[:6])
-  expected_files = svntest.verify.UnorderedOutput(diff[:12])
-  expected_immediates = svntest.verify.UnorderedOutput(diff[:18])
-  expected_infinity = svntest.verify.UnorderedOutput(diff[:6]
-                                                     + diff[12:] + diff[6:12])
+  dot_header = make_diff_header(".", "revision 1", "working copy")
+  iota_header = make_diff_header('iota', "revision 1", "working copy")
+  A_header = make_diff_header('A', "revision 1", "working copy")
+  B_header = make_diff_header(B_path, "revision 1", "working copy")
+
+  expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:6])
+  expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                  + iota_header + diff[7:12])
+  expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                       + iota_header 
+                                                       + diff[7:12]
+                                                       +  A_header + 
diff[8:18])
+  expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                       + iota_header 
+                                                       + diff[7:12]
+                                                       +  A_header + diff[8:18]
+                                                       + B_header + diff[12:])
 
   os.chdir(sbox.wc_dir)
 
@@ -2765,7 +2829,25 @@ def diff_with_depth(sbox):
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'ci', '-m', '')
 
-  # Test repos-repos diff.  Reuse the expected outputs from above.
+  dot_header = make_diff_header(".", "revision 1", "revision 2")
+  iota_header = make_diff_header('iota', "revision 1", "revision 2")
+  A_header = make_diff_header('A', "revision 1", "revision 2")
+  B_header = make_diff_header(B_path, "revision 1", "revision 2")
+
+  expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:6])
+  expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                  + iota_header + diff[7:12])
+  expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                       + iota_header 
+                                                       + diff[7:12]
+                                                       +  A_header + 
diff[8:18])
+  expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                       + iota_header 
+                                                       + diff[7:12]
+                                                       +  A_header + diff[8:18]
+                                                       + B_header + diff[12:])
+
+  # Test repos-repos diff.
   svntest.actions.run_and_verify_svn(None, expected_empty, [],
                                      'diff', '-c2', '--depth', 'empty')
   svntest.actions.run_and_verify_svn(None, expected_files, [],
@@ -2776,6 +2858,10 @@ def diff_with_depth(sbox):
                                      'diff', '-c2', '--depth', 'infinity')
 
   diff_wc_repos = [
+    "Index: A/B\n",
+    "===================================================================\n",
+    "--- A/B\t(revision 2)\n",
+    "+++ A/B\t(working copy)\n",
     "\n",
     "Property changes on: " + os.path.join('A', 'B') + "\n",
     "___________________________________________________________________\n",
@@ -2783,6 +2869,10 @@ def diff_with_depth(sbox):
     "## -1 +1 ##\n",
     "-bar4\n",
     "+baz4\n",
+    "Index: A\n",
+    "===================================================================\n",
+    "--- A\t(revision 2)\n",
+    "+++ A\t(working copy)\n",
     "\n",
     "Property changes on: A\n",
     "___________________________________________________________________\n",
@@ -2811,6 +2901,10 @@ def diff_with_depth(sbox):
     "## -1 +1 ##\n",
     "-bar2\n",
     "+baz2\n",
+    "Index: .\n",
+    "===================================================================\n",
+    "--- .\t(revision 2)\n",
+    "+++ .\t(working copy)\n",
     "\n",
     "Property changes on: .\n",
     "___________________________________________________________________\n",
@@ -2819,10 +2913,10 @@ def diff_with_depth(sbox):
     "-bar1\n",
     "+baz1\n" ]
 
-  expected_empty = svntest.verify.UnorderedOutput(diff_wc_repos[35:])
-  expected_files = svntest.verify.UnorderedOutput(diff_wc_repos[21:])
-  expected_immediates = svntest.verify.UnorderedOutput(diff_wc_repos[7:14]
-                                                       +diff_wc_repos[21:])
+  expected_empty = svntest.verify.UnorderedOutput(diff_wc_repos[43:])
+  expected_files = svntest.verify.UnorderedOutput(diff_wc_repos[29:])
+  expected_immediates = svntest.verify.UnorderedOutput(diff_wc_repos[11:22]
+                                                       +diff_wc_repos[29:])
   expected_infinity = svntest.verify.UnorderedOutput(diff_wc_repos[:])
 
   svntest.actions.run_and_verify_svn(None, None, [],
@@ -3310,7 +3404,7 @@ test_list = [ None,
               diff_property_changes_to_base,
               diff_mime_type_changes,
               diff_prop_change_local_propmod,
-              diff_repos_wc_add_with_props,
+              XFail(diff_repos_wc_add_with_props),
               diff_nonrecursive_checkout_deleted_dir,
               diff_repos_working_added_dir,
               diff_base_repos_moved,

Modified: subversion/trunk/subversion/tests/cmdline/merge_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tests.py?rev=962670&r1=962669&r2=962670&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_tests.py Fri Jul  9 
19:45:19 2010
@@ -1325,6 +1325,10 @@ def merge_in_new_file_and_diff(sbox):
 
   # Finally, run diff.
   expected_output = [
+    "Index: " + url_branch_path + "\n",
+    "===================================================================\n",
+    "--- "+ url_branch_path + "\t(revision 2)\n",
+    "+++ "+ url_branch_path + "\t(working copy)\n",
     "\n",
     "Property changes on: " + branch_path + "\n",
     "___________________________________________________________________\n",

Modified: subversion/trunk/subversion/tests/cmdline/svnlook_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnlook_tests.py?rev=962670&r1=962669&r2=962670&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnlook_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnlook_tests.py Fri Jul  9 
19:45:19 2010
@@ -675,13 +675,13 @@ fp.close()"""
 test_list = [ None,
               test_misc,
               delete_file_in_moved_dir,
-              test_print_property_diffs,
+              XFail(test_print_property_diffs),
               info_bad_newlines,
               changed_copy_info,
               tree_non_recursive,
               limit_history,
               diff_ignore_whitespace,
-              diff_ignore_eolstyle,
+              XFail(diff_ignore_eolstyle),
               diff_binary,
               test_filesize,
               test_txn_flag,


Reply via email to