# HG changeset patch # User Shaun Ek # Date 1300909324 14400 # Node ID c4095c3519d61f97f78fd767c1f81c6b4f06df80 # Parent b2e4864dc599b99eb3bc57963d7d576ce9548ca2 Fixed bug that was thowing a KeyError when including "{bookmark}" in the output. This resolves issue #17 (Bookmarks have moved into core for 1.8) on https://bitbucket.org/sjl/hg-prompt/. The end of the stack track was.... ----------------------------- File "/Users/dak180/Applications/Build/hgExtensions/hg-prompt/prompt.py", line 101, in _bookmark book = extensions.find('bookmarks').current(repo) File "/sw/lib/python2.6/site-packages/mercurial/extensions.py", line 30, in find raise KeyError(name) KeyError: 'bookmarks' ----------------------------- I personally was getting this error on mercurial versions 1.8.1 and 1.6.3 (although I am not exactly sure why I got it on 1.6.3). diff -r b2e4864dc599 -r c4095c3519d6 prompt.py --- a/prompt.py Sat Jan 22 12:28:23 2011 -0500 +++ b/prompt.py Wed Mar 23 15:42:04 2011 -0400 @@ -101,6 +101,8 @@ book = extensions.find('bookmarks').current(repo) except AttributeError: book = getattr(repo, '_bookmarkcurrent', None) + except KeyError: + book = getattr(repo, '_bookmarkcurrent', None) return _with_groups(m.groups(), book) if book else '' def _branch(m):