comparison mercurial/hgweb.py @ 197:b388603984fc

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-----
author mpm@selenic.com
date Mon, 30 May 2005 09:20:39 -0800
parents b98bcf66dd9d
children c88ef31fb5c0
comparison
equal deleted inserted replaced
196:48827121af7e 197:b388603984fc
111 templatemap = templatemap or templatepath() 111 templatemap = templatemap or templatepath()
112 112
113 self.reponame = name 113 self.reponame = name
114 self.repo = repository(ui(), path) 114 self.repo = repository(ui(), path)
115 self.t = templater(templatemap) 115 self.t = templater(templatemap)
116 self.viewonly = 0
116 117
117 def date(self, cs): 118 def date(self, cs):
118 return time.asctime(time.gmtime(float(cs[2].split(' ')[0]))) 119 return time.asctime(time.gmtime(float(cs[2].split(' ')[0])))
119 120
120 def listfiles(self, files, mf): 121 def listfiles(self, files, mf):
612 sys.stdout.write(" ".join(map(hex, b)) + "\n") 613 sys.stdout.write(" ".join(map(hex, b)) + "\n")
613 614
614 elif args['cmd'][0] == 'changegroup': 615 elif args['cmd'][0] == 'changegroup':
615 httphdr("application/hg-changegroup") 616 httphdr("application/hg-changegroup")
616 nodes = [] 617 nodes = []
618 if self.viewonly:
619 return
620
617 if args.has_key('roots'): 621 if args.has_key('roots'):
618 nodes = map(bin, args['roots'][0].split(" ")) 622 nodes = map(bin, args['roots'][0].split(" "))
619 623
620 z = zlib.compressobj() 624 z = zlib.compressobj()
621 for chunk in self.repo.changegroup(nodes): 625 for chunk in self.repo.changegroup(nodes):