mercurial/hgweb.py
changeset 1782 b9671b41e360
parent 1769 982fb022a16a
child 1780 8a1f2eae2832
equal deleted inserted replaced
1781:284fc722c342 1782:b9671b41e360
   658         mf = cl.read(cl.tip())[0]
   658         mf = cl.read(cl.tip())[0]
   659 
   659 
   660         i = self.repo.tagslist()
   660         i = self.repo.tagslist()
   661         i.reverse()
   661         i.reverse()
   662 
   662 
   663         def entries(**map):
   663         def entries(notip=False, **map):
   664             parity = 0
   664             parity = 0
   665             for k,n in i:
   665             for k,n in i:
       
   666                 if notip and k == "tip": continue
   666                 yield {"parity": parity,
   667                 yield {"parity": parity,
   667                        "tag": k,
   668                        "tag": k,
   668                        "tagmanifest": hex(cl.read(n)[0]),
   669                        "tagmanifest": hex(cl.read(n)[0]),
   669                        "date": cl.read(n)[2],
   670                        "date": cl.read(n)[2],
   670                        "node": hex(n)}
   671                        "node": hex(n)}
   671                 parity = 1 - parity
   672                 parity = 1 - parity
   672 
   673 
   673         yield self.t("tags",
   674         yield self.t("tags",
   674                      manifest=hex(mf),
   675                      manifest=hex(mf),
   675                      entries=entries)
   676                      entries=lambda **x: entries(False, **x),
       
   677                      entriesnotip=lambda **x: entries(True, **x))
   676 
   678 
   677     def summary(self):
   679     def summary(self):
   678         cl = self.repo.changelog
   680         cl = self.repo.changelog
   679         mf = cl.read(cl.tip())[0]
   681         mf = cl.read(cl.tip())[0]
   680 
   682 
   960 
   962 
   961             if req.form.has_key('roots'):
   963             if req.form.has_key('roots'):
   962                 nodes = map(bin, req.form['roots'][0].split(" "))
   964                 nodes = map(bin, req.form['roots'][0].split(" "))
   963 
   965 
   964             z = zlib.compressobj()
   966             z = zlib.compressobj()
   965             f = self.repo.changegroup(nodes)
   967             f = self.repo.changegroup(nodes, 'serve')
   966             while 1:
   968             while 1:
   967                 chunk = f.read(4096)
   969                 chunk = f.read(4096)
   968                 if not chunk:
   970                 if not chunk:
   969                     break
   971                     break
   970                 req.write(z.compress(chunk))
   972                 req.write(z.compress(chunk))