##// END OF EJS Templates
bookmarks: add a warning for non empty malformed line
Pierre-Yves David -
r14846:5097d8b5 default
parent child Browse files
Show More
@@ -28,6 +28,9 b' def read(repo):'
28 for line in repo.opener('bookmarks'):
28 for line in repo.opener('bookmarks'):
29 line = line.strip()
29 line = line.strip()
30 if ' ' not in line:
30 if ' ' not in line:
31 if line:
32 msg = _('malformed line in .hg/bookmarks: %r\n')
33 repo.ui.warn( msg % line)
31 continue
34 continue
32 sha, refspec = line.strip().split(' ', 1)
35 sha, refspec = line.strip().split(' ', 1)
33 refspec = encoding.tolocal(refspec)
36 refspec = encoding.tolocal(refspec)
@@ -350,3 +350,11 b' test wrongly formated bookmark'
350 Y 2:db815d6d32e6
350 Y 2:db815d6d32e6
351 * Z 3:125c9a1d6df6
351 * Z 3:125c9a1d6df6
352 x y 2:db815d6d32e6
352 x y 2:db815d6d32e6
353 $ echo "Ican'thasformatedlines" >> .hg/bookmarks
354 $ hg bookmarks
355 malformed line in .hg/bookmarks: "Ican'thasformatedlines"
356 X2 1:925d80f479bb
357 Y 2:db815d6d32e6
358 * Z 3:125c9a1d6df6
359 x y 2:db815d6d32e6
360
General Comments 0
You need to be logged in to leave comments. Login now