[PATCH] Update test and man page for multiple matching encode/decode filters

Mads Kiilerich mads at kiilerich.com
Mon Jan 4 20:23:41 CST 2010


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1262658045 -3600
# Node ID 02f840cc48e5301738691a6fcd9859b094a8d164
# Parent  7e26d2c529be5fba013f4305bbac754dfb192379
Update test and man page for multiple matching encode/decode filters

diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt
--- a/doc/hgrc.5.txt
+++ b/doc/hgrc.5.txt
@@ -202,6 +202,7 @@
 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``.
+For each file only the first matching filter applies.
 
 The filter command can start with a specifier, either ``pipe:`` or
 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
diff --git a/tests/test-encode b/tests/test-encode
--- a/tests/test-encode
+++ b/tests/test-encode
@@ -4,34 +4,40 @@
 
 cat > .hg/hgrc <<EOF
 [encode]
+not.gz = tr a-z A-Z
 *.gz = gzip -d
 
 [decode]
+not.gz = tr A-Z a-z
 *.gz = gzip
 
 EOF
 
 echo "this is a test" | gzip > a.gz
-hg add a.gz
+echo "this is a test" > not.gz
+hg add *
 hg ci -m "test" -d "1000000 0"
 echo %% no changes
 hg status
-touch a.gz
+touch *
 
 echo %% no changes
 hg status
 
-echo %% uncompressed contents in repo
+echo %% check contents in repo are encoded
 hg debugdata .hg/store/data/a.gz.d 0
+hg debugdata .hg/store/data/not.gz.d 0
 
-echo %% uncompress our working dir copy
+echo %% check committed content was decoded
 gunzip < a.gz
+cat not.gz
 
-rm a.gz
+rm *
 hg co -C
 
-echo %% uncompress our new working dir copy
+echo %% check decoding of our new working dir copy
 gunzip < a.gz
+cat not.gz
 
 echo %% check hg cat operation
 hg cat a.gz
diff --git a/tests/test-encode.out b/tests/test-encode.out
--- a/tests/test-encode.out
+++ b/tests/test-encode.out
@@ -1,11 +1,14 @@
 %% no changes
 %% no changes
-%% uncompressed contents in repo
+%% check contents in repo are encoded
 this is a test
-%% uncompress our working dir copy
+THIS IS A TEST
+%% check committed content was decoded
 this is a test
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-%% uncompress our new working dir copy
+this is a test
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+%% check decoding of our new working dir copy
+this is a test
 this is a test
 %% check hg cat operation
 this is a test


More information about the Mercurial-devel mailing list