diff --git a/tests/test-hgwebdir.out b/tests/test-hgwebdir.out deleted file mode 100644 --- a/tests/test-hgwebdir.out +++ /dev/null @@ -1,482 +0,0 @@ -adding a -adding b -adding d -adding c -% should give a 404 - file does not exist -404 Not Found - - -error: bork@8580ff50825a: not found in manifest -% should succeed -200 Script output follows - - -/a/ -/b/ - -200 Script output follows - -a -200 Script output follows - -b -% should give a 404 - repo is not published -404 Not Found - - -error: repository c not found -% atom-log without basedir - - - -% rss-log without basedir - http://example.com:8080/a/rev/8580ff50825a -% should succeed, slashy names -200 Script output follows - - -/t/a/ -/b/ -/coll/a/ -/coll/a/.hg/patches/ -/coll/b/ -/coll/c/ -/rcoll/a/ -/rcoll/a/.hg/patches/ -/rcoll/b/ -/rcoll/b/d/ -/rcoll/c/ -/star/webdir/a/ -/star/webdir/a/.hg/patches/ -/star/webdir/b/ -/star/webdir/c/ -/starstar/webdir/a/ -/starstar/webdir/a/.hg/patches/ -/starstar/webdir/b/ -/starstar/webdir/b/d/ -/starstar/webdir/c/ - -200 Script output follows - - - - - - - - -Mercurial repositories index - - - -
- -
-

Mercurial Repositories

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionContactLast modified 
t/aunknownFoo Bar <foo.bar@example.com>seconds ago
bunknownFoo Bar <foo.bar@example.com>seconds ago
coll/aunknownFoo Bar <foo.bar@example.com>seconds ago
coll/a/.hg/patchesunknownFoo Bar <foo.bar@example.com>seconds ago
coll/bunknownFoo Bar <foo.bar@example.com>seconds ago
coll/cunknownFoo Bar <foo.bar@example.com>seconds ago
rcoll/aunknownFoo Bar <foo.bar@example.com>seconds ago
rcoll/a/.hg/patchesunknownFoo Bar <foo.bar@example.com>seconds ago
rcoll/bunknownFoo Bar <foo.bar@example.com>seconds ago
rcoll/b/dunknownFoo Bar <foo.bar@example.com>seconds ago
rcoll/cunknownFoo Bar <foo.bar@example.com>seconds ago
star/webdir/aunknownFoo Bar <foo.bar@example.com>seconds ago
star/webdir/a/.hg/patchesunknownFoo Bar <foo.bar@example.com>seconds ago
star/webdir/bunknownFoo Bar <foo.bar@example.com>seconds ago
star/webdir/cunknownFoo Bar <foo.bar@example.com>seconds ago
starstar/webdir/aunknownFoo Bar <foo.bar@example.com>seconds ago
starstar/webdir/a/.hg/patchesunknownFoo Bar <foo.bar@example.com>seconds ago
starstar/webdir/bunknownFoo Bar <foo.bar@example.com>seconds ago
starstar/webdir/b/dunknownFoo Bar <foo.bar@example.com>seconds ago
starstar/webdir/cunknownFoo Bar <foo.bar@example.com>seconds ago
-
-
- - - - - -200 Script output follows - - -/t/a/ - -200 Script output follows - - -/t/a/ - -200 Script output follows - - - - - - - - -Mercurial repositories index - - - -
- -
-

Mercurial Repositories

