$ "$TESTDIR/hghave" serve || exit 80 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 Set up the repo $ hg init test $ cd test $ mkdir da $ echo foo > da/foo $ echo foo > foo $ hg ci -Ambase adding da/foo adding foo $ hg tag 1.0 $ hg bookmark something $ hg bookmark -r0 anotherthing $ echo another > foo $ hg branch stable marked working directory as branch stable (branches are permanent and global, did you want a bookmark?) $ hg ci -Ambranch $ hg branch unstable marked working directory as branch unstable (branches are permanent and global, did you want a bookmark?) $ hg ci -Ambranch $ echo [graph] >> .hg/hgrc $ echo default.width = 3 >> .hg/hgrc $ echo stable.width = 3 >> .hg/hgrc $ echo stable.color = FF0000 >> .hg/hgrc $ hg serve --config server.uncompressed=False -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log $ cat hg.pid >> $DAEMON_PIDS Logs and changes $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/?style=atom' 200 Script output follows http://*:$HGPORT/ (glob) (glob) (glob) test Changelog 1970-01-01T00:00:00+00:00 branch http://*:$HGPORT/#changeset-ba87b23d29ca67a305625d81a20ac279c1e3f444 (glob) (glob) test test 1970-01-01T00:00:00+00:00 1970-01-01T00:00:00+00:00
branch
branch http://*:$HGPORT/#changeset-1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe (glob) (glob) test test 1970-01-01T00:00:00+00:00 1970-01-01T00:00:00+00:00
branch
Added tag 1.0 for changeset 2ef0ac749a14 http://*:$HGPORT/#changeset-a4f92ed23982be056b9852de5dfe873eaac7f0de (glob) (glob) 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://*:$HGPORT/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f (glob) (glob) test test 1970-01-01T00:00:00+00:00 1970-01-01T00:00:00+00:00
base
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/1/?style=atom' 200 Script output follows http://*:$HGPORT/ (glob) (glob) (glob) test Changelog 1970-01-01T00:00:00+00:00 branch http://*:$HGPORT/#changeset-ba87b23d29ca67a305625d81a20ac279c1e3f444 (glob) (glob) test test 1970-01-01T00:00:00+00:00 1970-01-01T00:00:00+00:00
branch
branch http://*:$HGPORT/#changeset-1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe (glob) (glob) test test 1970-01-01T00:00:00+00:00 1970-01-01T00:00:00+00:00
branch
Added tag 1.0 for changeset 2ef0ac749a14 http://*:$HGPORT/#changeset-a4f92ed23982be056b9852de5dfe873eaac7f0de (glob) (glob) 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://*:$HGPORT/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f (glob) (glob) test test 1970-01-01T00:00:00+00:00 1970-01-01T00:00:00+00:00
base
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/1/foo/?style=atom' 200 Script output follows http://*:$HGPORT/atom-log/tip/foo (glob) (glob) test: foo history 1970-01-01T00:00:00+00:00 base http://*:$HGPORT/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f (glob) (glob) test test 1970-01-01T00:00:00+00:00 1970-01-01T00:00:00+00:00
base
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog/' 200 Script output follows test: log

test

log

age author description
Thu, 01 Jan 1970 00:00:00 +0000 test branchunstable tip something
Thu, 01 Jan 1970 00:00:00 +0000 test branchstable
Thu, 01 Jan 1970 00:00:00 +0000 test Added tag 1.0 for changeset 2ef0ac749a14default
Thu, 01 Jan 1970 00:00:00 +0000 test base1.0 anotherthing
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'rev/0/' 200 Script output follows test: 2ef0ac749a14

test

changeset 0:2ef0ac749a14 1.0 anotherthing

base
author test
date Thu, 01 Jan 1970 00:00:00 +0000
parents
children a4f92ed23982
files da/foo foo
diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       1.2 +++ b/da/foo	Thu Jan 01 00:00:00 1970 +0000
       1.3 @@ -0,0 +1,1 @@
       1.4 +foo
  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       2.2 +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
       2.3 @@ -0,0 +1,1 @@
       2.4 +foo
  
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'rev/1/?style=raw' 200 Script output follows # HG changeset patch # User test # Date 0 0 # Node ID a4f92ed23982be056b9852de5dfe873eaac7f0de # Parent 2ef0ac749a14e4f57a5a822464a0902c6f7f448f Added tag 1.0 for changeset 2ef0ac749a14 diff -r 2ef0ac749a14 -r a4f92ed23982 .hgtags --- /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 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?rev=base' 200 Script output follows test: searching for base

