mercurial/hgweb/hgweb_mod.py
changeset 4538 4272ae760bb1
parent 4468 8af65bc092b0
child 4539 e6c69a2491ed
equal deleted inserted replaced
4537:2f489b00f8eb 4538:4272ae760bb1
   130     def renamelink(self, fl, node):
   130     def renamelink(self, fl, node):
   131         r = fl.renamed(node)
   131         r = fl.renamed(node)
   132         if r:
   132         if r:
   133             return [dict(file=r[0], node=hex(r[1]))]
   133             return [dict(file=r[0], node=hex(r[1]))]
   134         return []
   134         return []
       
   135 
       
   136     def taglistdict(self,node):
       
   137         return [{"name":i} for i in self.repo.nodetags(node)]
       
   138 
       
   139     def branchlistdict(self,node):
       
   140         l=[]
       
   141         for t, tn in self.repo.branchtags().items():
       
   142             if tn == node:
       
   143                 l.append({"name":t})
       
   144         return l
   135 
   145 
   136     def showtag(self, t1, node=nullid, **args):
   146     def showtag(self, t1, node=nullid, **args):
   137         for t in self.repo.nodetags(node):
   147         for t in self.repo.nodetags(node):
   138             yield self.t(t1, tag=t, **args)
   148             yield self.t(t1, tag=t, **args)
   139 
   149 
   209                              "changelogtag": self.showtag("changelogtag",n),
   219                              "changelogtag": self.showtag("changelogtag",n),
   210                              "desc": ctx.description(),
   220                              "desc": ctx.description(),
   211                              "date": ctx.date(),
   221                              "date": ctx.date(),
   212                              "files": self.listfilediffs(ctx.files(), n),
   222                              "files": self.listfilediffs(ctx.files(), n),
   213                              "rev": i,
   223                              "rev": i,
   214                              "node": hex(n)})
   224                              "node": hex(n),
       
   225                              "tags": self.taglistdict(n),
       
   226                              "branches": self.branchlistdict(n)})
   215 
   227 
   216             for e in l:
   228             for e in l:
   217                 yield e
   229                 yield e
   218 
   230 
   219         maxchanges = shortlog and self.maxshortchanges or self.maxchanges
   231         maxchanges = shortlog and self.maxshortchanges or self.maxchanges
   272                              changelogtag=self.showtag("changelogtag",n),
   284                              changelogtag=self.showtag("changelogtag",n),
   273                              desc=ctx.description(),
   285                              desc=ctx.description(),
   274                              date=ctx.date(),
   286                              date=ctx.date(),
   275                              files=self.listfilediffs(ctx.files(), n),
   287                              files=self.listfilediffs(ctx.files(), n),
   276                              rev=ctx.rev(),
   288                              rev=ctx.rev(),
   277                              node=hex(n))
   289                              node=hex(n),
       
   290                              tags=self.taglistdict(n),
       
   291                              branches=self.branchlistdict(n))
   278 
   292 
   279                 if count >= self.maxchanges:
   293                 if count >= self.maxchanges:
   280                     break
   294                     break
   281 
   295 
   282         cl = self.repo.changelog
   296         cl = self.repo.changelog
   312                      changesettag=self.showtag("changesettag",n),
   326                      changesettag=self.showtag("changesettag",n),
   313                      author=ctx.user(),
   327                      author=ctx.user(),
   314                      desc=ctx.description(),
   328                      desc=ctx.description(),
   315                      date=ctx.date(),
   329                      date=ctx.date(),
   316                      files=files,
   330                      files=files,
   317                      archives=self.archivelist(hex(n)))
   331                      archives=self.archivelist(hex(n)),
       
   332                      tags=self.taglistdict(n),
       
   333                      branches=self.branchlistdict(n))
   318 
   334 
   319     def filelog(self, fctx):
   335     def filelog(self, fctx):
   320         f = fctx.path()
   336         f = fctx.path()
   321         fl = fctx.filelog()
   337         fl = fctx.filelog()
   322         count = fl.count()
   338         count = fl.count()
   480                      path=abspath,
   496                      path=abspath,
   481                      up=_up(abspath),
   497                      up=_up(abspath),
   482                      upparity=parity.next(),
   498                      upparity=parity.next(),
   483                      fentries=filelist,
   499                      fentries=filelist,
   484                      dentries=dirlist,
   500                      dentries=dirlist,
   485                      archives=self.archivelist(hex(node)))
   501                      archives=self.archivelist(hex(node)),
       
   502                      tags=self.taglistdict(node),
       
   503                      branches=self.branchlistdict(node))
   486 
   504 
   487     def tags(self):
   505     def tags(self):
   488         i = self.repo.tagslist()
   506         i = self.repo.tagslist()
   489         i.reverse()
   507         i.reverse()
   490         parity = paritygen(self.stripecount)
   508         parity = paritygen(self.stripecount)
   543         def changelist(**map):
   561         def changelist(**map):
   544             parity = paritygen(self.stripecount, offset=start-end)
   562             parity = paritygen(self.stripecount, offset=start-end)
   545             l = [] # build a list in forward order for efficiency
   563             l = [] # build a list in forward order for efficiency
   546             for i in xrange(start, end):
   564             for i in xrange(start, end):
   547                 ctx = self.repo.changectx(i)
   565                 ctx = self.repo.changectx(i)
   548                 hn = hex(ctx.node())
   566                 n = ctx.node()
       
   567                 hn = hex(n)
   549 
   568 
   550                 l.insert(0, self.t(
   569                 l.insert(0, self.t(
   551                     'shortlogentry',
   570                     'shortlogentry',
   552                     parity=parity.next(),
   571                     parity=parity.next(),
   553                     author=ctx.user(),
   572                     author=ctx.user(),
   554                     desc=ctx.description(),
   573                     desc=ctx.description(),
   555                     date=ctx.date(),
   574                     date=ctx.date(),
   556                     rev=i,
   575                     rev=i,
   557                     node=hn))
   576                     node=hn,
       
   577                     tags=self.taglistdict(n),
       
   578                     branches=self.branchlistdict(n)))
   558 
   579 
   559             yield l
   580             yield l
   560 
   581 
   561         cl = self.repo.changelog
   582         cl = self.repo.changelog
   562         count = cl.count()
   583         count = cl.count()