comparison tests/test-encode.t @ 12416:1fcdd9b7f657

tests: unify test-encode
author Matt Mackall <mpm@selenic.com>
date Sun, 26 Sep 2010 13:41:32 -0500
parents tests/test-encode@4c94b6d0fb1c
children ec5886db9dc6
comparison
equal deleted inserted replaced
12415:1ff3fc4b6a66 12416:1fcdd9b7f657
1 Test encode/decode filters
2
3 $ hg init
4 $ cat > .hg/hgrc <<EOF
5 > [encode]
6 > not.gz = tr [:lower:] [:upper:]
7 > *.gz = gzip -d
8 > [decode]
9 > not.gz = tr [:upper:] [:lower:]
10 > *.gz = gzip
11 > EOF
12 $ echo "this is a test" | gzip > a.gz
13 $ echo "this is a test" > not.gz
14 $ hg add *
15 $ hg ci -m "test"
16
17 no changes
18
19 $ hg status
20 $ touch *
21
22 no changes
23
24 $ hg status
25
26 check contents in repo are encoded
27
28 $ hg debugdata .hg/store/data/a.gz.d 0
29 this is a test
30 $ hg debugdata .hg/store/data/not.gz.d 0
31 THIS IS A TEST
32
33 check committed content was decoded
34
35 $ gunzip < a.gz
36 this is a test
37 $ cat not.gz
38 this is a test
39 $ rm *
40 $ hg co -C
41 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
42
43 check decoding of our new working dir copy
44
45 $ gunzip < a.gz
46 this is a test
47 $ cat not.gz
48 this is a test
49
50 check hg cat operation
51
52 $ hg cat a.gz
53 this is a test
54 $ hg cat --decode a.gz | gunzip
55 this is a test
56 $ mkdir subdir
57 $ cd subdir
58 $ hg -R .. cat ../a.gz
59 this is a test
60 $ hg -R .. cat --decode ../a.gz | gunzip
61 this is a test