##// END OF EJS Templates
bookmarks: more robust parsing of bookmarks file
Pierre-Yves David -
r14845:67733952 default
parent child Browse files
Show More
@@ -26,6 +26,9 b' def read(repo):'
26 bookmarks = {}
26 bookmarks = {}
27 try:
27 try:
28 for line in repo.opener('bookmarks'):
28 for line in repo.opener('bookmarks'):
29 line = line.strip()
30 if ' ' not in line:
31 continue
29 sha, refspec = line.strip().split(' ', 1)
32 sha, refspec = line.strip().split(' ', 1)
30 refspec = encoding.tolocal(refspec)
33 refspec = encoding.tolocal(refspec)
31 try:
34 try:
@@ -342,3 +342,11 b' create bundle with two heads'
342 * Z 3:125c9a1d6df6
342 * Z 3:125c9a1d6df6
343 x y 2:db815d6d32e6
343 x y 2:db815d6d32e6
344
344
345 test wrongly formated bookmark
346
347 $ echo '' >> .hg/bookmarks
348 $ hg bookmarks
349 X2 1:925d80f479bb
350 Y 2:db815d6d32e6
351 * Z 3:125c9a1d6df6
352 x y 2:db815d6d32e6
General Comments 0
You need to be logged in to leave comments. Login now