You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Chris <de...@yahoo.se> on 2018/01/09 15:15:18 UTC
auto-props syntax in file vs. property
Hi,
I am really confused by how to set an auto-property when I need multiple "parameters" to a single property.
When setting svn:auto-props, it seems I can do this:
*.java = svn:mime-type=text/java;;charset=iso-8859-1;svn:eol-style=LF
That is, use ;; as an escape between the "parameters" for file type and charset. Adding a java-file and doing propget gives this:
text/java;charset=iso-8859-1
Which seems to be correct. Right?
Using the exact same line in ~/.subversion/config seems to see "charset" as a separate property from "mime-type" and set two different properties on the file with "charset" having no meaning. Using svn_apply_autoprops.py on that syntax at least gave me those separate props. A quick web search showed someone enclosing the entire property in quotes and only using a single semicolon, i.e.:
*.java = "svn:mime-type=text/java;charset=iso-8859-1";svn:eol-style=LF
Haven't tested this yet and I don't know if it works or not
I can't find anything in the manual (http://svnbook.red-bean.com/nightly/en/svn.advanced.props.html) describing what the right separator/escape sequence is for these two and if there's some common syntax that can be used for both.
If would have been nice if I could use the exact same syntax for both so I can just paste in filetype-part of the config file into the auto-props, but it won't kill me if I have to use separate ones, as long as I know how to use it :)
At least for a transition period, I will need to keep the config-file in order to run svn_apply_autoprops on files coming in from branches created added before we added svn:auto-props (and have wrong props) so I need both working and I'm unsure of what the right way for doing this is.
TIA,
Chris
Re: auto-props syntax in file vs. property
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Chris wrote on Tue, 09 Jan 2018 15:15 +0000:
> When setting svn:auto-props, it seems I can do this:
>
> *.java = svn:mime-type=text/java;;charset=iso-8859-1;svn:eol-style=LF
>
> That is, use ;; as an escape between the "parameters" for file type and
> charset. Adding a java-file and doing propget gives this:
> text/java;charset=iso-8859-1
> Which seems to be correct. Right?
Yes.
> Using the exact same line in ~/.subversion/config seems to see "charset"
> as a separate property from "mime-type" and set two different properties
> on the file with "charset" having no meaning.
I can't reproduce this. With that line in ~/.subversion/config I get:
[[[
% svn add foo.java
A foo.java
% svn pl -v foo.java
Properties on 'foo.java':
svn:eol-style
native
svn:mime-type
text/java;charset=iso-8859-1
]]]
(The value 'native' was inherited from svn:auto-props in the working
copy I was testing in.)
Also, does it really set *two* properties on the file? Not three? "svn:mime-type",
"charset", "svn:eol-style"?
What client and version do you use?
Cheers,
Daniel