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

Re: auto-props syntax in file vs. property

From: Branko Čibej <brane_at_apache.org>
Date: Thu, 22 Feb 2018 14:10:24 +0100

On 22.02.2018 13:52, Chris wrote:
> Re-awakening my previous thread about the auto-properties. I get really confused by where to use ;; and ; as a separator.
>
> I currently have this in the auto-props on the repo:
> *.txt = svn:mime-type=text/plain;;charset=iso-8859-1;svn:eol-style=LF
>
> And then if I add a text file:
> prompt> touch foo.txt; svn add foo.txt; svn pg svn:mime-type foo.txt
> A foo.txt
> text/plain;charset=iso-8859-1

More completely: an 'svn proplist -v' would show the folloing properties:

    svn:mime-type=text/plain;charset=iso-8859-1
    svn:eol-style=LF

> So the property itself is with just one semicolon in there despite the auto-prop having ;;
> Is this the correct behavior?

Yes of course. In the auto-props configuration, a single colon separates
individual properties. If you want a colon within a property value, you
have to write ;; in the auto-props configuration to get the ; in the
property value.

If instead you'd had this auto-props configuration:

*.txt = svn:mime-type=text/plain;charset=iso-8859-1;svn:eol-style=LF

Then, when you added a file to Subversion, you'd get the following
properties set:

    svn:mime-type=text/plain
    charset=iso-8859-1
    svn:eol-style=LF

which is probably not what you want.

> While if I to the same thing manually, i.e.
>
> prompt> touch foo; svn add foo; svn propset svn:mime-type "text/plain;;charset=iso-8859-1" foo; svn pg svn:mime-type foo
> A foo
> property 'svn:mime-type' set on 'foo'
> text/plain;;charset=iso-8859-1
>
> That is, I'm passing in the exact string that I have in my auto-props into propset for a file without .txt-suffix so I don't get the auto-properties. But as you see in the resulting property that I now have has double semi-colons.

On the command-line you can only set a singly property value at a time,
so there's no need to escape the ';' delimiter.
But the auto-props configuration isn't a single property; it's several
properties, delimited with a single ';'.

> My guess is that the former is the intended behavior and I should not be passing in the ";;" into the manual command,

Yes.

> but I'm getting really confused here. I seems very error-prone that manual propset can't use the strings from the config file or auto-props wihtout getting a different result.
>
> Which version is the correct one, or do both actually do the job?

Each does its job in its own context.

-- Brane
Received on 2018-02-22 14:10:29 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.