mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
hg: make file view in hgweb working
Summary: hgweb's file view must determine if the displayed file revision is the head of the filelog graph. As remotefilelog does not implement file revision, we have to check if headrevs is implemented. Reviewed By: DurhamG Differential Revision: D6954143 fbshipit-source-id: 0657e58110112537dc5baadf743c657d4ecf372a
This commit is contained in:
parent
516c0b5131
commit
9939f03d8e
@ -135,7 +135,9 @@ def _filerevision(web, req, tmpl, fctx):
|
|||||||
f = fctx.path()
|
f = fctx.path()
|
||||||
text = fctx.data()
|
text = fctx.data()
|
||||||
parity = paritygen(web.stripecount)
|
parity = paritygen(web.stripecount)
|
||||||
ishead = fctx.filerev() in fctx.filelog().headrevs()
|
ishead = False
|
||||||
|
if util.safehasattr(fctx.filelog(), 'headrevs'):
|
||||||
|
ishead = fctx.filerev() in fctx.filelog().headrevs()
|
||||||
|
|
||||||
if util.binary(text):
|
if util.binary(text):
|
||||||
mt = mimetypes.guess_type(f)[0] or 'application/octet-stream'
|
mt = mimetypes.guess_type(f)[0] or 'application/octet-stream'
|
||||||
@ -879,7 +881,9 @@ def annotate(web, req, tmpl):
|
|||||||
fctx = webutil.filectx(web.repo, req)
|
fctx = webutil.filectx(web.repo, req)
|
||||||
f = fctx.path()
|
f = fctx.path()
|
||||||
parity = paritygen(web.stripecount)
|
parity = paritygen(web.stripecount)
|
||||||
ishead = fctx.filerev() in fctx.filelog().headrevs()
|
ishead = False
|
||||||
|
if util.safehasattr(fctx.filelog(), 'headrevs'):
|
||||||
|
ishead = fctx.filerev() in fctx.filelog().headrevs()
|
||||||
|
|
||||||
# parents() is called once per line and several lines likely belong to
|
# parents() is called once per line and several lines likely belong to
|
||||||
# same revision. So it is worth caching.
|
# same revision. So it is worth caching.
|
||||||
|
Loading…
Reference in New Issue
Block a user