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

Mark Hammond mhammond at skippinet.com.au
Fri Apr 24 21:25:43 CDT 2009


# 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 = !
+
+  In the example above, '*.foo' files will have cleverencoding applied; the
+  entry in the .hgrc file has the effect of disabling the **.foo pattern in
+  Mercurual.ini, so '*.foo' files then match the '**' pattern.  However,
+  consider the following configuration:
+
+    ## User's Mercurial.ini ##
+    [encode]
+    **.foo = dumbencode:
+    ** = cleverencode:
+
+    ## Tree's .hg/hgrc file ##
+    [encode]
+    **.foo = none:
+
+  In this example, '*.foo' files will have the 'none:' encoding applied
+  meaning the contents of the file are not touched by the encoding process.
+
 [[defaults]]
 defaults::
   Use the [defaults] section to define command defaults, i.e. the


More information about the Mercurial-devel mailing list