view tests/test-patch @ 11035:e4f911ce21de stable

schemes: fix // breakage with Python 2.6.5 (issue2111) Recent Pythons (e.g. 2.6.5 and 3.1) introduce a change that causes urlparse.urlunparse(urlparse.urlparse('x://')) to return 'x:' instead of 'x://'i and urlparse.urlunparse(urlparse.urlparse('x:///y')) to return 'x:/y' instead of 'x:///y'. Fix url.hidepassword() and url.removeauth() to handle these cases.
author Michael Glassford <glassfordmjg@gmail.com>
date Thu, 08 Apr 2010 11:00:46 -0400
parents 0de7e6e27fe4
children
line wrap: on
line source

#!/bin/sh

cat > patchtool.py <<EOF
import sys
print 'Using custom patch'
if '--binary' in sys.argv:
    print '--binary found !'
EOF

echo "[ui]" >> $HGRCPATH
echo "patch=python ../patchtool.py" >> $HGRCPATH

hg init a
cd a
echo a > a
hg commit -Ama -d '1 0'
echo b >> a
hg commit -Amb -d '2 0'
cd ..

# This test check that:
# - custom patch commands with arguments actually works
# - patch code does not try to add weird arguments like
# --binary when custom patch commands are used. For instance
# --binary is added by default under win32.

echo % check custom patch options are honored
hg --cwd a export -o ../a.diff tip
hg clone -r 0 a b

hg --cwd b import -v ../a.diff