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

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

From: Dimitry Andric <dimitry_at_andric.com>
Date: Fri, 25 Nov 2011 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.

Received on 2011-11-25 21:30:22 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.