--- a/mercurial/bookmarks.py Wed Jul 06 19:25:53 2011 -0500
+++ b/mercurial/bookmarks.py Tue Jul 05 10:13:54 2011 +0200
@@ -26,6 +26,9 @@
bookmarks = {}
try:
for line in repo.opener('bookmarks'):
+ line = line.strip()
+ if ' ' not in line:
+ continue
sha, refspec = line.strip().split(' ', 1)
refspec = encoding.tolocal(refspec)
try:
--- a/tests/test-bookmarks.t Wed Jul 06 19:25:53 2011 -0500
+++ b/tests/test-bookmarks.t Tue Jul 05 10:13:54 2011 +0200
@@ -342,3 +342,11 @@
* Z 3:125c9a1d6df6
x y 2:db815d6d32e6
+test wrongly formated bookmark
+
+ $ echo '' >> .hg/bookmarks
+ $ hg bookmarks
+ X2 1:925d80f479bb
+ Y 2:db815d6d32e6
+ * Z 3:125c9a1d6df6
+ x y 2:db815d6d32e6