mirror of
https://github.com/facebook/sapling.git
synced 2025-01-06 04:43:19 +03:00
hgweb: add view-only support
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hgweb: add view-only support Turning on hgweb.viewonly prevents pulls. This is a good idea for machines with limited CPU/bandwidth. manifest hash: 68d1d04dad83743f3326e8b4f2e51387787f06c0 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCm0tnywK+sNU5EO8RAm1fAJ9rNjWOr+e3UosFyauBSEgyie8meACeKwjc QqbfuXPLg/+TKr2HIrC3DA4= =i8Yj -----END PGP SIGNATURE-----
This commit is contained in:
parent
ebfa981ca0
commit
74463f46b4
@ -113,6 +113,7 @@ class hgweb:
|
|||||||
self.reponame = name
|
self.reponame = name
|
||||||
self.repo = repository(ui(), path)
|
self.repo = repository(ui(), path)
|
||||||
self.t = templater(templatemap)
|
self.t = templater(templatemap)
|
||||||
|
self.viewonly = 0
|
||||||
|
|
||||||
def date(self, cs):
|
def date(self, cs):
|
||||||
return time.asctime(time.gmtime(float(cs[2].split(' ')[0])))
|
return time.asctime(time.gmtime(float(cs[2].split(' ')[0])))
|
||||||
@ -614,6 +615,9 @@ class hgweb:
|
|||||||
elif args['cmd'][0] == 'changegroup':
|
elif args['cmd'][0] == 'changegroup':
|
||||||
httphdr("application/hg-changegroup")
|
httphdr("application/hg-changegroup")
|
||||||
nodes = []
|
nodes = []
|
||||||
|
if self.viewonly:
|
||||||
|
return
|
||||||
|
|
||||||
if args.has_key('roots'):
|
if args.has_key('roots'):
|
||||||
nodes = map(bin, args['roots'][0].split(" "))
|
nodes = map(bin, args['roots'][0].split(" "))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user