[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: Chris <devnullaccount_at_yahoo.se>
Date: Wed, 10 Jan 2018 08:26:00 +0000 (UTC)

I think the fix to svn_apply_autoprops.py should be something like below (/subversion/trunk/contrib/client-side/svn_apply_autoprops.py)
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 non-existing)

Index: svn_apply_autoprops.py
--- svn_apply_autoprops.py (revision 103617)
+++ svn_apply_autoprops.py (revision 103618)
@@ -101,7 +101,11 @@
     # leading and trailing whitespce from the propery names and
     # values.
     props_list = []
- for prop in props.split(';'):
+ # Since ;; is a separator within one property, we need to do
+ # regex and use both negative lookahead and lookbehind to avoid
+ # ever matching a more than one semicolon in the split
+ semicolonpattern = re.compile("(?<!;);(?!;)")
+ for prop in re.split(semicolonpattern, props):
       prop = prop.strip()
       if not len(prop):


On Wed, 1/10/18, Chris <devnullaccount_at_yahoo.se> wrote:

 Subject: Re: auto-props syntax in file vs. property
 To: users_at_subversion.apache.org, "Daniel Shahaf" <d.s_at_daniel.shahaf.name>
 Date: Wednesday, January 10, 2018, 8:25 AM
 Hi Daniel,
 thanks for the reply.
 You're right that it seems to work when
 I do "svn add" and with that config file, but when I do the
 same with svn_apply_autoprops.py, it acts badly. I simply
 forgot to check the regular add :)
 So I get the problem when I do:
 --config myconfig /path/to/workspace
 Then it will set charset and mime-type
 as two separate properties.
 (and yes, it sets 3 properties overall,
 I just meant that the mime-type got split into two)
 I guess there's something in the parser
 in svn_apply_autoprops that is misbehaving rather than svn
 itself. A quick look in that file shows this line:
     for prop in
 Which I suspect is the root cause of
 the issue, although I haven't verified it yet. I guess I
 need to figure out some python basics and see if I can
 ugly-hack that to work for double semicolons.
 On Tue, 1/9/18, Daniel Shahaf <d.s_at_daniel.shahaf.name>
  Subject: Re: auto-props syntax in file
 vs. property
  To: users_at_subversion.apache.org
  Date: Tuesday, January 9, 2018, 5:05
  Chris wrote on Tue, 09 Jan 2018
  15:15 +0000:
> When setting
  svn:auto-props, it seems I can do
>  *.java =
> That is, use ;; as
  an escape between the "parameters" for
 file type
> charset. Adding a java-file and
  doing propget gives this:
> 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
> 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
  (The value
  'native' was inherited from
 svn:auto-props in the
  copy I was testing in.)
  Also, does it really set *two*
  properties on the file?  Not
  What client and version do you use?
Received on 2018-01-10 09:26:22 CET

This is an archived mail posted to the Subversion Users mailing list.