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

[PATCH]Why do we store svn config section options in a case insensitive way?

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2007-05-21 17:06:11 CEST

Hi All,
I have seen one of our client trying to set 'svn:eol-style' to 'native'
for all 'makefile', 'Makefile' and all possible variants using autoprops.
It does not work in svn currently.

$cat ~/.subversion/config
enable-auto-props = yes

makefile* = svn:eol-style=native
Makefile* = svn:eol-style=native

WC$svn add Makefile
#This does not set the property 'svn:eol-style' on 'Makefile'.

WC$svn add makefile
#This does set the property 'svn:eol-style' on 'makefile'.

In essence autoprops for patterns differing only in case breaks all the
autoprops setting except the first one in the definition. Here autoprops
is active only for 'makefile*' not 'Makefile*'.

I tried '[mM][aA][kK][eE][fF][iI][lL][eE] = svn:eol-style=native' inside
the autoprops section, but it got confused to be a different section due
to preceding '['.

I have a patch which fixes the problem by populating the
section->options in a case sensitive keys. Find it attached.

Ran 'make check', it went well.

With regards
Kamesh Jayachandran

SVN config section option names are treated in a case insensitive way. This
breaks autoprops setting on a patterns which differs only in case.

$cat ~/.subversion/config
enable-auto-props = yes

makefile* = svn:eol-style=native
Makefile* = svn:eol-style=native

Only files matching 'makefile*' are getting autoprops set as it is defined first.

* subversion/libsvn_subr/config.c
  (svn_config_set): Keep the key of 'sec->options' to be 'opt->name'(as given
   in the config file) rather than 'opt->hash_key'(normalized lower case).

Patch by: kameshj

Index: subversion/libsvn_subr/config.c
--- subversion/libsvn_subr/config.c (revision 25079)
+++ subversion/libsvn_subr/config.c (working copy)
@@ -603,7 +603,7 @@
       apr_hash_set(cfg->sections, sec->hash_key, APR_HASH_KEY_STRING, sec);
- apr_hash_set(sec->options, opt->hash_key, APR_HASH_KEY_STRING, opt);
+ apr_hash_set(sec->options, opt->name, APR_HASH_KEY_STRING, opt);

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon May 21 17:06:01 2007

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