sapling/tests/test-encode

49 lines
746 B
Plaintext
Raw Normal View History

2005-09-15 11:59:16 +04:00
#!/bin/sh
hg init
cat > .hg/hgrc <<EOF
[encode]
not.gz = tr a-z A-Z
*.gz = gzip -d
2005-09-15 11:59:16 +04:00
[decode]
not.gz = tr A-Z a-z
2005-09-15 11:59:16 +04:00
*.gz = gzip
EOF
echo "this is a test" | gzip > a.gz
echo "this is a test" > not.gz
hg add *
hg ci -m "test" -d "1000000 0"
2005-09-15 11:59:16 +04:00
echo %% no changes
hg status
touch *
2005-09-15 11:59:16 +04:00
echo %% no changes
hg status
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
2005-09-15 11:59:16 +04:00
echo %% check committed content was decoded
2005-09-15 11:59:16 +04:00
gunzip < a.gz
cat not.gz
2005-09-15 11:59:16 +04:00
rm *
hg co -C
2005-09-15 11:59:16 +04:00
echo %% check decoding of our new working dir copy
2005-09-15 11:59:16 +04:00
gunzip < a.gz
cat not.gz
echo %% check hg cat operation
hg cat a.gz
hg cat --decode a.gz | gunzip
mkdir subdir
cd subdir
hg -R .. cat ../a.gz
hg -R .. cat --decode ../a.gz | gunzip