- - - - - - - - - - - - - - - - - - -
NameDescriptionContactLast modified 
aunknownFoo Bar <foo.bar@example.com>seconds ago
-
-
- - - - - -200 Script output follows - - - - - http://127.0.0.1/t/a/ - - - t/a Changelog - 1970-01-01T00:00:01+00:00 - - - a - http://127.0.0.1/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab - - - test - test - - 1970-01-01T00:00:01+00:00 - 1970-01-01T00:00:01+00:00 - -
-
a
-
-
-
- -
-200 Script output follows - - - - - http://127.0.0.1/t/a/ - - - t/a Changelog - 1970-01-01T00:00:01+00:00 - - - a - http://127.0.0.1/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab - - - test - test - - 1970-01-01T00:00:01+00:00 - 1970-01-01T00:00:01+00:00 - -
-
a
-
-
-
- -
-200 Script output follows - -a -200 Script output follows - - -/coll/a/ -/coll/a/.hg/patches/ -/coll/b/ -/coll/c/ - -200 Script output follows - -a -200 Script output follows - - -/rcoll/a/ -/rcoll/a/.hg/patches/ -/rcoll/b/ -/rcoll/b/d/ -/rcoll/c/ - -200 Script output follows - -d -% test descend = False -200 Script output follows - - -/c/ - -200 Script output follows - - -/t/a/ -/t/b/ - -% test inexistent and inaccessible repo should be ignored silently -200 Script output follows - - - - - - - - -Mercurial repositories index - - - -
- -
-

Mercurial Repositories

- - - - - - - - - - -
NameDescriptionContactLast modified 
-
-
- - - - - -% collections: should succeed -200 Script output follows - - -/a/ -/a/.hg/patches/ -/b/ -/c/ - -200 Script output follows - -a -200 Script output follows - -b -200 Script output follows - -c -% atom-log with basedir / - - - -% rss-log with basedir / - http://example.com:8080/a/rev/8580ff50825a -% atom-log with basedir /foo/ - - - -% rss-log with basedir /foo/ - http://example.com:8080/foo/a/rev/8580ff50825a -% paths errors 1 -% paths errors 2 -% paths errors 3 -% collections errors -% collections errors 2 diff --git a/tests/test-hgwebdir b/tests/test-hgwebdir.t old mode 100755 new mode 100644 rename from tests/test-hgwebdir rename to tests/test-hgwebdir.t --- a/tests/test-hgwebdir +++ b/tests/test-hgwebdir.t @@ -1,181 +1,648 @@ -#!/bin/sh -# Tests some basic hgwebdir functionality. Tests setting up paths and -# collection, different forms of 404s and the subdirectory support. +Tests some basic hgwebdir functionality. Tests setting up paths and +collection, different forms of 404s and the subdirectory support. -mkdir webdir -cd webdir + $ mkdir webdir + $ cd webdir + $ hg init a + $ echo a > a/a + $ hg --cwd a ci -Ama -d'1 0' + adding a -hg init a -echo a > a/a -hg --cwd a ci -Ama -d'1 0' -# create a mercurial queue repository -hg --cwd a qinit --config extensions.hgext.mq= -c +create a mercurial queue repository -hg init b -echo b > b/b -hg --cwd b ci -Amb -d'2 0' + $ hg --cwd a qinit --config extensions.hgext.mq= -c + $ hg init b + $ echo b > b/b + $ hg --cwd b ci -Amb -d'2 0' + adding b + +create a nested repository -# create a nested repository -cd b -hg init d -echo d > d/d -hg --cwd d ci -Amd -d'3 0' -cd .. + $ cd b + $ hg init d + $ echo d > d/d + $ hg --cwd d ci -Amd -d'3 0' + adding d + $ cd .. + $ hg init c + $ echo c > c/c + $ hg --cwd c ci -Amc -d'3 0' + adding c + +create repository without .hg/store -hg init c -echo c > c/c -hg --cwd c ci -Amc -d'3 0' + $ hg init nostore + $ rm -R nostore/.hg/store + $ root=`pwd` + $ cd .. + $ cat > paths.conf < [paths] + > a=$root/a + > b=$root/b + > EOF + $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf paths.conf \ + > -A access-paths.log -E error-paths-1.log + $ cat hg.pid >> $DAEMON_PIDS -# create repository without .hg/store -hg init nostore -rm -R nostore/.hg/store - -root=`pwd` -cd .. - +should give a 404 - file does not exist -cat > paths.conf <> $DAEMON_PIDS +should succeed -echo % should give a 404 - file does not exist -"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/bork?style=raw' + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw' + 200 Script output follows + + + /a/ + /b/ + + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/a?style=raw' + 200 Script output follows + + a + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw' + 200 Script output follows + + b -echo % should succeed -"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw' -"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/a?style=raw' -"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw' - -echo % should give a 404 - repo is not published -"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw' +should give a 404 - repo is not published -echo % atom-log without basedir -"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/atom-log' \ - | grep ' (glob) + (glob) + (glob) + +rss-log without basedir -cat > paths.conf <http://*/a/rev/8580ff50825a (glob) + $ cat > paths.conf < [paths] + > t/a/=$root/a + > b=$root/b + > coll=$root/* + > rcoll=$root/** + > star=* + > starstar=** + > EOF + $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ + > -A access-paths.log -E error-paths-2.log + $ cat hg.pid >> $DAEMON_PIDS -hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ - -A access-paths.log -E error-paths-2.log -cat hg.pid >> $DAEMON_PIDS +should succeed, slashy names -echo % should succeed, slashy names -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw' -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=paper' \ - | sed "s/[0-9]\{1,\} seconds\{0,1\} ago/seconds ago/" -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t?style=raw' -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw' -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=paper' \ - | sed "s/[0-9]\{1,\} seconds\{0,1\} ago/seconds ago/" -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a?style=atom' \ - | sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//" -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/?style=atom' \ - | sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//" -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/file/tip/a?style=raw' -# Test [paths] '*' extension -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/?style=raw' -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw' -#test [paths] '**' extension -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw' -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw' - - -"$TESTDIR/killdaemons.py" -cat > paths.conf <> $DAEMON_PIDS -echo % test descend = False -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw' -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw' - - -"$TESTDIR/killdaemons.py" -cat > paths.conf < + + + + + + + Mercurial repositories index + + + +
+ +
+

