mercurial/localrepo.py
changeset 49493 4367c46a89ee
parent 49472 f59e49f6bee4
child 49540 bc2ecf08ae04
child 49571 8fa3f7c3a9ad
equal deleted inserted replaced
49491:c6a1beba27e9 49493:4367c46a89ee
   520     # requires file contains a newline-delimited list of
   520     # requires file contains a newline-delimited list of
   521     # features/capabilities the opener (us) must have in order to use
   521     # features/capabilities the opener (us) must have in order to use
   522     # the repository. This file was introduced in Mercurial 0.9.2,
   522     # the repository. This file was introduced in Mercurial 0.9.2,
   523     # which means very old repositories may not have one. We assume
   523     # which means very old repositories may not have one. We assume
   524     # a missing file translates to no requirements.
   524     # a missing file translates to no requirements.
   525     try:
   525     read = vfs.tryread if allowmissing else vfs.read
   526         return set(vfs.read(b'requires').splitlines())
   526     return set(read(b'requires').splitlines())
   527     except FileNotFoundError:
       
   528         if not allowmissing:
       
   529             raise
       
   530         return set()
       
   531 
   527 
   532 
   528 
   533 def makelocalrepository(baseui, path, intents=None):
   529 def makelocalrepository(baseui, path, intents=None):
   534     """Create a local repository object.
   530     """Create a local repository object.
   535 
   531