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

Kevin Bullock kbullock+mercurial at ringworld.org
Fri Jan 25 12:45:53 CST 2013


# HG changeset patch
# User Kevin Bullock <kbullock at 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.

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


More information about the Mercurial-devel mailing list