# HG changeset patch # User Dirkjan Ochtman # Date 1196634400 -3600 # Node ID 05451f6b5f07f9be5c18e5714a244e552d61f85f # Parent b90b72729a7292c8e0fc509f0fcd8f5d50e6ac7b add more tests for hgweb commands diff -r b90b72729a72 -r 05451f6b5f07 tests/test-hgweb-commands --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-hgweb-commands Sun Dec 02 23:26:40 2007 +0100 @@ -0,0 +1,48 @@ +#!/bin/sh +# An attempt at more fully testing the hgweb web interface. +# The following things are tested elsewhere and are therefore omitted: +# - archive, tested in test-archive +# - unbundle, tested in test-push-http +# - changegroupsubset, tested in test-pull + +echo % Set up the repo +hg init test +cd test +mkdir da +echo foo > da/foo +echo foo > foo +hg ci -Ambase +hg tag 1.0 +hg serve -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log +cat hg.pid >> $DAEMON_PIDS + +echo % Logs and changes +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/?style=atom' | sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//" +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/1/?style=atom' | sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//" +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/1/foo/?style=atom' | sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//" +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/shortlog/' | sed "s/[0-9]* years/many years/" +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/rev/1/?style=raw' + +echo % File-related +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/foo/?style=raw' +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/annotate/1/foo/?style=raw' +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/?style=raw' +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/filediff/1/foo/?style=raw' + +echo % Overviews +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/tags/?style=atom' | sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//" +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/summary/?style=gitweb' | sed "s/[0-9]* years ago/long ago/" + +echo % Internals +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/capabilities' +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/heads' +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/lookup/1' +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/branches' +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/changegroup' +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/stream_out' + +echo % Static files +"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/static/style.css' + +echo % ERRORS ENCOUNTERED +cat errors.log diff -r b90b72729a72 -r 05451f6b5f07 tests/test-hgweb-commands.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-hgweb-commands.out Sun Dec 02 23:26:40 2007 +0100 @@ -0,0 +1,435 @@ +% Set up the repo +adding da/foo +adding foo +% Logs and changes +200 Script output follows + + + + + http://127.0.0.1/ + + + test Changelog + 1970-01-01T00:00:00+00:00 + + + Added tag 1.0 for changeset 2ef0ac749a14 + http://127.0.0.1/mercurial/#changeset-a4f92ed23982be056b9852de5dfe873eaac7f0de + + + test + test + + 1970-01-01T00:00:00+00:00 + 1970-01-01T00:00:00+00:00 + +
+
Added tag 1.0 for changeset 2ef0ac749a14
+
+
+
+ + base + http://127.0.0.1/mercurial/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f + + + test + test + + 1970-01-01T00:00:00+00:00 + 1970-01-01T00:00:00+00:00 + +
+
base
+
+
+
+ +
+200 Script output follows + + + + + http://127.0.0.1/ + + + test Changelog + 1970-01-01T00:00:00+00:00 + + + Added tag 1.0 for changeset 2ef0ac749a14 + http://127.0.0.1/mercurial/#changeset-a4f92ed23982be056b9852de5dfe873eaac7f0de + + + test + test + + 1970-01-01T00:00:00+00:00 + 1970-01-01T00:00:00+00:00 + +
+
Added tag 1.0 for changeset 2ef0ac749a14
+
+
+
+ + base + http://127.0.0.1/mercurial/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f + + + test + test + + 1970-01-01T00:00:00+00:00 + 1970-01-01T00:00:00+00:00 + +
+
base
+
+
+
+ +
+200 Script output follows + + + + http://127.0.0.1/atom-log/tip/foo + + test: foo history + 1970-01-01T00:00:00+00:00 + + + base + http://127.0.0.1/mercurial/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f + + + test + test + + 1970-01-01T00:00:00+00:00 + 1970-01-01T00:00:00+00:00 + +
+
base
+
+
+
+ +
+200 Script output follows + + + + + + + + +test: shortlog + + + + + +
+changelog +tags +manifest + +rss +atom +
+ +

shortlog for test

+ +
+ +

+ + +navigate: (0) tip +

+
+ + + + + + + +
many yearstestAdded tag 1.0 for changeset 2ef0ac749a14
+ + + + + + +
many yearstestbase
+ + +
+ +

+ + +navigate: (0) tip +

