Patchwork D3122: hgweb: don't include hidden revisions in /filelog/ view

login
register
mail settings
Submitter phabricator
Date April 5, 2018, 7:10 a.m.
Message ID <differential-rev-PHID-DREV-ka7vdvvnprjnepvxtmah-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30348/
State Superseded
Headers show

Comments

phabricator - April 5, 2018, 7:10 a.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3122

AFFECTED FILES
  mercurial/hgweb/webcommands.py
  tests/test-obsolete.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - April 5, 2018, 1:28 p.m.
yuja accepted this revision.
yuja added a comment.
This revision is now accepted and ready to land.


  It's a bit scary to rely on `linkrev()`, but the way how hgweb handles fctxs
  effectively disables linkrev adjustment. So this should be good enough for now.
  
  Queued, thanks.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3122

To: martinvonz, #hg-reviewers, yuja
Cc: yuja, mercurial-devel

Patch

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
-     <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
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')