tests/test-encode
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
Wed, 10 Mar 2010 22:27:42 +0100
changeset 10635 27027bee318e
parent 10279 1c4ab236ebcb
child 12156 4c94b6d0fb1c
permissions -rwxr-xr-x
serve: fix port config
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1258
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
     1
#!/bin/sh
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
     2
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
     3
hg init
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
     4
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
     5
cat > .hg/hgrc <<EOF
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
     6
[encode]
10279
1c4ab236ebcb test-encode: Use tr chacter classes instead of character ranges
Mads Kiilerich <mads@kiilerich.com>
parents: 10211
diff changeset
     7
not.gz = tr [:lower:] [:upper:]
7080
a6477aa893b8 tests: Windows compatibility fixes
Patrick Mezard <pmezard@gmail.com>
parents: 6094
diff changeset
     8
*.gz = gzip -d
1258
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
     9
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    10
[decode]
10279
1c4ab236ebcb test-encode: Use tr chacter classes instead of character ranges
Mads Kiilerich <mads@kiilerich.com>
parents: 10211
diff changeset
    11
not.gz = tr [:upper:] [:lower:]
1258
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    12
*.gz = gzip
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    13
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    14
EOF
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    15
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    16
echo "this is a test" | gzip > a.gz
10211
a474f950357b Update test and man page for multiple matching encode/decode filters
Mads Kiilerich <mads@kiilerich.com>
parents: 8742
diff changeset
    17
echo "this is a test" > not.gz
a474f950357b Update test and man page for multiple matching encode/decode filters
Mads Kiilerich <mads@kiilerich.com>
parents: 8742
diff changeset
    18
hg add *
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1258
diff changeset
    19
hg ci -m "test" -d "1000000 0"
1258
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    20
echo %% no changes
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    21
hg status
10211
a474f950357b Update test and man page for multiple matching encode/decode filters
Mads Kiilerich <mads@kiilerich.com>
parents: 8742
diff changeset
    22
touch *
1258
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    23
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    24
echo %% no changes
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    25
hg status
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    26
10211
a474f950357b Update test and man page for multiple matching encode/decode filters
Mads Kiilerich <mads@kiilerich.com>
parents: 8742
diff changeset
    27
echo %% check contents in repo are encoded
3853
c0b449154a90 switch to the .hg/store layout, fix the tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1933
diff changeset
    28
hg debugdata .hg/store/data/a.gz.d 0
10211
a474f950357b Update test and man page for multiple matching encode/decode filters
Mads Kiilerich <mads@kiilerich.com>
parents: 8742
diff changeset
    29
hg debugdata .hg/store/data/not.gz.d 0
1258
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    30
10211
a474f950357b Update test and man page for multiple matching encode/decode filters
Mads Kiilerich <mads@kiilerich.com>
parents: 8742
diff changeset
    31
echo %% check committed content was decoded
1258
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    32
gunzip < a.gz
10211
a474f950357b Update test and man page for multiple matching encode/decode filters
Mads Kiilerich <mads@kiilerich.com>
parents: 8742
diff changeset
    33
cat not.gz
1258
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    34
10211
a474f950357b Update test and man page for multiple matching encode/decode filters
Mads Kiilerich <mads@kiilerich.com>
parents: 8742
diff changeset
    35
rm *
8742
a964ab624385 merge: allow merging going backwards
Matt Mackall <mpm@selenic.com>
parents: 7080
diff changeset
    36
hg co -C
1258
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    37
10211
a474f950357b Update test and man page for multiple matching encode/decode filters
Mads Kiilerich <mads@kiilerich.com>
parents: 8742
diff changeset
    38
echo %% check decoding of our new working dir copy
1258
1945754e466b Add file encoding/decoding support
mpm@selenic.com
parents:
diff changeset
    39
gunzip < a.gz
10211
a474f950357b Update test and man page for multiple matching encode/decode filters
Mads Kiilerich <mads@kiilerich.com>
parents: 8742
diff changeset
    40
cat not.gz
6093
f5b00b6e426a Option --decode for hg cat to apply decode filters.
Jesse Glick <jesse.glick@sun.com>
parents: 3853
diff changeset
    41
f5b00b6e426a Option --decode for hg cat to apply decode filters.
Jesse Glick <jesse.glick@sun.com>
parents: 3853
diff changeset
    42
echo %% check hg cat operation
f5b00b6e426a Option --decode for hg cat to apply decode filters.
Jesse Glick <jesse.glick@sun.com>
parents: 3853
diff changeset
    43
hg cat a.gz
6094
3998c1b0828f cat --decode: Drop short option, use opts.get() instead of opts[]
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6093
diff changeset
    44
hg cat --decode a.gz | gunzip
6093
f5b00b6e426a Option --decode for hg cat to apply decode filters.
Jesse Glick <jesse.glick@sun.com>
parents: 3853
diff changeset
    45
mkdir subdir
f5b00b6e426a Option --decode for hg cat to apply decode filters.
Jesse Glick <jesse.glick@sun.com>
parents: 3853
diff changeset
    46
cd subdir
f5b00b6e426a Option --decode for hg cat to apply decode filters.
Jesse Glick <jesse.glick@sun.com>
parents: 3853
diff changeset
    47
hg -R .. cat ../a.gz
6094
3998c1b0828f cat --decode: Drop short option, use opts.get() instead of opts[]
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6093
diff changeset
    48
hg -R .. cat --decode ../a.gz | gunzip