[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn patch seems to mangle some properties, specifically svn:eol-style

From: Daniel Shahaf <danielsh_at_elego.de>
Date: Sat, 26 Nov 2011 09:17:44 +0200

Looks like it's a known issue, see

3430 @XFail()
3431 @Issue(3814)
3432 def patch_set_prop_no_eol(sbox):
3433 "patch doesn't append newline to properties"

3618 @XFail()
3619 @Issue(3991)
3620 def patch_lacking_trailing_eol(sbox):
3621 "patch file lacking trailing eol"

which are currently the only XFail tests in patch_tests.py. :)
https://svn.apache.org/repos/asf/subversion/trunk/subversion/tests/cmdline/patch_tests.py

Dimitry Andric wrote on Fri, Nov 25, 2011 at 18:58:23 +0100:
> I just encountered a possible issue with the new 'svn patch' command in
> Subversion 1.7.1 (r1186859). When the patchfile includes svn:eol-style
> property changes, they do not seem to get applied properly.
>
> An example patchfile is attached. It was generated by doing the
> following in some random svn working copy:
>
> $ echo foo > foo
> $ svn add foo
> A foo
> $ svn ps svn:eol-style native foo
> property 'svn:eol-style' set on 'foo'
> $ svn diff foo > foo.diff
>
> The foo.diff file now has the following fragment at the end:
>
> Added: svn:eol-style
> ## -0,0 +1 ##
> +native
>
> When you apply this patch to another working copy (or if you revert the
> file, then apply the patch), the svn:eol-style property gets an
> extraneous newline added, and svn diff subsequently prints an error
> about it:
>
> $ svn revert foo
> Reverted 'foo'
> $ rm foo
> $ svn patch foo.diff
> A foo
> $ svn pg svn:eol-style foo
> native
>
> $ svn diff foo
> svn: E135001: Unrecognized line ending style
>
> When you add arbitrary properties to a file, produce a diff, and use it
> with 'svn patch', it look like those properties get an added newline:
>
> $ echo bar > bar
> $ svn add bar
> A bar
> $ svn ps testprop1 testval1 bar
> property 'testprop1' set on 'bar'
> $ svn ps testprop2 testval2 bar
> property 'testprop2' set on 'bar'
> $ svn pg testprop1 bar
> testval1
> $ svn pg testprop2 bar
> testval2
> $ svn diff bar > bar.diff
> $ svn revert bar
> Reverted 'bar'
> $ rm bar
> $ svn patch bar.diff
> A bar
> $ svn pg testprop1 bar
> testval1
>
> $ svn pg testprop2 bar
> testval2
>
> $ svn diff bar
> Index: bar
> ===================================================================
> --- bar (revision 0)
> +++ bar (working copy)
> @@ -0,0 +1 @@
> +bar
>
> Property changes on: bar
> ___________________________________________________________________
> Added: testprop1
> ## -0,0 +1 ##
> +testval1
> Added: testprop2
> ## -0,0 +1 ##
> +testval2
>
> Any idea if I'm doing something wrong here? If it seems like a bug, I'd
> like to file a PR.

> Index: foo
> ===================================================================
> --- foo (revision 0)
> +++ foo (working copy)
> @@ -0,0 +1 @@
> +foo
>
> Property changes on: foo
> ___________________________________________________________________
> Added: svn:eol-style
> ## -0,0 +1 ##
> +native
Received on 2011-11-26 08:18:45 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.