view tests/test-audit-path @ 10128:ea7c392f2b08

patch: drop eol normalization fast-path for 'lf' and 'crlf' With eolmode set to 'lf' or 'crlf' we avoided the hunk duplication and normalization by reading the input patch in text mode. Dropping this optimization simplifies code expectations for a small overhead. The change in test-mq-eol comes from a tolerance to CRLF instead of LF for last lines without newlines being broken by this revision. This tolerance was only partially supported and will be added again in a better way.
author Patrick Mezard <pmezard@gmail.com>
date Wed, 23 Dec 2009 19:31:48 +0100
parents c6f3ff294fe0
children
line wrap: on
line source

#!/bin/sh

hg init

echo % should fail
hg add .hg/00changelog.i

mkdir a
echo a > a/a
hg ci -Ama
ln -s a b
echo b > a/b

echo % should fail
hg add b/b

echo % should succeed
hg add b

echo % should still fail - maybe
hg add b/b

echo % unbundle tampered bundle
hg init target
cd target
hg unbundle $TESTDIR/tampered.hg

echo % attack .hg/test
hg manifest -r0
hg update -Cr0

echo % attack foo/.hg/test
hg manifest -r1
hg update -Cr1

echo % attack back/test where back symlinks to ..
hg manifest -r2
hg update -Cr2

echo % attack ../test
hg manifest -r3
hg update -Cr3

echo % attack /tmp/test
hg manifest -r4
hg update -Cr4 2>&1 | sed -e "s|/.*/test-audit-path|[HGTMP]/test-audit-path|"

exit 0