subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Sperling <>
Subject Re: SVN patch IGNORES file without newline at end of file
Date Wed, 17 Oct 2012 10:31:22 GMT
On Wed, Oct 17, 2012 at 01:17:03PM +1100, Joshua Woodward-Clarke wrote:
> I just tried it and can confirm that I am getting the same issue.
> (I am fairly new to SVN so I may have done somthing wrong)
> I am running Win XP SP3.
> I downloaded the files and tried applying the patches.
> I tried with with the TortoiseSVN "apply patch" and "svn patch" from the
> command line.
> Both time the first patch "p.patch" failed to do any changed to aaa.txt
> (only bbb.txt), while "p2.patch" changed both files.

Funny, I can now reproduce this problem on unix, too.
I don't understand what happened the first time I tried to reproduce it.

Anyway, the fix is trivial: There's a rouge 'break' statement which
causes an early exit from the parsing loop before the hunk is fully
processed, which means the hunk will be ignored.

Thanks for reporting this!
I'll commit this fix along with a regression test.

Index: subversion/libsvn_diff/parse-diff.c
--- subversion/libsvn_diff/parse-diff.c (revision 1398725)
+++ subversion/libsvn_diff/parse-diff.c (working copy)
@@ -595,7 +595,6 @@ parse_next_hunk(svn_diff_hunk_t **hunk,
                     original_end = hunk_text_end;
                   if (modified_end == 0)
                     modified_end = hunk_text_end;
-                  break;
               SVN_ERR(svn_io_file_seek(apr_file, APR_SET, &pos, iterpool));

View raw message