Mercurial > hg
view tests/test-archive @ 4358:11dc22eb8e8d
Fix segfaults when parsing bdiff hunks in mpatch.decode() and .patchedsize()
- fix off by 11 when checking if there are more hunks (found by Maris Fogels)
- bail out if start is greater than end
- check if new hunk starts after start/end/len block of current hunk as
the pointer can wrap around on very large values, reproducible with
import mpatch; mpatch.patchedsize(12, 'x'*12)
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Sat, 27 Jan 2007 23:07:06 +0100 |
parents | 83cfd95eafb5 |
children | ca023b63ba1f |
line wrap: on
line source
#!/bin/sh mkdir test cd test hg init echo foo>foo hg addremove hg commit -m 1 echo bar>bar hg addremove hg commit -m 2 mkdir baz echo bletch>baz/bletch hg addremove hg commit -m 3 echo "[web]" >> .hg/hgrc echo "name = test-archive" >> .hg/hgrc echo "allow_archive = gz bz2, zip" >> .hg/hgrc hg serve -p 20059 -d --pid-file=hg.pid cat hg.pid >> $DAEMON_PIDS TIP=`hg id -v | cut -f1 -d' '` QTIP=`hg id -q` cat > getarchive.py <<EOF import sys, urllib2 node, archive = sys.argv[1:] f = urllib2.urlopen('http://127.0.0.1:20059/?cmd=archive;node=%s;type=%s' % (node, archive)) sys.stdout.write(f.read()) EOF http_proxy= python getarchive.py "$TIP" gz | gunzip | tar tf - | sed "s/$QTIP/TIP/" http_proxy= python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - | sed "s/$QTIP/TIP/" http_proxy= python getarchive.py "$TIP" zip > archive.zip unzip -t archive.zip | sed "s/$QTIP/TIP/" hg archive -t tar test.tar tar tf test.tar hg archive -t tbz2 -X baz test.tar.bz2 bunzip2 -dc test.tar.bz2 | tar tf - hg archive -t tgz -p %b-%h test-%h.tar.gz gzip -dc test-$QTIP.tar.gz | tar tf - | sed "s/$QTIP/TIP/" hg archive -t zip -p /illegal test.zip hg archive -t zip -p very/../bad test.zip hg archive -t zip -r 2 test.zip unzip -t test.zip hg archive -t tar - | tar tf - | sed "s/$QTIP/TIP/"