tests/test-patch
author Renato Cunha <renatoc@gmail.com>
Wed, 14 Jul 2010 22:58:29 -0300
changeset 11564 9bbfeba33aa3
parent 4645 0de7e6e27fe4
permissions -rwxr-xr-x
record: removed 'has_key' usage Py3k has removed the dictionary has_key method. This patch implements a one argument function that can be used as a callback by hg.revert in the record extension.

#!/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