+
+ + + + + + + +200 Script output follows + + +# HG changeset patch +# User test +# Date 0 0 +# Node ID a4f92ed23982be056b9852de5dfe873eaac7f0de +# Parent 2ef0ac749a14e4f57a5a822464a0902c6f7f448f +Added tag 1.0 for changeset 2ef0ac749a14 + +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 +@@ -0,0 +1,1 @@ ++2ef0ac749a14e4f57a5a822464a0902c6f7f448f 1.0 + +% File-related +200 Script output follows + +foo +200 Script output follows + + +test@0: foo + + + + +200 Script output follows + + +drwxr-xr-x da +-rw-r--r-- 45 .hgtags +-rw-r--r-- 4 foo + + +200 Script output follows + + +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/foo Thu Jan 01 00:00:00 1970 +0000 +@@ -0,0 +1,1 @@ ++foo + + + + +% Overviews +200 Script output follows + + + + http://127.0.0.1/ + + + test: tags + test tag history + Mercurial SCM + 1970-01-01T00:00:00+00:00 + + + 1.0 + + http://127.0.0.1/mercurial/#tag-2ef0ac749a14e4f57a5a822464a0902c6f7f448f + 1970-01-01T00:00:00+00:00 + 1970-01-01T00:00:00+00:00 + 1.0 + + + +200 Script output follows + + + + + + + + + + +test: Summary + + + + + + + + + +
 
+ + + + +
descriptionunknown
ownerunknown
last changeThu, 01 Jan 1970 00:00:00 +0000
+ +
changes
+ + + +
long agotestAdded tag 1.0 for changeset 2ef0ac749a14 default tip
37 years agotestbase 1.0
...
+ +
tags
+ + + +
long ago1.0
...
+ +
branches
+ + + + + +
long agoa4f92ed23982default
...
+ + + + +% Internals +200 Script output follows + +lookup changegroupsubset unbundle=HG10GZ,HG10BZ,HG10UN200 Script output follows + +a4f92ed23982be056b9852de5dfe873eaac7f0de +200 Script output follows + +0 'key' +200 Script output follows + +a4f92ed23982be056b9852de5dfe873eaac7f0de 2ef0ac749a14e4f57a5a822464a0902c6f7f448f 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 +200 Script output follows + +xœc`@ +1 +% Static files +200 Script output follows + +a { text-decoration:none; } +.age { white-space:nowrap; } +.date { white-space:nowrap; } +.indexlinks { white-space:nowrap; } +.parity0 { background-color: #dddddd; } +.parity1 { background-color: #eeeeee; } +.lineno { width: 60px; color: #aaaaaa; font-size: smaller; + text-align: right; padding-right:1em; } +.plusline { color: green; } +.minusline { color: red; } +.atline { color: purple; } +.annotate { font-size: smaller; text-align: right; padding-right: 1em; } +.buttons a { + background-color: #666666; + padding: 2pt; + color: white; + font-family: sans; + font-weight: bold; +} +.navigate a { + background-color: #ccc; + padding: 2pt; + font-family: sans; + color: black; +} + +.metatag { + background-color: #888888; + color: white; + text-align: right; +} + +/* Common */ +pre { margin: 0; } + +.logo { + background-color: #333; + padding: 4pt; + margin: 8pt 0 8pt 8pt; + font-family: sans; + font-size: 60%; + color: white; + float: right; + clear: right; + text-align: left; +} + +.logo a { + font-weight: bold; + font-size: 150%; + color: #999; +} + +/* Changelog/Filelog entries */ +.logEntry { width: 100%; } +.logEntry .age { width: 15%; } +.logEntry th { font-weight: normal; text-align: right; vertical-align: top; } +.logEntry th.age, .logEntry th.firstline { font-weight: bold; } +.logEntry th.firstline { text-align: left; width: inherit; } + +/* Shortlog entries */ +.slogEntry { width: 100%; } +.slogEntry .age { width: 8em; } +.slogEntry td { font-weight: normal; text-align: left; vertical-align: top; } +.slogEntry td.author { width: 15em; } + +/* Tag entries */ +#tagEntries { list-style: none; margin: 0; padding: 0; } +#tagEntries .tagEntry { list-style: none; margin: 0; padding: 0; } + +/* Changeset entry */ +#changesetEntry { } +#changesetEntry th { font-weight: normal; background-color: #888; color: #fff; text-align: right; } +#changesetEntry th.files, #changesetEntry th.description { vertical-align: top; } + +/* File diff view */ +#filediffEntry { } +#filediffEntry th { font-weight: normal; background-color: #888; color: #fff; text-align: right; } + +% ERRORS ENCOUNTERED