subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris <>
Subject Re: auto-props syntax in file vs. property
Date Thu, 22 Feb 2018 12:52:12 GMT
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

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

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'

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.

My guess is that the former is the intended behavior and I should not be passing in the ";;"
into the manual command, 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?


On Wed, 1/10/18, Daniel Shahaf <> wrote:

 Subject: Re: auto-props syntax in file vs. property
 To: "Chris" <>,
 Date: Wednesday, January 10, 2018, 8:51 PM
 Chris wrote on Wed, 10 Jan 2018
 08:26 +0000:
 > I think the fix to should be something like below 
 > If anyone with commit rights wants to fix
 it on the repo, feel free to 
 > use the
 below, or improve it as necessary (my python knowledge is
 > existing)
 > Index:
 > ---     
 (revision 103617)
 > +++      (revision 103618)
 > @@ -101,7 +101,11 @@
 >      # leading and trailing whitespce
 from the propery names and
 >      #
 >      props_list = []
 > -    for prop in
 > +    #
 Since ;; is a separator within one property, we need to
 > +    # regex and use both negative
 lookahead and lookbehind to avoid
 > + 
   # ever matching a more than one semicolon in the split
 > +    semicolonpattern =
 +    for prop in re.split(semicolonpattern, props):
 That's clever, but it will
 misparse sequences of three or more semicolons in a row,
 such as
 *.foo =

View raw message