Mercurial > hg
diff hgext/bookmarks.py @ 12026:1938954354ec stable
bookmarks: guard against listing bookmarks on unsupported repos
This fixes clones and pulls from statichttprepository repos.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Mon, 23 Aug 2010 22:16:56 +0200 |
parents | 31dde4c3bb83 |
children | e1a3d7ed478e ebfc46929f3e |
line wrap: on
line diff
--- a/hgext/bookmarks.py Sat Aug 21 10:44:57 2010 -0500 +++ b/hgext/bookmarks.py Mon Aug 23 22:16:56 2010 +0200 @@ -370,6 +370,11 @@ 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)