comparison mercurial/hgweb/hgweb_mod.py @ 4300:05d15c456fb2

hgweb: display named branches in gitweb-style summary page
author greg@maptuit.com
date Fri, 16 Mar 2007 17:55:42 -0400
parents a1406a50ca83
children f344440fdcb0
comparison
equal deleted inserted replaced
4299:6b1e1b9da853 4300:05d15c456fb2
528 tag=k, 528 tag=k,
529 node=hex(n), 529 node=hex(n),
530 date=self.repo.changectx(n).date()) 530 date=self.repo.changectx(n).date())
531 parity += 1 531 parity += 1
532 532
533
534 def branches(**map):
535 parity = 0
536
537 b = self.repo.branchtags()
538 l = [(-self.repo.changelog.rev(n), n, t) for t, n in b.items()]
539 l.sort()
540
541 for r,n,t in l:
542 ctx = self.repo.changectx(n)
543
544 yield {'parity': self.stripes(parity),
545 'branch': t,
546 'node': hex(n),
547 'date': ctx.date()}
548 parity += 1
549
533 def heads(**map): 550 def heads(**map):
534 parity = 0 551 parity = 0
535 count = 0 552 count = 0
536 553
537 for node in self.repo.heads(): 554 for node in self.repo.heads():
576 owner=(self.config("ui", "username") or # preferred 593 owner=(self.config("ui", "username") or # preferred
577 self.config("web", "contact") or # deprecated 594 self.config("web", "contact") or # deprecated
578 self.config("web", "author", "unknown")), # also 595 self.config("web", "author", "unknown")), # also
579 lastchange=cl.read(cl.tip())[2], 596 lastchange=cl.read(cl.tip())[2],
580 tags=tagentries, 597 tags=tagentries,
598 branches=branches,
581 heads=heads, 599 heads=heads,
582 shortlog=changelist, 600 shortlog=changelist,
583 node=hex(cl.tip()), 601 node=hex(cl.tip()),
584 archives=self.archivelist("tip")) 602 archives=self.archivelist("tip"))
585 603