Patchwork [V2] hgweb: don't attempt to show hidden bookmarks (issue3774)

login
register
mail settings
Submitter Kevin Bullock
Date Jan. 25, 2013, 6:45 p.m.
Message ID <ef34fdc517f25b8bb360.1359139553@vpn0-77.vpn.umn.edu>
Download mbox | patch
Permalink /patch/738/
State Superseded
Headers show

Comments

Kevin Bullock - Jan. 25, 2013, 6:45 p.m.
# HG changeset patch
# User Kevin Bullock <kbullock@ringworld.org>
# Date 1359135834 21600
# Branch stable
# Node ID ef34fdc517f25b8bb360817e683f223259994e0a
# Parent  075143f60807c96fd051fd1dde5830852e4e6099
hgweb: don't attempt to show hidden bookmarks (issue3774)

localrepository._bookmarks is unfiltered, but hgweb gets a filtered
repo. This fixes the resulting traceback on the 'bookmarks' page.

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -424,7 +424,7 @@  def tags(web, req, tmpl):
                 latestentry=lambda **x: entries(True, True, **x))
 
 def bookmarks(web, req, tmpl):
-    i = web.repo._bookmarks.items()
+    i = [b for b in web.repo._bookmarks.items() if b[1] in web.repo]
     parity = paritygen(web.stripecount)
 
     def entries(latestonly, **map):
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -704,6 +704,12 @@  check filelog view
 
   $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'log/'`hg id --debug --id`/'babar'
   200 Script output follows
+
+check bookmarks view
+
+  $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'bookmarks'
+  200 Script output follows
+
   $ kill `cat hg.pid`
 
 Checking _enable=False warning if obsolete marker exists