mercurial/bookmarks.py
changeset 49306 2e726c934fcd
parent 49248 63fd0282ad40
child 50929 18c8c18993f0
equal deleted inserted replaced
49305:53e9422a9b45 49306:2e726c934fcd
     4 #
     4 #
     5 # This software may be used and distributed according to the terms of the
     5 # This software may be used and distributed according to the terms of the
     6 # GNU General Public License version 2 or any later version.
     6 # GNU General Public License version 2 or any later version.
     7 
     7 
     8 
     8 
     9 import errno
       
    10 import struct
     9 import struct
    11 
    10 
    12 from .i18n import _
    11 from .i18n import _
    13 from .node import (
    12 from .node import (
    14     bin,
    13     bin,
   112                             bookmarkspath = b'.hg/store/bookmarks'
   111                             bookmarkspath = b'.hg/store/bookmarks'
   113                         repo.ui.warn(
   112                         repo.ui.warn(
   114                             _(b'malformed line in %s: %r\n')
   113                             _(b'malformed line in %s: %r\n')
   115                             % (bookmarkspath, pycompat.bytestr(line))
   114                             % (bookmarkspath, pycompat.bytestr(line))
   116                         )
   115                         )
   117         except IOError as inst:
   116         except FileNotFoundError:
   118             if inst.errno != errno.ENOENT:
   117             pass
   119                 raise
       
   120         self._active = _readactive(repo, self)
   118         self._active = _readactive(repo, self)
   121 
   119 
   122     @property
   120     @property
   123     def active(self):
   121     def active(self):
   124         return self._active
   122         return self._active