[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: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Wed, 10 Jan 2018 19:51:52 +0000

Chris wrote on Wed, 10 Jan 2018 08:26 +0000:
> 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):

That's clever, but it will misparse sequences of three or more semicolons in a row, such as

*.foo = key=val;;with;;semicolons;;;anotherkey=anotherval

Daniel
Received on 2018-01-10 20:52:04 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.