$ "$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?) >>> open('msg', 'wb').write('branch commit with null character: \0\n') $ hg ci -l msg $ rm msg $ 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 $ hg log -G --template '{rev}:{node|short} {desc}\n' @ 3:cad8025a2e87 branch commit with null character: \x00 (esc) | o 2:1d22e65f027e branch | o 1:a4f92ed23982 Added tag 1.0 for changeset 2ef0ac749a14 | o 0:2ef0ac749a14 base 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 commit with null character: http://*:$HGPORT/#changeset-cad8025a2e87f88c06259790adfa15acb4080123 (glob) (glob) test test 1970-01-01T00:00:00+00:00 1970-01-01T00:00:00+00:00
branch commit with null character: 
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 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

log

age author description
Thu, 01 Jan 1970 00:00:00 +0000 test branch commit with null character: unstable 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

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 wrap: on
line diff
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
  +++ b/da/foo	Thu Jan 01 00:00:00 1970 +0000
  @@ -0,0 +1,1 @@
  +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 '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

searching for 'base'

Assuming literal keyword search.

age author description
Thu, 01 Jan 1970 00:00:00 +0000 test base1.0 anotherthing
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?rev=stable&style=raw' | grep 'revision:' revision: 2 Search with revset syntax $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?rev=tip^&style=raw' 200 Script output follows # HG changesets search # Node ID cad8025a2e87f88c06259790adfa15acb4080123 # Query "tip^" # Mode revset expression search changeset: 1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe revision: 2 user: test date: Thu, 01 Jan 1970 00:00:00 +0000 summary: branch branch: stable $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?rev=last(all(),2)^&style=raw' 200 Script output follows # HG changesets search # Node ID cad8025a2e87f88c06259790adfa15acb4080123 # Query "last(all(),2)^" # Mode revset expression search changeset: 1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe revision: 2 user: test date: Thu, 01 Jan 1970 00:00:00 +0000 summary: branch branch: stable changeset: a4f92ed23982be056b9852de5dfe873eaac7f0de revision: 1 user: test date: Thu, 01 Jan 1970 00:00:00 +0000 summary: Added tag 1.0 for changeset 2ef0ac749a14 branch: default $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?rev=last(all(,2)^&style=raw' 200 Script output follows # HG changesets search # Node ID cad8025a2e87f88c06259790adfa15acb4080123 # Query "last(all(,2)^" # Mode literal keyword search $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?rev=last(al(),2)^&style=raw' 200 Script output follows # HG changesets search # Node ID cad8025a2e87f88c06259790adfa15acb4080123 # Query "last(al(),2)^" # Mode literal keyword search $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?rev=bookmark(anotherthing)&style=raw' 200 Script output follows # HG changesets search # Node ID cad8025a2e87f88c06259790adfa15acb4080123 # Query "bookmark(anotherthing)" # Mode revset expression search changeset: 2ef0ac749a14e4f57a5a822464a0902c6f7f448f revision: 0 user: test date: Thu, 01 Jan 1970 00:00:00 +0000 summary: base tag: 1.0 bookmark: anotherthing $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?rev=bookmark(abc)&style=raw' 200 Script output follows # HG changesets search # Node ID cad8025a2e87f88c06259790adfa15acb4080123 # Query "bookmark(abc)" # Mode literal keyword search $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?rev=deadbeef:&style=raw' 200 Script output follows # HG changesets search # Node ID cad8025a2e87f88c06259790adfa15acb4080123 # Query "deadbeef:" # Mode literal keyword search $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?rev=user("test")&style=raw' 200 Script output follows # HG changesets search # Node ID cad8025a2e87f88c06259790adfa15acb4080123 # Query "user("test")" # Mode revset expression search changeset: cad8025a2e87f88c06259790adfa15acb4080123 revision: 3 user: test date: Thu, 01 Jan 1970 00:00:00 +0000 summary: branch commit with null character: \x00 (esc) branch: unstable tag: tip bookmark: something changeset: 1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe revision: 2 user: test date: Thu, 01 Jan 1970 00:00:00 +0000 summary: branch branch: stable changeset: a4f92ed23982be056b9852de5dfe873eaac7f0de revision: 1 user: test date: Thu, 01 Jan 1970 00:00:00 +0000 summary: Added tag 1.0 for changeset 2ef0ac749a14 branch: default changeset: 2ef0ac749a14e4f57a5a822464a0902c6f7f448f revision: 0 user: test date: Thu, 01 Jan 1970 00:00:00 +0000 summary: base tag: 1.0 bookmark: anotherthing $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?rev=user("re:test")&style=raw' 200 Script output follows # HG changesets search # Node ID cad8025a2e87f88c06259790adfa15acb4080123 # Query "user("re:test")" # Mode literal keyword search 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

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 wrap: on
line source
  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 cad8025a2e87f88c06259790adfa15acb4080123 1.0 2ef0ac749a14e4f57a5a822464a0902c6f7f448f $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'raw-branches' 200 Script output follows unstable cad8025a2e87f88c06259790adfa15acb4080123 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 cad8025a2e87f88c06259790adfa15acb4080123 $ "$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 commit with null character: 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 cad8025a2e87 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 cad8025a2e87f88c06259790adfa15acb4080123 # Rows shown 4 changeset: cad8025a2e87 user: test date: 1970-01-01 summary: branch commit with null character: \x00 (esc) 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 cad8025a2e87f88c06259790adfa15acb4080123 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\xbd\x94MHTQ\x14\xc7'+\x9d\xc66\x81\x89P\xc1\xa3\x14\xcct\xba\xef\xbe\xfb\xde\xbb\xcfr0\xb3"\x02\x11[%\x98\xdcO\xa7\xd2\x19\x98y\xd2\x07h"\x96\xa0e\xda\xa6lUY-\xca\x08\xa2\x82\x16\x96\xd1\xa2\xf0#\xc8\x95\x1b\xdd$!m*"\xc8\x82\xea\xbe\x9c\x01\x85\xc9\x996\x1d\xf8\xc1\xe3~\x9d\xff9\xef\x7f\xaf\xcf\xe7\xbb\x19\xfc4\xec^\xcb\x9b\xfbz\xa6\xbe\xb3\x90_\xef/\x8d\x9e\xad\xbe\xe4\xcb0\xd2\xec\xad\x12X:\xc8\x12\x12\xd9:\x95\xba \x1cG\xb7$\xc5\xc44\x1c(\x1d\x03\x03\xdb\x84\x0cK#\xe0\x8a\xb8\x1b\x00\x1a\x08p\xb2SF\xa3\x01\x8f\x00%q\xa1Ny{k!8\xe5t>[{\xe2j\xddl\xc3\xcf\xee\xd0\xddW\x9ff3U\x9djobj\xbb\x87E\x88\x05l\x001\x12\x18\x13\xc6 \xb7(\xe3\x02a\x80\x81\xcel.u\x9b\x1b\x8c\x91\x80Z\x0c\x15\x15 (esc) \x7f0\xdc\xe4\x92\xa6\xb87\x16\xf2\xcaT\x14\xef\xe1\\pM\r (no-eol) (esc) kz\x10h2\x1a\xd3X\x98D\x9aD\\\xb8\x1a\x14\x12\x10f#\x87\xe8H\xad\x1d\xd9\xb2\xf5}cV{}\xf6:\xb3\xbd\xad\xaf\xd5?\xb9\xe3\xf6\xd4\xcf\x15\x84.\x8bT{\x97\x16\xa4Z\xeaX\x10\xabL\xc8\x81DJ\xc8\x18\x00\xccq\x80A-j2j \x83\x1b\x02\x03O|PQ\xae\xc8W\x9d\xd7h\x8cDX\xb8<\xee\x12\xda,\xfe\xfc\x005\xb3K\xc1\x14\xd9\x8b\xb3^C\xc7\xa6\xb3\xea\x83\xdd\xdf.d\x17]\xe9\xbf\xff}\xe3\xf0#\xff\xaam+\x88Z\x16\xa9\xf6&tT+\xf2\x96\xe8h\x8d$\x94\xa8\xf1}\x8aC\x8a\xc2\xc59\x8dE[Z\x8e\xb9\xda\xc9cnX\x8b\xb467{\xad\x8e\x11\xe6\x8aX\xb9\x96L52\xbf\xb0\xff\xe3\x81M\x9fk\x07\xf3\x7f\xf4\x1c\xbe\xbc\x80s\xea^\x7fY\xc1\xca\xcb"\x8d\xbb\x1a\x16]\xea\x83\x82Cb8:$\x80Bd\x02\x08\x90!\x88P^\x12\x88B\xdba:\xa6\x0e\xe0<\xf0O\x8bU\x82\x81\xe3wr\xb2\xba\xe6{&\xcaNL\xceutln\xfb\xdc\xb6{,\xd3\x82\xd28IO\xb8\xd7G\x0cF!\x16\x86\x8d\x11@\x02A\xcb\xc2\x94Q\x04L\x01\x00u8\x86&0\xb0EtO\xd0\xc5\x9c#\xb4'\xef`\xc9\xaf\xd2\xd1\xf5\x83\xab\x9f<\x1e\x8fT\x84:R\x89L%\xe8/\xee \x8a>E\x99\xd7\x1dlZ\x08B\x1dc\xf5\\0\x83\x01B\x95Im\x1d[\x92s*\x99`L\xd7\x894e qfn\xb2 (esc) \xa5mh\xbc\xf8\xdd\xa9\xca\x9a*\xd9;^y\xd4\xf7t\xbah\xf5\xf9\x1b\x99\xfe\xe94\xcd*[zu\x05\x92\xa6ML\x82!D\x16"\xc0\x01\x90Y\xd2\x96\x08a\xe9\xdd\xfa\xa4\xb6\xc4#\xa6\xbexpjh\xa0$\xb7\xb0V\xdb\xfba\xbef\xee\xe1\xe9\x17\xbd\xfd3\x99JKc\xc25\x89+\xeaE\xce\xffK\x17>\xc7\xb7\x16tE^\x8e\xde\x0bu\x17Dg\x9e\xbf\x99\xd8\xf0\xa01\xd3\xbc+\xbc\x13k\x14~\x12\x89\xbaa\x11K\x96\xe5\xfb\r (no-eol) (esc) \x95)\xbe\xf6 (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-serif; font-weight: bold; } .navigate a { background-color: #ccc; padding: 2pt; font-family: sans-serif; 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" $DAEMON_PIDS $ 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/' > out >>> for line in open("out"): ... if line.startswith("var data ="): ... print line, var data = [["061dd13ba3c3", [0, 1], [[0, 0, 1, -1, ""]], "\\u80fd", "test", "1970-01-01", ["unstable", true], ["tip"], ["something"]], ["cad8025a2e87", [0, 1], [[0, 0, 1, 3, "FF0000"]], "branch commit with null character: \x00", "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"]]]; (esc) 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 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ cd .. Test graph paging $ mkcommit() { > echo $1 >> a > hg ci -Am $1 a > } $ hg init graph $ cd graph $ mkcommit 0 $ mkcommit 1 $ mkcommit 2 $ mkcommit 3 $ mkcommit 4 $ mkcommit 5 $ hg serve --config server.uncompressed=False \ > --config web.maxshortchanges=2 \ > -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ hg log -G --template '{rev}:{node|short} {desc}\n' @ 5:aed2d9c1d0e7 5 | o 4:b60a39a85a01 4 | o 3:ada793dcc118 3 | o 2:ab4f1438558b 2 | o 1:e06180cbfb0c 1 | o 0:b4e73ffab476 0 Test paging $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT \ > 'graph/?style=raw' | grep changeset changeset: aed2d9c1d0e7 changeset: b60a39a85a01 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT \ > 'graph/?style=raw&revcount=3' | grep changeset changeset: aed2d9c1d0e7 changeset: b60a39a85a01 changeset: ada793dcc118 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT \ > 'graph/e06180cbfb0?style=raw&revcount=3' | grep changeset changeset: e06180cbfb0c changeset: b4e73ffab476 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT \ > 'graph/b4e73ffab47?style=raw&revcount=3' | grep changeset changeset: b4e73ffab476 $ cat errors.log bookmarks view doesn't choke on bookmarks on secret changesets (issue3774) $ hg phase -fs 4 $ hg bookmark -r4 secret $ cat > hgweb.cgi < from mercurial import demandimport; demandimport.enable() > from mercurial.hgweb import hgweb > from mercurial.hgweb import wsgicgi > app = hgweb('.', 'test') > wsgicgi.launch(app) > HGWEB $ . "$TESTDIR/cgienv" $ PATH_INFO=/bookmarks; export PATH_INFO $ QUERY_STRING='style=raw' $ python hgweb.cgi | grep -v ETag: Status: 200 Script output follows\r (esc) Content-Type: text/plain; charset=ascii\r (esc) \r (esc) listbookmarks hides secret bookmarks $ PATH_INFO=/; export PATH_INFO $ QUERY_STRING='cmd=listkeys&namespace=bookmarks' $ python hgweb.cgi Status: 200 Script output follows\r (esc) Content-Type: application/mercurial-0.1\r (esc) Content-Length: 0\r (esc) \r (esc) search works with filtering $ PATH_INFO=/log; export PATH_INFO $ QUERY_STRING='rev=babar' $ python hgweb.cgi > search $ grep Status search Status: 200 Script output follows\r (esc) summary works with filtering (issue3810) $ PATH_INFO=/summary; export PATH_INFO $ QUERY_STRING='style=monoblue'; export QUERY_STRING $ python hgweb.cgi > summary.out $ grep "^Status" summary.out Status: 200 Script output follows\r (esc) proper status for filtered revision (missing rev) $ PATH_INFO=/rev/5; export PATH_INFO $ QUERY_STRING='style=raw' $ python hgweb.cgi #> search Status: 404 Not Found\r (esc) ETag: *\r (glob) (esc) Content-Type: text/plain; charset=ascii\r (esc) \r (esc) error: unknown revision '5' (filtered rev) $ PATH_INFO=/rev/4; export PATH_INFO $ QUERY_STRING='style=raw' $ python hgweb.cgi #> search Status: 404 Not Found\r (esc) ETag: *\r (glob) (esc) Content-Type: text/plain; charset=ascii\r (esc) \r (esc) error: unknown revision '4' filtered '0' changeset (create new root) $ hg up null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo 'babar' > jungle $ hg add jungle $ hg ci -m 'Babar is in the jungle!' created new head $ hg graft 0:: grafting revision 0 grafting revision 1 grafting revision 2 grafting revision 3 grafting revision 4 grafting revision 5 (turning the initial root secret (filtered)) $ hg phase --force --secret 0 $ PATH_INFO=/graph/; export PATH_INFO $ QUERY_STRING='' $ python hgweb.cgi | grep Status Status: 200 Script output follows\r (esc) (check rendered revision) $ QUERY_STRING='style=raw' $ python hgweb.cgi | grep -v ETag Status: 200 Script output follows\r (esc) Content-Type: text/plain; charset=ascii\r (esc) \r (esc) # HG graph # Node ID 1d9b947fef1fbb382a95c11a8f5a67e9a10b5026 # Rows shown 7 changeset: 1d9b947fef1f user: test date: 1970-01-01 summary: 5 branch: default tag: tip node: (0, 0) (color 1) edge: (0, 0) -> (0, 1) (color 1) changeset: 0cfd435fd222 user: test date: 1970-01-01 summary: 4 node: (0, 1) (color 1) edge: (0, 1) -> (0, 2) (color 1) changeset: 6768b9939e82 user: test date: 1970-01-01 summary: 3 node: (0, 2) (color 1) edge: (0, 2) -> (0, 3) (color 1) changeset: 05b0497fd125 user: test date: 1970-01-01 summary: 2 node: (0, 3) (color 1) edge: (0, 3) -> (0, 4) (color 1) changeset: 9c102df67cfb user: test date: 1970-01-01 summary: 1 node: (0, 4) (color 1) edge: (0, 4) -> (0, 5) (color 1) changeset: 3ebcd7db11bf user: test date: 1970-01-01 summary: 0 node: (0, 5) (color 1) edge: (0, 5) -> (0, 6) (color 1) changeset: c5e9bd96ae01 user: test date: 1970-01-01 summary: Babar is in the jungle! node: (0, 6) (color 1) $ cd ..