Mercurial > hg
comparison hgext/bookmarks.py @ 7666:2ad81e9b075b
bookmarks: work around missing posixfile_nt.readline()
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 19 Jan 2009 00:36:32 +0100 |
parents | f83a2b1d1a71 |
children | e8d62d6133c2 |
comparison
equal
deleted
inserted
replaced
7665:950484f05f16 | 7666:2ad81e9b075b |
---|---|
78 if repo._bookmarkcurrent: | 78 if repo._bookmarkcurrent: |
79 return repo._bookmarkcurrent | 79 return repo._bookmarkcurrent |
80 mark = None | 80 mark = None |
81 if os.path.exists(repo.join('bookmarks.current')): | 81 if os.path.exists(repo.join('bookmarks.current')): |
82 file = repo.opener('bookmarks.current') | 82 file = repo.opener('bookmarks.current') |
83 mark = file.readline() | 83 # No readline() in posixfile_nt, reading everything is cheap |
84 mark = (file.readlines() or [''])[0] | |
84 if mark == '': | 85 if mark == '': |
85 mark = None | 86 mark = None |
86 file.close() | 87 file.close() |
87 repo._bookmarkcurrent = mark | 88 repo._bookmarkcurrent = mark |
88 return mark | 89 return mark |