mercurial/bookmarks.py
changeset 14848 09c9c120a817
parent 14847 400ba7cccbae
child 14946 28762bf809d8
equal deleted inserted replaced
14847:400ba7cccbae 14848:09c9c120a817
    25     '''
    25     '''
    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 line:
       
    31                 continue
    30             if ' ' not in line:
    32             if ' ' not in line:
    31                 if line:
    33                 repo.ui.warn(_('malformed line in .hg/bookmarks: %r\n') % line)
    32                     msg = _('malformed line in .hg/bookmarks: %r\n')
       
    33                     repo.ui.warn( msg % line)
       
    34                 continue
    34                 continue
    35             sha, refspec = line.split(' ', 1)
    35             sha, refspec = line.split(' ', 1)
    36             refspec = encoding.tolocal(refspec)
    36             refspec = encoding.tolocal(refspec)
    37             try:
    37             try:
    38                 bookmarks[refspec] = repo.changelog.lookup(sha)
    38                 bookmarks[refspec] = repo.changelog.lookup(sha)