[PATCH] convert: changed the filemapper filtering algorithm to prefer more specific include/exclude rules

Patrick Mézard pmezard at gmail.com
Wed Nov 18 15:09:30 CST 2009


Štefan Šimek a écrit :
> Hi,
> 
> I'm resubmitting this patch (originally submitted on 2009-11-10)
> 
> This is a patch to make the filemapper filtering functionality in the
> convert extension a bit more usable.
> 
> I've noticed that currently even the example specified in the wiki
> doesn't work. Using a file filter such as:
> 
> exclude "doc"
> include "doc/foo.txt"
> 
> will not include the foo.txt simply because an exclusion exists (if
> not inc or exc).
> 
> I've modified the algorithm to honor the length of the inclusion or
> exclusion string, so that a longer (more specific) directive takes
> precedence.
> 
> I've also had to move the '.', name in rparse() to the end, otherwise
> it wouldn't be possible to use filemaps such as
> 
> include "."
> exclude "bin"
> include "bin/something"
> 
> because the '.' would be matched first for bin/something/** (and end
> up being too short to avoid exclusion against bin)
> 
> Regards,
> Stefan
> 
> # HG changeset patch
> # User Stefan Simek <simek at triaxis.sk>
> # Date 1257854643 -3600
> # Node ID 43625323c297dfcdb814208affb60e5cbae4923b
> # Parent  a40ec11795c3fd9df7b8b22da797ba1974a46326
> convert: changed the filemapper filtering algorithm to prefer more
> specific include/exclude rules

In crew as http://hg.intevation.org/mercurial/crew/rev/2dd700a35fd1 , thanks !

I have tailored the log message a little, and added a test.

Also, please go to this page

  http://mercurial.selenic.com/wiki/Relicensing

and send a mail to Matt Mackall indicating that you're okay with an
eventual relicensing of your change to GPLv2+ instead of GPLv2.

--
Patrick Mézard


More information about the Mercurial-devel mailing list