comparison mercurial/hgweb/webcommands.py @ 18563:6d098adc5a46 stable

hgweb: make 'summary' work with hidden changesets (issue3810) Since the 'summary' view used by e.g. gitweb and monoblue shows both a changelog and a bookmarks list, the same changes are needed here as were made to the 'changelog' and 'bookmarks' web commands (56ca4443a343 and 886936ecc21b, respectively).
author Kevin Bullock <kbullock@ringworld.org>
date Tue, 05 Feb 2013 11:31:43 -0600
parents 66ae2ded0968
children 3490c91a1fcb
comparison
equal deleted inserted replaced
18561:7365d031d457 18563:6d098adc5a46
495 node=hex(n), 495 node=hex(n),
496 date=web.repo[n].date()) 496 date=web.repo[n].date())
497 497
498 def bookmarks(**map): 498 def bookmarks(**map):
499 parity = paritygen(web.stripecount) 499 parity = paritygen(web.stripecount)
500 b = web.repo._bookmarks.items() 500 marks = [b for b in web.repo._bookmarks.items() if b[1] in web.repo]
501 for k, n in sorted(b)[:10]: # limit to 10 bookmarks 501 for k, n in sorted(marks)[:10]: # limit to 10 bookmarks
502 yield {'parity': parity.next(), 502 yield {'parity': parity.next(),
503 'bookmark': k, 503 'bookmark': k,
504 'date': web.repo[n].date(), 504 'date': web.repo[n].date(),
505 'node': hex(n)} 505 'node': hex(n)}
506 506
516 'date': web.repo[n].date()} 516 'date': web.repo[n].date()}
517 517
518 def changelist(**map): 518 def changelist(**map):
519 parity = paritygen(web.stripecount, offset=start - end) 519 parity = paritygen(web.stripecount, offset=start - end)
520 l = [] # build a list in forward order for efficiency 520 l = [] # build a list in forward order for efficiency
521 for i in xrange(start, end): 521 revs = []
522 if start < end:
523 revs = web.repo.changelog.revs(start, end - 1)
524 for i in revs:
522 ctx = web.repo[i] 525 ctx = web.repo[i]
523 n = ctx.node() 526 n = ctx.node()
524 hn = hex(n) 527 hn = hex(n)
525 528
526 l.append(tmpl( 529 l.append(tmpl(