mercurial/dirstatemap.py
changeset 49306 2e726c934fcd
parent 49120 3df46f3a3d6c
child 49469 b5c8524827d2
equal deleted inserted replaced
49305:53e9422a9b45 49306:2e726c934fcd
     1 # dirstatemap.py
     1 # dirstatemap.py
     2 #
     2 #
     3 # This software may be used and distributed according to the terms of the
     3 # This software may be used and distributed according to the terms of the
     4 # GNU General Public License version 2 or any later version.
     4 # GNU General Public License version 2 or any later version.
     5 
     5 
     6 
       
     7 import errno
       
     8 
     6 
     9 from .i18n import _
     7 from .i18n import _
    10 
     8 
    11 from . import (
     9 from . import (
    12     error,
    10     error,
    93 
    91 
    94     def _readdirstatefile(self, size=-1):
    92     def _readdirstatefile(self, size=-1):
    95         try:
    93         try:
    96             with self._opendirstatefile() as fp:
    94             with self._opendirstatefile() as fp:
    97                 return fp.read(size)
    95                 return fp.read(size)
    98         except IOError as err:
    96         except FileNotFoundError:
    99             if err.errno != errno.ENOENT:
       
   100                 raise
       
   101             # File doesn't exist, so the current state is empty
    97             # File doesn't exist, so the current state is empty
   102             return b''
    98             return b''
   103 
    99 
   104     @property
   100     @property
   105     def docket(self):
   101     def docket(self):