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