hgweb: don't include hidden revisions in /filelog/ view
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 04 Apr 2018 23:55:47 -0700
changeset 37363 d3a2344446e6
parent 37362 c16b55edd408
child 37364 1d26f745a10b
hgweb: don't include hidden revisions in /filelog/ view This is a very crude way of doing it, but it seems to be working well enough. The number of entries on the page won't be the usual maximum number per page, but this is good enough for me. Differential Revision: https://phab.mercurial-scm.org/D3122
mercurial/hgweb/webcommands.py
tests/test-obsolete.t
--- a/mercurial/hgweb/webcommands.py	Thu Apr 05 00:00:48 2018 -0700
+++ b/mercurial/hgweb/webcommands.py	Wed Apr 04 23:55:47 2018 -0700
@@ -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')
--- a/tests/test-obsolete.t	Thu Apr 05 00:00:48 2018 -0700
+++ b/tests/test-obsolete.t	Wed Apr 04 23:55:47 2018 -0700
@@ -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
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
-     <span class="phase">draft</span> <span class="obsolete">obsolete</span> 
+  [1]
 
   $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/68'
   200 Script output follows