test

searching for 'base'

age author description
Thu, 01 Jan 1970 00:00:00 +0000 test base1.0 anotherthing
File-related $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/1/foo/?style=raw' 200 Script output follows foo $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'annotate/1/foo/?style=raw' 200 Script output follows test@0: foo $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/1/?style=raw' 200 Script output follows drwxr-xr-x da -rw-r--r-- 45 .hgtags -rw-r--r-- 4 foo $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/1/foo' 200 Script output follows test: a4f92ed23982 foo

test

view foo @ 1:a4f92ed23982

Added tag 1.0 for changeset 2ef0ac749a14
author test
date Thu, 01 Jan 1970 00:00:00 +0000
parents
children 1d22e65f027e
line source
1 foo
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'filediff/0/foo/?style=raw' 200 Script output follows diff -r 000000000000 -r 2ef0ac749a14 foo --- /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 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'filediff/1/foo/?style=raw' 200 Script output follows Overviews $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'raw-tags' 200 Script output follows tip ba87b23d29ca67a305625d81a20ac279c1e3f444 1.0 2ef0ac749a14e4f57a5a822464a0902c6f7f448f $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'raw-branches' 200 Script output follows unstable ba87b23d29ca67a305625d81a20ac279c1e3f444 open stable 1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe inactive default a4f92ed23982be056b9852de5dfe873eaac7f0de inactive $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'raw-bookmarks' 200 Script output follows anotherthing 2ef0ac749a14e4f57a5a822464a0902c6f7f448f something ba87b23d29ca67a305625d81a20ac279c1e3f444 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'summary/?style=gitweb' 200 Script output follows test: Summary
 
descriptionunknown
ownerFoo Bar <foo.bar@example.com>
last changeThu, 01 Jan 1970 00:00:00 +0000
changes
Thu, 01 Jan 1970 00:00:00 +0000 test branch unstable tip something
Thu, 01 Jan 1970 00:00:00 +0000 test branch stable
Thu, 01 Jan 1970 00:00:00 +0000 test Added tag 1.0 for changeset 2ef0ac749a14 default
Thu, 01 Jan 1970 00:00:00 +0000 test base 1.0 anotherthing
...
tags
Thu, 01 Jan 1970 00:00:00 +0000 1.0
...
bookmarks
Thu, 01 Jan 1970 00:00:00 +0000 anotherthing
Thu, 01 Jan 1970 00:00:00 +0000 something
...
branches
Thu, 01 Jan 1970 00:00:00 +0000 ba87b23d29ca unstable
Thu, 01 Jan 1970 00:00:00 +0000 1d22e65f027e stable
Thu, 01 Jan 1970 00:00:00 +0000 a4f92ed23982 default
...
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph/?style=gitweb' 200 Script output follows test: Graph
 
