Return-Path: X-Original-To: apmail-subversion-users-archive@minotaur.apache.org Delivered-To: apmail-subversion-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 38831D5A9 for ; Wed, 17 Oct 2012 10:32:05 +0000 (UTC) Received: (qmail 25956 invoked by uid 500); 17 Oct 2012 10:32:04 -0000 Delivered-To: apmail-subversion-users-archive@subversion.apache.org Received: (qmail 25851 invoked by uid 500); 17 Oct 2012 10:32:03 -0000 Mailing-List: contact users-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@subversion.apache.org Received: (qmail 25798 invoked by uid 99); 17 Oct 2012 10:32:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2012 10:32:02 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.109.42.8] (HELO einhorn.in-berlin.de) (192.109.42.8) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2012 10:31:53 +0000 X-Envelope-From: stsp@stsp.name Received: from ted.stsp.name (ted.stsp.name [217.197.84.34]) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id q9HAVNln014188 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 17 Oct 2012 12:31:23 +0200 Received: from ted.stsp.name (stsp@localhost [127.0.0.1]) by ted.stsp.name (8.14.5/8.14.3) with ESMTP id q9HAVNGP018144; Wed, 17 Oct 2012 12:31:23 +0200 (CEST) Received: (from stsp@localhost) by ted.stsp.name (8.14.5/8.14.3/Submit) id q9HAVMZh014695; Wed, 17 Oct 2012 12:31:22 +0200 (CEST) Date: Wed, 17 Oct 2012 12:31:22 +0200 From: Stefan Sperling To: Joshua Woodward-Clarke Cc: cz02 , users@subversion.apache.org Subject: Re: SVN patch IGNORES file without newline at end of file Message-ID: <20121017103122.GB31493@ted.stsp.name> Mail-Followup-To: Joshua Woodward-Clarke , cz02 , users@subversion.apache.org References: <50769DFB.6060208@cdak.net> <20121011191415.GC25766@byrne.stsp.name> <5077EA3B.9050002@cdak.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Virus-Checked: Checked by ClamAV on apache.org 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));