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

Re: Some contrib stuff

From: Michael Haggerty <mhagger_at_alum.mit.edu>
Date: 2006-03-23 21:31:13 CET

Wilfredo Sánchez Vega wrote:
> I've got some scripts to submit to the contrib/ folder, if y'all want
> them:
>
> svn-apply-autoprops:
>
> http://svn.red-bean.com/wsanchez/trunk/svn-support/svn-apply- autoprops
>
> I think this does the same stuff as the svn-apply-autoprops.py that's
> already there, except:
> - it uses python's ConfigParser module rather than implementing
> it's own
> - it's BSD licensed instead of GPL
> - has some options:
> - "dry run" mode
> - choose an alternative config file
> - clear properties if not in config or if empty in config

We implemented setting properties via auto-props during repository
conversion in the cvs2svn project (so far, only in trunk). We also use
python's ConfigParser module. To see the code, look at the
AutoPropsPropertySetter class.

There is a subtlety to handling auto-props: case sensitivity of filename
patterns. This is discussed in the thread starting here:

    http://cvs2svn.tigris.org/servlets/ReadMsg?list=dev&msgNo=1219

Part of the problem is that subversion itself is not consistent about
how it handles filename case sensitivity for auto-props; see bug 2036:

    http://subversion.tigris.org/issues/show_bug.cgi?id=2036

For cvs2svn, we decided to handle the filenames case-sensitively. This
can only be done using ConfigParser from Python 2.1 or later. Please
note, if you turn on case sensitivity for ConfigParser, the section
headers are also treated case-sensitively; hence the following code to
find the "[auto-props]" section (which might be spelled "[AuTo-PRopS]'):

    for section in config.sections():
      if self.transform_case(section) == 'auto-props':
        for (pattern, value) in config.items(section):
          if value:
            self._add_pattern(pattern, value)

Please also note that SafeConfigParser is only available starting with
Python 2.3. This is not necessarily a problem, but it should probably
be noted in your script's comments.

I would also suggest the attached patch, which allows --clear-nomatch
and --clear-noprop to appear multiple times in the argument list. IMO
this is an intuitive interface improvement (and avoids one option
silently overwriting another one) that is trivial to implement.

Otherwise this script looks fine to me, though I didn't do any testing.

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Thu Mar 23 21:31:46 2006

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