tests/test-convert
author Matt Mackall <mpm@selenic.com>
Thu, 11 Oct 2007 00:46:54 -0500
changeset 5451 0a43875677b1
parent 5441 71e7c86adcb7
child 5556 61fdf2558c0a
permissions -rwxr-xr-x
revlog: break up compression of large deltas Python's zlib apparently makes an internal copy of strings passed to compress(). To avoid this, compress strings 1M at a time, then join them at the end if the result would be smaller than the original. For initial commits of large but compressible files, this cuts peak memory usage nearly in half.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5015
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     1
#!/bin/sh
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     2
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     3
echo "[extensions]" >> $HGRCPATH
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     4
echo "convert=" >> $HGRCPATH
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     5
5441
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
     6
hg help convert
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
     7
5015
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     8
hg init a
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     9
cd a
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    10
echo a > a
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    11
hg ci -d'0 0' -Ama
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    12
hg cp a b
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    13
hg ci -d'1 0' -mb
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    14
hg rm a
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    15
hg ci -d'2 0' -mc
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    16
hg mv b a
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    17
hg ci -d'3 0' -md
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    18
echo a >> a
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    19
hg ci -d'4 0' -me
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    20
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    21
cd ..
5028
36e8983fe44d test-convert: Hide warning about missing subversion bindings.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5015
diff changeset
    22
hg convert a 2>&1 | grep -v 'subversion python bindings could not be loaded'
5015
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    23
hg --cwd a-hg pull ../a
5441
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    24
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    25
touch bogusfile
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    26
echo % should fail
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    27
hg convert a bogusfile
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    28
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    29
mkdir bogusdir
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    30
chmod 000 bogusdir
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    31
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    32
echo % should fail
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    33
hg convert a bogusdir
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    34
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    35
echo % should succeed
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    36
chmod 700 bogusdir
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5028
diff changeset
    37
hg convert a bogusdir