Comments
Patch
@@ -255,10 +255,11 @@
staticfile(static, fname, req)
return []
- # top-level index
+ # top-level index, or HTTP_MOVED_PERMANENTLY for a Mercurial client
+ # when the server is invoked with --subrepos.
elif not virtual:
- if self._rootrepo:
- # Redirect '/' to the main repo when -S is given.
+ accept = req.env.get('HTTP_ACCEPT', "")
+ if self._rootrepo and accept == 'application/mercurial-0.1':
path = '/' + self._rootrepo
if self.prefix:
path = '/' + self.prefix + path
@@ -295,6 +295,10 @@
z2
z3
+ $ wget -q http://localhost:$HGPORT
+ $ cat index.html | grep '<title>'
+ <title>Mercurial repositories index</title>
+
$ cat access.log
* "GET /?cmd=capabilities HTTP/1.1" 301 - (glob)
* "GET /repo HTTP/1.1" 200 - (glob)
@@ -308,9 +312,10 @@
* "GET /repo/foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob)
* "GET /repo/foo/bar?cmd=batch HTTP/1.1" 200 - * (glob)
* "GET /repo/foo/bar?cmd=getbundle HTTP/1.1" 200 - * (glob)
+ * "GET / HTTP/1.0" 200 - (glob)
$ killdaemons.py
- $ rm hg1.pid error.log access.log
+ $ rm hg1.pid error.log access.log index.html
$ cd repo
#endif