# HG changeset patch # User Martin Geisler # Date 2010-08-23 20:16:56 # Node ID 1938954354ec9cfa564b50b35d822863ba40ab37 # Parent b20211b307b39ed2dbfbe992d94d0f1a24e63e13 bookmarks: guard against listing bookmarks on unsupported repos This fixes clones and pulls from statichttprepository repos. diff --git a/hgext/bookmarks.py b/hgext/bookmarks.py --- a/hgext/bookmarks.py +++ b/hgext/bookmarks.py @@ -370,6 +370,11 @@ def reposetup(ui, repo): repo.__class__ = bookmark_repo def listbookmarks(repo): + # We may try to list bookmarks on a repo type that does not + # support it (e.g., statichttprepository). + if not hasattr(repo, '_bookmarks'): + return {} + d = {} for k, v in repo._bookmarks.iteritems(): d[k] = hex(v)