You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by jc...@apache.org on 2011/01/11 02:31:16 UTC

svn commit: r1057435 - /subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_file.c

Author: jcorvel
Date: Tue Jan 11 01:31:16 2011
New Revision: 1057435

URL: http://svn.apache.org/viewvc?rev=1057435&view=rev
Log:
On the diff-optimizations-bytes branch:

Remove the early exit of prefix scanning when it reached the end of all
files. This is incorrect, because the prefix is entirely gobbled up, yet the
prefix_lines count doesn't count the last line if it doesn't end in an eol.

In normal diff (diff2) this doesn't really matter, because the diff output is
correct even without the last line being indicated as a matching line. But it
causes problems when using prefix scanning with diff3 (merge_tests.py 61 and
merge_reintegrate_tests.py 1, 2, 10, 13 and 14 failed because of this).

* subversion/libsvn_diff/diff_file.c
  (find_identical_prefix): Don't exit early if all files reach their end
   during prefix scanning. Just let the normal flow do its thing (which will
   unroll the last line if it wasn't a complete line, which will cause
   get_next_token later on to return this last line as a token).

Modified:
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_file.c

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_file.c?rev=1057435&r1=1057434&r2=1057435&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_file.c Tue Jan 11 01:31:16 2011
@@ -389,7 +389,7 @@ find_identical_prefix(svn_boolean_t *rea
                       apr_pool_t *pool)
 {
   svn_boolean_t had_cr = FALSE;
-  svn_boolean_t is_match, reached_all_eof;
+  svn_boolean_t is_match;
   apr_size_t i;
 
   *prefix_lines = 0;
@@ -426,12 +426,6 @@ find_identical_prefix(svn_boolean_t *rea
           is_match = is_match && *file[0]->curp == *file[i]->curp;
     }
 
-  /* If all files reached their end (i.e. are fully identical), we're done */
-  for (i = 0, reached_all_eof = TRUE; i < file_len; i++)
-    reached_all_eof = reached_all_eof && file[i]->curp == file[i]->endp;
-  if (reached_all_eof)
-    return SVN_NO_ERROR;
-
   if (had_cr)
     {
       /* Check if we ended in the middle of a \r\n for one file, but \r for