##// END OF EJS Templates
bookmarks: use new function for getting first line of string...
Martin von Zweigbergk -
r49889:f808417d default
parent child Browse files
Show More
@@ -27,6 +27,7 b' from . import ('
27 util,
27 util,
28 )
28 )
29 from .utils import (
29 from .utils import (
30 stringutil,
30 urlutil,
31 urlutil,
31 )
32 )
32
33
@@ -342,7 +343,7 b' def _readactive(repo, marks):'
342 # No readline() in osutil.posixfile, reading everything is
343 # No readline() in osutil.posixfile, reading everything is
343 # cheap.
344 # cheap.
344 content = repo.vfs.tryread(b'bookmarks.current')
345 content = repo.vfs.tryread(b'bookmarks.current')
345 mark = encoding.tolocal((content.splitlines() or [b''])[0])
346 mark = encoding.tolocal(stringutil.firstline(content))
346 if mark == b'' or mark not in marks:
347 if mark == b'' or mark not in marks:
347 mark = None
348 mark = None
348 return mark
349 return mark
General Comments 0
You need to be logged in to leave comments. Login now