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

Re: SVN patch issue with property changes

From: Julian Foad <julianfoad_at_apache.org>
Date: Thu, 28 Jun 2018 21:08:09 +0100

Philip Martin wrote:
> Julian Foad <julianfoad_at_apache.org> writes:
> > Julian Foad wrote:
> >> The bug seems to be that 'svn patch' fails to apply any patch of
> >> this form, that tries to change a property value from empty to
> >> non-empty.
> >
> > I committed a test for this in http://svn.apache.org/r1834628
>
> I'm confused, you are treating as '' special? Suppose an existing
> property P has value 'foo'. Should a patch that adds P with value 'bar'

The issue is about a patch that *changes* the current value to another value, not a patch that *adds* a property.

I am pointing out that a patch that changes the empty value '' to 'bar' should be (and isn't being) applied successfully to a property that already has the empty value ''.

The patch format for modifying an empty value is mostly the same as the patch format for adding a new property:

[[[
Property changes on: f
___________________________________________________________________
Added: empty
## -0,0 +1 ##
+foo
\ No newline at end of property
]]]
vs.
[[[
Property changes on: f
___________________________________________________________________
Modified: empty
## -0,0 +1 ##
+foo
\ No newline at end of property
]]]

It's similar to the ambiguous patch representation of create a file or add text to an empty file. In that case, 'svn patch' first creates the file if it doesn't exist, and in both scenarios adds the patch text.

For a property patch, a property-patch header line specifies whether it's a modify or an add, so there is no ambiguity. If the patch asks to 'modify' from empty to non-empty, when the target property already exists and has an empty value, this should certainly succeed.

- Julian
Received on 2018-06-28 22:08:17 CEST

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.