diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -1058,7 +1058,9 @@
parity = paritygen(web.stripecount, offset=start - end)
repo = web.repo
- revs = fctx.filelog().revs(start, end - 1)
+ filelog = fctx.filelog()
+ revs = [filerev for filerev in filelog.revs(start, end - 1)
+ if filelog.linkrev(filerev) in repo]
entries = []
diffstyle = web.config('web', 'style')
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -897,65 +897,7 @@
check filelog view for hidden commits (obsolete ones are hidden here)
$ get-with-headers.py localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar' | grep obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
- draft obsolete
+ [1]
$ get-with-headers.py --headeronly localhost:$HGPORT 'rev/68'
200 Script output follows