##// END OF EJS Templates
Small cleanups for the new tag code
Brendan Cully -
r4539:e6c69a24 default
parent child Browse files
Show More
@@ -133,15 +133,15 b' class hgweb(object):'
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
135
136 def taglistdict(self,node):
136 def nodetagsdict(self, node):
137 return [{"name":i} for i in self.repo.nodetags(node)]
137 return [{"name": i} for i in self.repo.nodetags(node)]
138
138
139 def branchlistdict(self,node):
139 def nodebranchdict(self, ctx):
140 l=[]
140 branches = []
141 for t, tn in self.repo.branchtags().items():
141 branch = ctx.branch()
142 if tn == node:
142 if self.repo.branchtags()[branch] == ctx.node():
143 l.append({"name":t})
143 branches.append({"name": branch})
144 return l
144 return branches
145
145
146 def showtag(self, t1, node=nullid, **args):
146 def showtag(self, t1, node=nullid, **args):
147 for t in self.repo.nodetags(node):
147 for t in self.repo.nodetags(node):
@@ -222,8 +222,8 b' class hgweb(object):'
222 "files": self.listfilediffs(ctx.files(), n),
222 "files": self.listfilediffs(ctx.files(), n),
223 "rev": i,
223 "rev": i,
224 "node": hex(n),
224 "node": hex(n),
225 "tags": self.taglistdict(n),
225 "tags": self.nodetagsdict(n),
226 "branches": self.branchlistdict(n)})
226 "branches": self.nodebranchdict(ctx)})
227
227
228 for e in l:
228 for e in l:
229 yield e
229 yield e
@@ -287,8 +287,8 b' class hgweb(object):'
287 files=self.listfilediffs(ctx.files(), n),
287 files=self.listfilediffs(ctx.files(), n),
288 rev=ctx.rev(),
288 rev=ctx.rev(),
289 node=hex(n),
289 node=hex(n),
290 tags=self.taglistdict(n),
290 tags=self.nodetagsdict(n),
291 branches=self.branchlistdict(n))
291 branches=self.nodebranchdict(ctx))
292
292
293 if count >= self.maxchanges:
293 if count >= self.maxchanges:
294 break
294 break
@@ -329,8 +329,8 b' class hgweb(object):'
329 date=ctx.date(),
329 date=ctx.date(),
330 files=files,
330 files=files,
331 archives=self.archivelist(hex(n)),
331 archives=self.archivelist(hex(n)),
332 tags=self.taglistdict(n),
332 tags=self.nodetagsdict(n),
333 branches=self.branchlistdict(n))
333 branches=self.nodebranchdict(ctx))
334
334
335 def filelog(self, fctx):
335 def filelog(self, fctx):
336 f = fctx.path()
336 f = fctx.path()
@@ -499,8 +499,8 b' class hgweb(object):'
499 fentries=filelist,
499 fentries=filelist,
500 dentries=dirlist,
500 dentries=dirlist,
501 archives=self.archivelist(hex(node)),
501 archives=self.archivelist(hex(node)),
502 tags=self.taglistdict(node),
502 tags=self.nodetagsdict(node),
503 branches=self.branchlistdict(node))
503 branches=self.nodebranchdict(ctx))
504
504
505 def tags(self):
505 def tags(self):
506 i = self.repo.tagslist()
506 i = self.repo.tagslist()
@@ -574,8 +574,8 b' class hgweb(object):'
574 date=ctx.date(),
574 date=ctx.date(),
575 rev=i,
575 rev=i,
576 node=hn,
576 node=hn,
577 tags=self.taglistdict(n),
577 tags=self.nodetagsdict(n),
578 branches=self.branchlistdict(n)))
578 branches=self.nodebranchdict(ctx)))
579
579
580 yield l
580 yield l
581
581
General Comments 0
You need to be logged in to leave comments. Login now