tests/test-bad-pull
author Edouard Gomez <ed.gomez@free.fr>
Sun, 04 Jan 2009 02:36:48 +0100
changeset 7583 77fec2d270ae
parent 5384 e3a0c092b4e2
child 7903 490e40816cbd
permissions -rwxr-xr-x
convert/gnuarch: parse continuation-of revisions in gnuarch source In GNU Arch, continuation-of was often used for: - tagging revisions - continue working on a project in a new archive, because arch was scaling poorly in revision numbers (cat-logs were slow to be parsed and scanned through) - very similar to the previous point, fork his own branch of a project. Parsing this header information will allow to 'follow' new history because it often hints at older/forked/personal revision trees. This patch however just implements the parsing of the continuation-of header. A followup patch will implement the proper use of this new information.

#!/bin/sh

hg clone http://localhost:$HGPORT/ copy
echo $?
test -d copy || echo copy: No such file or directory

cat > dumb.py <<EOF
import BaseHTTPServer, SimpleHTTPServer, os, signal

def run(server_class=BaseHTTPServer.HTTPServer,
        handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
    server_address = ('localhost', int(os.environ['HGPORT']))
    httpd = server_class(server_address, handler_class)
    httpd.serve_forever()

signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
run()
EOF

python dumb.py 2>/dev/null &
echo $! >> $DAEMON_PIDS

# give the server some time to start running
sleep 1

http_proxy= hg clone http://localhost:$HGPORT/foo copy2 2>&1 | \
    sed -e 's/404.*/404/' -e 's/Date:.*/Date:/'
echo $?

kill $!