Mercurial Repositories

+ + + + + + + + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + + + + + + (glob) + + + +
NameDescriptionContactLast modified 
t/aunknownFoo Bar <foo.bar@example.com>* ago
bunknownFoo Bar <foo.bar@example.com>* ago
coll/aunknownFoo Bar <foo.bar@example.com>* ago
coll/a/.hg/patchesunknownFoo Bar <foo.bar@example.com>* ago
coll/bunknownFoo Bar <foo.bar@example.com>* ago
coll/cunknownFoo Bar <foo.bar@example.com>* ago
rcoll/aunknownFoo Bar <foo.bar@example.com>* ago
rcoll/a/.hg/patchesunknownFoo Bar <foo.bar@example.com>* ago
rcoll/bunknownFoo Bar <foo.bar@example.com>* ago
rcoll/b/dunknownFoo Bar <foo.bar@example.com>* ago
rcoll/cunknownFoo Bar <foo.bar@example.com>* ago
star/webdir/aunknownFoo Bar <foo.bar@example.com>* ago
star/webdir/a/.hg/patchesunknownFoo Bar <foo.bar@example.com>* ago
star/webdir/bunknownFoo Bar <foo.bar@example.com>* ago
star/webdir/cunknownFoo Bar <foo.bar@example.com>* ago
starstar/webdir/aunknownFoo Bar <foo.bar@example.com>* ago
starstar/webdir/a/.hg/patchesunknownFoo Bar <foo.bar@example.com>* ago
starstar/webdir/bunknownFoo Bar <foo.bar@example.com>* ago
starstar/webdir/b/dunknownFoo Bar <foo.bar@example.com>* ago
starstar/webdir/cunknownFoo Bar <foo.bar@example.com>* ago
+
+
+ + + + + + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t?style=raw' + 200 Script output follows + + + /t/a/ + + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw' + 200 Script output follows + + + /t/a/ + + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=paper' + 200 Script output follows + + + + + + + + + Mercurial repositories index + + + +
+ +
+

Mercurial Repositories

