diff 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
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Tue Feb 05 12:58:21 2013 +0100
+++ b/mercurial/hgweb/webcommands.py	Tue Feb 05 11:31:43 2013 -0600
@@ -497,8 +497,8 @@
 
     def bookmarks(**map):
         parity = paritygen(web.stripecount)
-        b = web.repo._bookmarks.items()
-        for k, n in sorted(b)[:10]:  # limit to 10 bookmarks
+        marks = [b for b in web.repo._bookmarks.items() if b[1] in web.repo]
+        for k, n in sorted(marks)[:10]:  # limit to 10 bookmarks
             yield {'parity': parity.next(),
                    'bookmark': k,
                    'date': web.repo[n].date(),
@@ -518,7 +518,10 @@
     def changelist(**map):
         parity = paritygen(web.stripecount, offset=start - end)
         l = [] # build a list in forward order for efficiency
-        for i in xrange(start, end):
+        revs = []
+        if start < end:
+            revs = web.repo.changelog.revs(start, end - 1)
+        for i in revs:
             ctx = web.repo[i]
             n = ctx.node()
             hn = hex(n)