mercurial/statichttprepo.py
changeset 49306 2e726c934fcd
parent 48946 642e31cb55f0
child 49691 c37287340c00
equal deleted inserted replaced
49305:53e9422a9b45 49306:2e726c934fcd
   179         self._wanted_sidedata = set()
   179         self._wanted_sidedata = set()
   180         self.features = set()
   180         self.features = set()
   181 
   181 
   182         try:
   182         try:
   183             requirements = set(self.vfs.read(b'requires').splitlines())
   183             requirements = set(self.vfs.read(b'requires').splitlines())
   184         except IOError as inst:
   184         except FileNotFoundError:
   185             if inst.errno != errno.ENOENT:
       
   186                 raise
       
   187             requirements = set()
   185             requirements = set()
   188 
   186 
   189             # check if it is a non-empty old-style repository
   187             # check if it is a non-empty old-style repository
   190             try:
   188             try:
   191                 fp = self.vfs(b"00changelog.i")
   189                 fp = self.vfs(b"00changelog.i")
   192                 fp.read(1)
   190                 fp.read(1)
   193                 fp.close()
   191                 fp.close()
   194             except IOError as inst:
   192             except FileNotFoundError:
   195                 if inst.errno != errno.ENOENT:
       
   196                     raise
       
   197                 # we do not care about empty old-style repositories here
   193                 # we do not care about empty old-style repositories here
   198                 msg = _(b"'%s' does not appear to be an hg repository") % path
   194                 msg = _(b"'%s' does not appear to be an hg repository") % path
   199                 raise error.RepoError(msg)
   195                 raise error.RepoError(msg)
   200         if requirementsmod.SHARESAFE_REQUIREMENT in requirements:
   196         if requirementsmod.SHARESAFE_REQUIREMENT in requirements:
   201             storevfs = vfsclass(self.vfs.join(b'store'))
   197             storevfs = vfsclass(self.vfs.join(b'store'))