diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py --- a/mercurial/bookmarks.py +++ b/mercurial/bookmarks.py @@ -7,7 +7,7 @@ from mercurial.i18n import _ from mercurial.node import hex -from mercurial import encoding, error, util +from mercurial import encoding, util import errno, os def valid(mark): @@ -36,7 +36,7 @@ def read(repo): refspec = encoding.tolocal(refspec) try: bookmarks[refspec] = repo.changelog.lookup(sha) - except error.RepoLookupError: + except LookupError: pass except IOError, inst: if inst.errno != errno.ENOENT: diff --git a/tests/test-bookmarks.t b/tests/test-bookmarks.t --- a/tests/test-bookmarks.t +++ b/tests/test-bookmarks.t @@ -371,3 +371,8 @@ test wrongly formated bookmark * Z 3:125c9a1d6df6 x y 2:db815d6d32e6 +test missing revisions + + $ echo "925d80f479bc z" > .hg/bookmarks + $ hg book + no bookmarks set