# HG changeset patch # User Augie Fackler # Date 2020-03-17 21:26:05 # Node ID 9e63108123a490eb19e96ff72f121e850ea1d3da # Parent 5483e9c759e4671e1195222aea9eed51ad5329a7 remotefilelog: add fake heads() method that allows viewing a file in hgweb As best I can discern, this is not going to hurt anything, but it'll cause a couple of options to exist in the UI that are nonsensical. That seems fine, given the nature of remotefilelog. Differential Revision: https://phab.mercurial-scm.org/D8299 diff --git a/hgext/remotefilelog/remotefilelog.py b/hgext/remotefilelog/remotefilelog.py --- a/hgext/remotefilelog/remotefilelog.py +++ b/hgext/remotefilelog/remotefilelog.py @@ -259,6 +259,10 @@ class remotefilelog(object): raise RuntimeError(b"len not supported") + def heads(self): + # Fake heads of the filelog to satisfy hgweb. + return [] + def empty(self): return False diff --git a/tests/test-remotefilelog-hgweb.t b/tests/test-remotefilelog-hgweb.t --- a/tests/test-remotefilelog-hgweb.t +++ b/tests/test-remotefilelog-hgweb.t @@ -24,9 +24,15 @@ $ cd wdir $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log $ cat hg.pid >> $DAEMON_PIDS - $ (get-with-headers.py localhost:$HGPORT 'file/tip/x') - 500 Internal Server Error + $ get-with-headers.py localhost:$HGPORT 'file/tip/x' | head -n 10 + 200 Script output follows - Internal Server Error (no-eol) - [1] + + + + + + + +