Mercurial > hg
comparison mercurial/bookmarks.py @ 14846:5097d8b5078c
bookmarks: add a warning for non empty malformed line
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Tue, 05 Jul 2011 10:20:27 +0200 |
parents | 677339529a53 |
children | 400ba7cccbae |
comparison
equal
deleted
inserted
replaced
14845:677339529a53 | 14846:5097d8b5078c |
---|---|
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() | 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) |
34 try: | 37 try: |
35 bookmarks[refspec] = repo.changelog.lookup(sha) | 38 bookmarks[refspec] = repo.changelog.lookup(sha) |