raw graph $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph/?style=raw' 200 Script output follows # HG graph # Node ID ba87b23d29ca67a305625d81a20ac279c1e3f444 # Rows shown 4 changeset: ba87b23d29ca user: test date: 1970-01-01 summary: branch branch: unstable tag: tip bookmark: something node: (0, 0) (color 1) edge: (0, 0) -> (0, 1) (color 1) changeset: 1d22e65f027e user: test date: 1970-01-01 summary: branch branch: stable node: (0, 1) (color 1) edge: (0, 1) -> (0, 2) (color 1) changeset: a4f92ed23982 user: test date: 1970-01-01 summary: Added tag 1.0 for changeset 2ef0ac749a14 branch: default node: (0, 2) (color 1) edge: (0, 2) -> (0, 3) (color 1) changeset: 2ef0ac749a14 user: test date: 1970-01-01 summary: base tag: 1.0 bookmark: anotherthing node: (0, 3) (color 1) capabilities $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=capabilities'; echo 200 Script output follows lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 heads $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=heads' 200 Script output follows ba87b23d29ca67a305625d81a20ac279c1e3f444 branches $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=branches&nodes=0000000000000000000000000000000000000000' 200 Script output follows 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 changegroup $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=changegroup&roots=0000000000000000000000000000000000000000' 200 Script output follows x\x9c\xbdTMHTQ\x14\x1e\xfc\xef\xd9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c5?\x07\xce\xdc\xda\xc0\xf9\xcd\xef\xbf\xa5\xd3g\xd2\xd2\xa8\xa5uKu\x01(8$\xa6k@\x02(D\x16\x80\x00\x99\x82\x08\xa5\r\x81(t\\f`\xea\x02\xce\xb5\x7f\xba\xac\x02\x8c\\x\x98\x9f\xd5\xb7:0W\xdd6\xbf\xd2\xd3s\xa0k\xbd\xeb\xd8L\xa6 \xa5Q\x86\x91Pc\x80\x98\x8cB,L\x07#\x80\x04\x82\xb6\x8d)\xa3\x08X\x02\x00\xear\x0c-`b\x9b\x18>\xa1\x1b\xf9g\xe9@\xd1\xe9\xca_US{G\xb3\x9f?\x9b\x8d\xd6\x86zR\x91LE\xe8/\xdd& (esc) C \xd5~u\xb0e#\x08\r\x8c\xd5\xf83\x93\x01B\x95\xe8\x1c\x03\xdb\x92s*\x99`\xcc0\x88\xb4d\xb2\xbd\x85\xc9,\x14\xb7\xf1\xd9\xf2\xe5Ku\x8d\xf5rp\xb6\xee\\\xe0\xc5\xa7C\xd9\xd7\xefe\xda\xe94\xc5\xaa\xde>\x8a\x02I\xcb!\x16\xc1\x10"\x1b\x11\xe0\x02\xc8l\xe9H\x84\xb0\xf4\xa78\xc9-\xf1(\xa9\x15\x0f.\x8c\x8fT\x16\x965\xe9'\xbe\xac6\xaeLtN\x0f\x0e/fJ-\x8d\x08s\x12#\xe7[\xfe\xff\x0b\x17\xb9\xc6KK\xfa\xa2o\xa7\x1e\x87\xfaKb\x8b\xaf?\xcc\xed{z>\xd3\xb8\xbb\xcc}\x8eB\x01\x89\xc6\xbc\x88hO\xa6\x15\xf8\rr4\xb3\xe5 (no-eol) (esc) stream_out $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=stream_out' 200 Script output follows 1 failing unbundle, requires POST request $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=unbundle' 405 push requires POST request 0 push requires POST request [1] Static files $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'static/style.css' 200 Script output follows a { text-decoration:none; } .age { white-space:nowrap; } .date { white-space:nowrap; } .indexlinks { white-space:nowrap; } .parity0 { background-color: #ddd; } .parity1 { background-color: #eee; } .lineno { width: 60px; color: #aaa; font-size: smaller; text-align: right; } .plusline { color: green; } .minusline { color: red; } .atline { color: purple; } .annotate { font-size: smaller; text-align: right; padding-right: 1em; } .buttons a { background-color: #666; 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: #888; color: white; text-align: right; } /* Common */ pre { margin: 0; } .logo { float: right; clear: right; } /* 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; } /* Graph */ div#wrapper { position: relative; margin: 0; padding: 0; } canvas { position: absolute; z-index: 5; top: -0.6em; margin: 0; } ul#nodebgs { list-style: none inside none; padding: 0; margin: 0; top: -0.7em; } ul#graphnodes li, ul#nodebgs li { height: 39px; } ul#graphnodes { position: absolute; z-index: 10; top: -0.85em; list-style: none inside none; padding: 0; } ul#graphnodes li .info { display: block; font-size: 70%; position: relative; top: -1px; } Stop and restart with HGENCODING=cp932 and preferuncompressed $ "$TESTDIR/killdaemons.py" $ HGENCODING=cp932 hg serve --config server.preferuncompressed=True -n test \ > -p $HGPORT -d --pid-file=hg.pid -E errors.log $ cat hg.pid >> $DAEMON_PIDS commit message with Japanese Kanji 'Noh', which ends with '\x5c' $ echo foo >> foo $ HGENCODING=cp932 hg ci -m `python -c 'print("\x94\x5c")'` Graph json escape of multibyte character $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph/' \ > | grep '^var data =' var data = [["548001d11f45", [0, 1], [[0, 0, 1, -1, ""]], "\u80fd", "test", "1970-01-01", ["unstable", true], ["tip"], ["something"]], ["ba87b23d29ca", [0, 1], [[0, 0, 1, 3, "FF0000"]], "branch", "test", "1970-01-01", ["unstable", false], [], []], ["1d22e65f027e", [0, 1], [[0, 0, 1, 3, ""]], "branch", "test", "1970-01-01", ["stable", true], [], []], ["a4f92ed23982", [0, 1], [[0, 0, 1, 3, ""]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], [], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"], ["anotherthing"]]]; capabilities $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=capabilities'; echo 200 Script output follows lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream-preferred stream unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 heads ERRORS ENCOUNTERED $ cat errors.log $ cd ..