+ + + + + + + + + + + + + + + (glob) + + + +
NameDescriptionContactLast modified 
aunknownFoo Bar <foo.bar@example.com>* ago
+
+
+ + + + + + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a?style=atom' + 200 Script output follows + + + + + http://*/t/a/ (glob) + (glob) + (glob) + t/a Changelog + 1970-01-01T00:00:01+00:00 + + + a + http://*/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab (glob) + (glob) + + test + test + + 1970-01-01T00:00:01+00:00 + 1970-01-01T00:00:01+00:00 + +
+
a
+
+
+
+ +
+ $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/?style=atom' + 200 Script output follows + + + + + http://*/t/a/ (glob) + (glob) + (glob) + t/a Changelog + 1970-01-01T00:00:01+00:00 + + + a + http://*/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab (glob) + (glob) + + test + test + + 1970-01-01T00:00:01+00:00 + 1970-01-01T00:00:01+00:00 + +
+
a
+
+
+
+ +
+ $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/file/tip/a?style=raw' + 200 Script output follows + + a -hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ - -A access-paths.log -E error-paths-4.log -cat hg.pid >> $DAEMON_PIDS -echo % test inexistent and inaccessible repo should be ignored silently -"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/' +Test [paths] '*' extension + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/?style=raw' + 200 Script output follows + + + /coll/a/ + /coll/a/.hg/patches/ + /coll/b/ + /coll/c/ + + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw' + 200 Script output follows + + a -cat > collections.conf <> $DAEMON_PIDS + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw' + 200 Script output follows + + + /rcoll/a/ + /rcoll/a/.hg/patches/ + /rcoll/b/ + /rcoll/b/d/ + /rcoll/c/ + + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw' + 200 Script output follows + + d + $ "$TESTDIR/killdaemons.py" + $ cat > paths.conf < [paths] + > t/a = $root/a + > t/b = $root/b + > c = $root/c + > [web] + > descend=false + > EOF + $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ + > -A access-paths.log -E error-paths-3.log + $ cat hg.pid >> $DAEMON_PIDS -echo % collections: should succeed -"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw' -"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/file/tip/a?style=raw' -"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw' -"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw' +test descend = False -echo % atom-log with basedir / -"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/atom-log' \ - | grep ' paths.conf < [paths] + > nostore = $root/nostore + > inexistent = $root/inexistent + > EOF + $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ + > -A access-paths.log -E error-paths-4.log + $ cat hg.pid >> $DAEMON_PIDS + +test inexistent and inaccessible repo should be ignored silently -echo % rss-log with basedir / -"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/rss-log' \ - | grep ' + + + + + + + Mercurial repositories index + + + +
+ +
+

Mercurial Repositories

+ + + + + + + + + + +
NameDescriptionContactLast modified 
+
+
+ + + + + + $ cat > collections.conf < [collections] + > $root=$root + > EOF + $ hg serve --config web.baseurl=http://hg.example.com:8080/ -p $HGPORT2 -d \ + > --pid-file=hg.pid --webdir-conf collections.conf \ + > -A access-collections.log -E error-collections.log + $ cat hg.pid >> $DAEMON_PIDS -hg serve --config web.baseurl=http://hg.example.com:8080/foo/ -p $HGPORT2 -d \ - --pid-file=hg.pid --webdir-conf collections.conf \ - -A access-collections-2.log -E error-collections-2.log -cat hg.pid >> $DAEMON_PIDS - -echo % atom-log with basedir /foo/ -"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/atom-log' \ - | grep ' + + + +rss-log with basedir / -echo % paths errors 1 -cat error-paths-1.log -echo % paths errors 2 -cat error-paths-2.log -echo % paths errors 3 -cat error-paths-3.log -echo % collections errors -cat error-collections.log -echo % collections errors 2 -cat error-collections-2.log + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/rss-log' | grep 'http://hg.example.com:8080/a/rev/8580ff50825a + $ "$TESTDIR/killdaemons.py" + $ hg serve --config web.baseurl=http://hg.example.com:8080/foo/ -p $HGPORT2 -d \ + > --pid-file=hg.pid --webdir-conf collections.conf \ + > -A access-collections-2.log -E error-collections-2.log + $ cat hg.pid >> $DAEMON_PIDS + +atom-log with basedir /foo/ + + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/atom-log' | grep ' + + + +rss-log with basedir /foo/ + + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/rss-log' | grep 'http://hg.example.com:8080/foo/a/rev/8580ff50825a + +paths errors 1 + + $ cat error-paths-1.log + +paths errors 2 + + $ cat error-paths-2.log + +paths errors 3 + + $ cat error-paths-3.log + +collections errors + + $ cat error-collections.log + +collections errors 2 + + $ cat error-collections-2.log