[PATCH 2 of 2] document the 'none:' filter and semantics of '!' filter entry

Matt Mackall mpm at selenic.com
Sun Apr 26 14:18:22 CDT 2009


On Sat, 2009-04-25 at 12:25 +1000, Mark Hammond wrote:
> # HG changeset patch
> # User Mark Hammond <mhammond at skippinet.com.au>
> # Date 1240625914 -36000
> # Node ID a5d7d94c0ea4408e45bb7d519212adb7fb403981
> # Parent  390b0842e5dd4c7d5ed9c5efcd82dbb1d29a1804
> document the 'none:' filter and semantics of '!' filter entry
> 
> diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt
> --- a/doc/hgrc.5.txt
> +++ b/doc/hgrc.5.txt
> @@ -110,11 +110,16 @@
>    Filter patterns are globs by default, rooted at the repository
>    root. For example, to match any file ending in ".txt" in the root
>    directory only, use the pattern "*.txt". To match any file ending
> -  in ".c" anywhere in the repository, use the pattern "**.c".
> +  in ".c" anywhere in the repository, use the pattern "**.c".  Filters
> +  are applied in the order they appear in the config files and only the
> +  first matching filter is applied.  This mean you will generally want
> +  to ensure more specific patterns are listed before wildcard patterns.
>  
> -  The filter command can start with a specifier, either "pipe:" or
> +  The filter command can start with a specifier, either "pipe:", "none:" or
>    "tempfile:". If no specifier is given, "pipe:" is used by default.
>  
> +  The "none:" command is builtin and skips tranformations.
> +
>    A "pipe:" command must accept data on stdin and return the
>    transformed data on stdout.
>  
> @@ -159,6 +164,39 @@
>      [decode]
>      **.txt = dumbdecode:
>  
> +  The filter command "!" disables all previous filter definitions for that
> +  pattern. The pattern indicated may still be subject to filtering if it
> +  matches other patterns. If you want to disable filtering completely for a
> +  file or pattern, add your pattern using the 'none:' filter.
> +
> +  To explain the differences, consider the following examples:
> +
> +    ## User's Mercurial.ini ##
> +    [encode]
> +    **.foo = dumbencode:
> +    ** = cleverencode:
> +
> +    ## Tree's .hg/hgrc file ##
> +    [encode]
> +    **.foo = !

Would my proposal for a generic '%unset **.foo' eliminate the need for
the ! syntax?

-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial-devel mailing list