[ 
https://issues.apache.org/jira/browse/SVN-4607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15037753#comment-15037753
 ] 

Philip Martin edited comment on SVN-4607 at 12/3/15 1:06 PM:
-------------------------------------------------------------

I've proposed r1705038 for 1.9, it fixes the issue and has some regression test 
changes. The same revision merges cleanly into 1.8 as well.


was (Author: philipm):
I've proposed r1705038 for 1.9, it fixes the issue and has some regression test 
changes.

> patch file missing a trailing newline removes a newline when applied
> --------------------------------------------------------------------
>
>                 Key: SVN-4607
>                 URL: https://issues.apache.org/jira/browse/SVN-4607
>             Project: Subversion
>          Issue Type: Bug
>          Components: libsvn_client
>            Reporter: Philip Martin
>
> This problem is present in the 1.8 and 1.9 releases but has already been 
> fixed in 1.10.
> A patch file that is missing a trailing newline can remove a newline 
> elsewhere in the file:
> svnadmin create repo
> svnmucc -mm -U file://`pwd`/repo \
>   put <(printf "a\nb\nc\nd\ne\nf\n") f
> svn co file://`pwd`/repo wc
> printf "x\na\nb\nc\nd\ne\nf\n" > wc/f
> (cd wc && svn diff) > patch.txt
> svn revert wc/f
> The patch inserts one line:
> $ cat patch.txt
> Index: f
> ===================================================================
> --- f (revision 1)
> +++ f (working copy)
> @@ -1,3 +1,4 @@
> +x
>  a
>  b
>  c
> Strip the final newline from the patch:
> $ dd bs=1 count=144 if=patch.txt of=patch-noeol.txt
> When applied this patch still adds a line but is also removes a newline in a 
> different location:
> $ svn patch patch-noeol.txt wc
> U         wc/f
> $ svn diff wc
> Index: wc/f
> ===================================================================
> --- wc/f      (revision 1)
> +++ wc/f      (working copy)
> @@ -1,6 +1,6 @@
> +x
>  a
>  b
> -c
> -d
> +cd
>  e
>  f



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to