diff --git a/tests/test-highlight b/tests/test-highlight --- a/tests/test-highlight +++ b/tests/test-highlight @@ -24,7 +24,7 @@ cat hg.pid >> $DAEMON_PIDS echo % hgweb filerevision, html ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/get-with-headers.py') \ - | sed "s/class=\"k\"/class=\"kn\"/g" + | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mf\"/class=\"mi\"/g" echo % hgweb filerevision, html ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/isolatin.txt') \ @@ -32,7 +32,7 @@ echo % hgweb filerevision, html echo % hgweb fileannotate, html ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/get-with-headers.py') \ - | sed "s/class=\"k\"/class=\"kn\"/g" + | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mi\"/class=\"mf\"/g" echo % hgweb fileannotate, raw ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/get-with-headers.py?style=raw') \ diff --git a/tests/test-highlight.out b/tests/test-highlight.out --- a/tests/test-highlight.out +++ b/tests/test-highlight.out @@ -75,7 +75,7 @@ files, or words in the commit message
line source
-
1 #!/usr/bin/env python
2
3 __doc__ = """This does HTTP get requests given a host:port and path and returns
4 a subset of the headers plus the body of the result."""
5
6 import httplib, sys, re
7
8 try:
9 import msvcrt, os
10 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
11 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
12 except ImportError:
13 pass
14
15 headers = [h.lower() for h in sys.argv[3:]]
16 conn = httplib.HTTPConnection(sys.argv[1])
17 conn.request("GET", sys.argv[2])
18 response = conn.getresponse()
19 print response.status, response.reason
20 for h in headers:
21 if response.getheader(h, None) is not None:
22 print "%s: %s" % (h, response.getheader(h))
23 print
24 data = response.read()
25 data = re.sub('\d+ years', 'many years', data)
26 sys.stdout.write(data)
27
28 if 200 <= response.status <= 299:
29 sys.exit(0)
30 sys.exit(1)
+
1 #!/usr/bin/env python
2
3 __doc__ = """This does HTTP get requests given a host:port and path and returns
4 a subset of the headers plus the body of the result."""
5
6 import httplib, sys, re
7
8 try:
9 import msvcrt, os
10 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
11 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
12 except ImportError:
13 pass
14
15 headers = [h.lower() for h in sys.argv[3:]]
16 conn = httplib.HTTPConnection(sys.argv[1])
17 conn.request("GET", sys.argv[2])
18 response = conn.getresponse()
19 print response.status, response.reason
20 for h in headers:
21 if response.getheader(h, None) is not None:
22 print "%s: %s" % (h, response.getheader(h))
23 print
24 data = response.read()
25 data = re.sub('\d+ years', 'many years', data)
26 sys.stdout.write(data)
27
28 if 200 <= response.status <= 299:
29 sys.exit(0)
30 sys.exit(1)