##// END OF EJS Templates
bookmarks: rely on exception for malformed lines...
marmoute -
r32736:173f1bdc default
parent child Browse files
Show More
@@ -58,12 +58,8 b' class bmstore(dict):'
58 line = line.strip()
58 line = line.strip()
59 if not line:
59 if not line:
60 continue
60 continue
61 if ' ' not in line:
61 try:
62 repo.ui.warn(_('malformed line in .hg/bookmarks: %r\n')
63 % line)
64 continue
65 sha, refspec = line.split(' ', 1)
62 sha, refspec = line.split(' ', 1)
66 try:
67 node = tonode(sha)
63 node = tonode(sha)
68 if node in nm:
64 if node in nm:
69 refspec = encoding.tolocal(refspec)
65 refspec = encoding.tolocal(refspec)
@@ -71,6 +67,7 b' class bmstore(dict):'
71 except (TypeError, ValueError):
67 except (TypeError, ValueError):
72 # - bin(...) can raise TypeError
68 # - bin(...) can raise TypeError
73 # - node in nm can raise ValueError for non-20-bytes entry
69 # - node in nm can raise ValueError for non-20-bytes entry
70 # - split(...) can raise ValueError for string without ' '
74 repo.ui.warn(_('malformed line in .hg/bookmarks: %r\n')
71 repo.ui.warn(_('malformed line in .hg/bookmarks: %r\n')
75 % line)
72 % line)
76 except IOError as inst:
73 except IOError as inst:
General Comments 0
You need to be logged in to leave comments. Login now