Re: [PATCH] Case-insensitive MIME types
Michael Haggerty <[email protected]> Sun, 21 Mar 2010 08:25:36 +0100
| Newsgroups | gmane.comp.version-control.subversion.cvs2svn.devel |
|---|---|
| Message-ID | <[email protected]> |
Jon Foster wrote: > Our CVS repository lives on a Linux server, but most people use > Windows clients. As a result, the file extensions are a mix > of uppercase and lowercase. E.g. we have both .bat and .BAT > files. > > So I need cvs2svn's MIME types mechanism to treat filenames in > a case-insensitive way. I've attached a patch that adds this > option. The default behaviour is case-sensitive, for backward > compatibility. I haven't added a command-line option for this, > so you have to use the options file if you want case-insensitivity. > > Additionally, I've added a way to specify the MIME mappings in > the options file. This means there's only one file (options.py) > controlling the conversion, rather than two (options.py and > mime.types). This is also in the attached patch. > > I'd welcome any feedback or review of this patch. Since there are two new features here, I'll work on them separately. The first, adding an option to MimeMapper to treat filename extensions case-insensitively, I just committed. I renamed the constructor option from "case_insensitive" to "ignore_case" to be consistent with a similar option for AutoPropsPropertySetter. It might even make sense to change the default to be consistent with whether the operating system is case-sensitive or not, a la os.path.normcase(). On the other hand, the system being used to do the conversion is not necessarily the same as the system(s) that were used to commit under CVS. The second feature, to allow a mapping to be passed to the MimeMapper constructor, is not yet committed. But it looks good and I will get back to it when I can. Michael ------------------------------------------------------ http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=2462722 To unsubscribe from this discussion, e-mail: [[email protected]].