tests/test-schemes
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Sat, 14 Aug 2010 01:30:54 +0200
branchstable
changeset 11892 2be70ca17311
parent 11154 17031fea4e95
permissions -rwxr-xr-x
encoding: improve handling of buggy getpreferredencoding() on Mac OS X Prior to version 2.7, calling locale.getpreferredencoding() would always return 'mac-roman' on Mac OS X. Previously, this was handled by a call to locale.setlocale(). Unfortunately, Python 2.6.5 and older have a bug where isspace() would incorrectly report True for 0x85 and 0xa0 after such a call. In order to fix this, we replace the previous _encodingfixup mapping to an _encodingfixers mapping. Rather than mapping encodings to their replacement, it maps them to a function returning the replacement. This allows us to provide an simplified implementation of getpreferredencoding() which extracts the expected encoding and restores the locale. This fix is based on a patch originally submitted by Martijn Pieters as well as feedback from Brodie Rao.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9964
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
     1
#!/bin/sh
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
     2
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
     3
cat <<EOF >> $HGRCPATH
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
     4
[extensions]
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
     5
schemes=
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
     6
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
     7
[schemes]
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
     8
l = http://localhost:$HGPORT/
10070
9d1195b2f00d schemes: url parts are counted from 1
Alexander Solovyov <piranha@piranha.org.ua>
parents: 9964
diff changeset
     9
parts = http://{1}:$HGPORT/
11154
17031fea4e95 expand paths to local repository or bundle in appropriate classes
Alexander Solovyov <piranha@piranha.org.ua>
parents: 10070
diff changeset
    10
z = file:\$PWD/
9964
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    11
EOF
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    12
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    13
hg init test
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    14
cd test
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    15
echo a > a
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    16
hg ci -Am initial
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    17
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    18
hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    19
cat hg.pid >> $DAEMON_PIDS
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    20
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    21
hg incoming l://
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    22
10070
9d1195b2f00d schemes: url parts are counted from 1
Alexander Solovyov <piranha@piranha.org.ua>
parents: 9964
diff changeset
    23
echo % check that {1} syntax works
9d1195b2f00d schemes: url parts are counted from 1
Alexander Solovyov <piranha@piranha.org.ua>
parents: 9964
diff changeset
    24
hg incoming --debug parts://localhost | sed 's/[0-9]//g'
9d1195b2f00d schemes: url parts are counted from 1
Alexander Solovyov <piranha@piranha.org.ua>
parents: 9964
diff changeset
    25
11154
17031fea4e95 expand paths to local repository or bundle in appropriate classes
Alexander Solovyov <piranha@piranha.org.ua>
parents: 10070
diff changeset
    26
echo % check that paths are expanded
17031fea4e95 expand paths to local repository or bundle in appropriate classes
Alexander Solovyov <piranha@piranha.org.ua>
parents: 10070
diff changeset
    27
PWD=`pwd` hg incoming z://
17031fea4e95 expand paths to local repository or bundle in appropriate classes
Alexander Solovyov <piranha@piranha.org.ua>
parents: 10070
diff changeset
    28
9964
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    29
echo % errors
e600ad9bc257 schemes extension
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    30
cat errors.log