mercurial/hgweb.py
changeset 197 b388603984fc
parent 195 b98bcf66dd9d
child 198 c88ef31fb5c0
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):